Compare commits
2 Commits
e5ba5c5236
...
2958cc4c7a
| Author | SHA1 | Date | |
|---|---|---|---|
| 2958cc4c7a | |||
| d48193d65c |
169
#flake.nix#
Normal file
169
#flake.nix#
Normal file
@@ -0,0 +1,169 @@
|
||||
{
|
||||
description = "Home Manager configuration of phundrak";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
devenv = {
|
||||
url = "github:cachix/devenv";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nix-index-database = {
|
||||
url = "github:nix-community/nix-index-database";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
pumo-system-info = {
|
||||
url = "git+https://labs.phundrak.com/phundrak/pumo-system-info";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
quickshell = {
|
||||
url = "git+https://git.outfoxxed.me/quickshell/quickshell";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
claude-desktop = {
|
||||
url = "github:k3d3/claude-desktop-linux-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
zen-browser = {
|
||||
url = "github:youwen5/zen-browser-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
|
||||
extra-substituters = "https://devenv.cachix.org";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
devenv,
|
||||
...
|
||||
} @ inputs: let
|
||||
inherit (self) outputs;
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
formatter.${system} = pkgs.alejandra;
|
||||
|
||||
packages.${system} = {
|
||||
devenv-up = self.devShells.${system}.default.config.procfileScript;
|
||||
devenv-test = self.devShells.${system}.default.config.test;
|
||||
};
|
||||
|
||||
devShells.${system}.default = devenv.lib.mkShell {
|
||||
inherit inputs pkgs;
|
||||
modules = [
|
||||
(
|
||||
{pkgs, ...}: {
|
||||
packages = [pkgs.nh];
|
||||
git-hooks.hooks = {
|
||||
alejandra.enable = true;
|
||||
commitizen.enable = true;
|
||||
detect-private-keys.enable = true;
|
||||
end-of-file-fixer.enable = true;
|
||||
deadnix.enable = true;
|
||||
ripsecrets.enable = true;
|
||||
statix.enable = true;
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
|
||||
homeConfigurations = let
|
||||
extraSpecialArgs = {inherit inputs outputs system;};
|
||||
in {
|
||||
"phundrak@alys" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
modules = [
|
||||
./users/phundrak/host/alys.nix
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
"phundrak@marpa" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
# extraSpecialArgs = {
|
||||
# inherit inputs outputs;
|
||||
# };
|
||||
inherit extraSpecialArgs;
|
||||
modules = [
|
||||
./users/phundrak/host/marpa.nix
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
"phundrak@gampo" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
modules = [
|
||||
./users/phundrak/host/gampo.nix
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
"phundrak@tilo" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
modules = [
|
||||
./users/phundrak/host/tilo.nix
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = let
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
in {
|
||||
alys = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
./hosts/alys/configuration.nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
gampo = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
./hosts/gampo/configuration.nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
marpa = nixpkgs.lib.nixosSystem {
|
||||
inherit specialArgs; modules = [
|
||||
./hosts/marpa/configuration.nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
tilo = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
./hosts/tilo/configuration.nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
57
flake.lock
generated
57
flake.lock
generated
@@ -33,6 +33,27 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"claude-desktop": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1761825061,
|
||||
"narHash": "sha256-AeRQZKr8+1XQer+WmbwtQaQBy05UDgeNNE7YZjNLuS0=",
|
||||
"owner": "k3d3",
|
||||
"repo": "claude-desktop-linux-flake",
|
||||
"rev": "791cd93cfe216ad06ab740f0fdc142119b1d6ec2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "k3d3",
|
||||
"repo": "claude-desktop-linux-flake",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"devenv": {
|
||||
"inputs": {
|
||||
"cachix": "cachix",
|
||||
@@ -113,6 +134,24 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
@@ -259,7 +298,7 @@
|
||||
},
|
||||
"pumo-system-info": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
@@ -301,6 +340,7 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"claude-desktop": "claude-desktop",
|
||||
"devenv": "devenv",
|
||||
"home-manager": "home-manager",
|
||||
"nix-index-database": "nix-index-database",
|
||||
@@ -367,6 +407,21 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"zen-browser": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
||||
42
flake.nix
42
flake.nix
@@ -34,6 +34,11 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
claude-desktop = {
|
||||
url = "github:k3d3/claude-desktop-linux-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
zen-browser = {
|
||||
url = "github:youwen5/zen-browser-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -83,42 +88,33 @@
|
||||
];
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
homeConfigurations = let
|
||||
extraSpecialArgs = {inherit inputs outputs system;};
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
in {
|
||||
"phundrak@alys" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
inherit extraSpecialArgs pkgs;
|
||||
modules = [
|
||||
./users/phundrak/host/alys.nix
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
"phundrak@marpa" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
inherit extraSpecialArgs pkgs;
|
||||
modules = [
|
||||
./users/phundrak/host/marpa.nix
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
"phundrak@gampo" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
inherit extraSpecialArgs pkgs;
|
||||
modules = [
|
||||
./users/phundrak/host/gampo.nix
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
};
|
||||
"phundrak@tilo" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
inherit extraSpecialArgs pkgs;
|
||||
modules = [
|
||||
./users/phundrak/host/tilo.nix
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
@@ -126,30 +122,32 @@
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
nixosConfigurations = let
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
in {
|
||||
alys = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
./hosts/alys/configuration.nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
gampo = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
./hosts/gampo/configuration.nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
marpa = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
./hosts/marpa/configuration.nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
tilo = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
./hosts/tilo/configuration.nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
|
||||
@@ -9,26 +9,26 @@ in {
|
||||
options.mySystem.services.calibre = {
|
||||
enable = mkEnableOption "Enable Calibre Web";
|
||||
user = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
default = "phundrak";
|
||||
};
|
||||
group = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
default = "users";
|
||||
};
|
||||
dataDir = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
example = "/tank/calibre/conf";
|
||||
default = "/tank/calibre/conf";
|
||||
};
|
||||
library = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
example = "/tank/calibre/library";
|
||||
default = "/tank/calibre/library";
|
||||
};
|
||||
};
|
||||
config.services.calibre-web = mkIf cfg.enable {
|
||||
inherit (cfg) enable user group dataDir;
|
||||
inherit (cfg) enable user dataDir group;
|
||||
options = {
|
||||
calibreLibrary = cfg.library;
|
||||
enableBookConversion = true;
|
||||
|
||||
@@ -9,16 +9,16 @@ in {
|
||||
options.mySystem.services.jellyfin = {
|
||||
enable = mkEnableOption "Enable Jellyfin";
|
||||
dataDir = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
default = "/tank/jellyfin/data";
|
||||
example = "/tank/jellyfin/data";
|
||||
};
|
||||
user = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
default = "phundrak";
|
||||
};
|
||||
group = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
default = "users";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,17 +9,17 @@ in {
|
||||
options.mySystem.services.plex = {
|
||||
enable = mkEnableOption "Enable Plex";
|
||||
group = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
default = "users";
|
||||
example = "users";
|
||||
description = "Group under which Plex runs";
|
||||
};
|
||||
dataDir = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
example = "/tank/plex-config";
|
||||
};
|
||||
user = mkOption {
|
||||
type = types.string;
|
||||
type = types.str;
|
||||
default = "phundrak";
|
||||
};
|
||||
};
|
||||
|
||||
18
users/modules/dev/ai/claude.nix
Normal file
18
users/modules/dev/ai/claude.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.dev.ai.claude;
|
||||
in {
|
||||
options.home.dev.ai.claude.enable = mkEnableOption "Enables Claude-related packages";
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [inputs.claude-desktop.packages.${system}.claude-desktop-with-fhs];
|
||||
programs.claude-code = {
|
||||
inherit (cfg) enable;
|
||||
};
|
||||
};
|
||||
}
|
||||
19
users/modules/dev/ai/default.nix
Normal file
19
users/modules/dev/ai/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.dev.ai;
|
||||
in {
|
||||
imports = [
|
||||
./ollama.nix
|
||||
./claude.nix
|
||||
];
|
||||
|
||||
options.home.dev.ai.enable = mkEnableOption "Enables AI features";
|
||||
config.home.dev.ai = mkIf cfg.enable {
|
||||
ollama.enable = mkDefault cfg.enable;
|
||||
claude.enable = mkDefault cfg.enable;
|
||||
};
|
||||
}
|
||||
@@ -4,20 +4,21 @@
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.dev.ollama;
|
||||
cfg = config.home.dev.ai.ollama;
|
||||
in {
|
||||
options.home.dev.ollama = {
|
||||
options.home.dev.ai.ollama = {
|
||||
enable = mkEnableOption "Enables Ollama";
|
||||
gpu = mkOption {
|
||||
type = types.nullOr types.enum ["none" "amd" "nvidia"];
|
||||
example = "amd";
|
||||
default = "none";
|
||||
type = types.nullOr (types.enum [false "rocm" "cuda"]);
|
||||
example = "rocm";
|
||||
default = null;
|
||||
description = "Which type of GPU should be used for hardware acceleration";
|
||||
};
|
||||
};
|
||||
|
||||
config.services.ollama = mkIf cfg.enable {
|
||||
inherit (cfg) enable;
|
||||
acceleration = cfg.gpu;
|
||||
environmentVariables = {
|
||||
OLLAMA_CONTEXT_LENGTH = "8192";
|
||||
};
|
||||
@@ -7,8 +7,8 @@ with lib; let
|
||||
cfg = config.home.dev;
|
||||
in {
|
||||
imports = [
|
||||
./ai
|
||||
./editors
|
||||
./ollama.nix
|
||||
./vcs
|
||||
];
|
||||
|
||||
|
||||
@@ -37,10 +37,7 @@
|
||||
};
|
||||
|
||||
desktop.waybar.style = ./config/waybar/style.css;
|
||||
dev.ollama = {
|
||||
enable = true;
|
||||
gpu = "amd";
|
||||
};
|
||||
dev.ai.claude.enable = true;
|
||||
fullDesktop = true;
|
||||
shell.fish.enable = true;
|
||||
};
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
imports = [../home.nix];
|
||||
home = {
|
||||
cli.nh.flake = "${config.home.homeDirectory}/.dotfiles";
|
||||
dev.ai.ollama = {
|
||||
enable = true;
|
||||
gpu = "rocm";
|
||||
};
|
||||
desktop.hyprland.host = "marpa";
|
||||
phundrak.sshKey = {
|
||||
content = builtins.readFile ../../../keys/id_marpa.pub;
|
||||
|
||||
Reference in New Issue
Block a user