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"
|
"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": {
|
"devenv": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"cachix": "cachix",
|
"cachix": "cachix",
|
||||||
@@ -113,6 +134,24 @@
|
|||||||
"type": "github"
|
"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": {
|
"git-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
@@ -259,7 +298,7 @@
|
|||||||
},
|
},
|
||||||
"pumo-system-info": {
|
"pumo-system-info": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
@@ -301,6 +340,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"claude-desktop": "claude-desktop",
|
||||||
"devenv": "devenv",
|
"devenv": "devenv",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
@@ -367,6 +407,21 @@
|
|||||||
"type": "github"
|
"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": {
|
"zen-browser": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|||||||
42
flake.nix
42
flake.nix
@@ -34,6 +34,11 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
claude-desktop = {
|
||||||
|
url = "github:k3d3/claude-desktop-linux-flake";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
zen-browser = {
|
zen-browser = {
|
||||||
url = "github:youwen5/zen-browser-flake";
|
url = "github:youwen5/zen-browser-flake";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -83,42 +88,33 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations = {
|
homeConfigurations = let
|
||||||
"phundrak@alys" = home-manager.lib.homeManagerConfiguration {
|
extraSpecialArgs = {inherit inputs outputs system;};
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
extraSpecialArgs = {
|
in {
|
||||||
inherit inputs outputs;
|
"phundrak@alys" = home-manager.lib.homeManagerConfiguration {
|
||||||
};
|
inherit extraSpecialArgs pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
./users/phundrak/host/alys.nix
|
./users/phundrak/host/alys.nix
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
"phundrak@marpa" = home-manager.lib.homeManagerConfiguration {
|
"phundrak@marpa" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
inherit extraSpecialArgs pkgs;
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs outputs;
|
|
||||||
};
|
|
||||||
modules = [
|
modules = [
|
||||||
./users/phundrak/host/marpa.nix
|
./users/phundrak/host/marpa.nix
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
"phundrak@gampo" = home-manager.lib.homeManagerConfiguration {
|
"phundrak@gampo" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
inherit extraSpecialArgs pkgs;
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs outputs;
|
|
||||||
};
|
|
||||||
modules = [
|
modules = [
|
||||||
./users/phundrak/host/gampo.nix
|
./users/phundrak/host/gampo.nix
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
"phundrak@tilo" = home-manager.lib.homeManagerConfiguration {
|
"phundrak@tilo" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
inherit extraSpecialArgs pkgs;
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs outputs;
|
|
||||||
};
|
|
||||||
modules = [
|
modules = [
|
||||||
./users/phundrak/host/tilo.nix
|
./users/phundrak/host/tilo.nix
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
@@ -126,30 +122,32 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = let
|
||||||
alys = nixpkgs.lib.nixosSystem {
|
|
||||||
specialArgs = {inherit inputs outputs;};
|
specialArgs = {inherit inputs outputs;};
|
||||||
|
in {
|
||||||
|
alys = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit specialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/alys/configuration.nix
|
./hosts/alys/configuration.nix
|
||||||
inputs.sops-nix.nixosModules.sops
|
inputs.sops-nix.nixosModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
gampo = nixpkgs.lib.nixosSystem {
|
gampo = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {inherit inputs outputs;};
|
inherit specialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/gampo/configuration.nix
|
./hosts/gampo/configuration.nix
|
||||||
inputs.sops-nix.nixosModules.sops
|
inputs.sops-nix.nixosModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
marpa = nixpkgs.lib.nixosSystem {
|
marpa = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {inherit inputs outputs;};
|
inherit specialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/marpa/configuration.nix
|
./hosts/marpa/configuration.nix
|
||||||
inputs.sops-nix.nixosModules.sops
|
inputs.sops-nix.nixosModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
tilo = nixpkgs.lib.nixosSystem {
|
tilo = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {inherit inputs outputs;};
|
inherit specialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/tilo/configuration.nix
|
./hosts/tilo/configuration.nix
|
||||||
inputs.sops-nix.nixosModules.sops
|
inputs.sops-nix.nixosModules.sops
|
||||||
|
|||||||
@@ -9,26 +9,26 @@ in {
|
|||||||
options.mySystem.services.calibre = {
|
options.mySystem.services.calibre = {
|
||||||
enable = mkEnableOption "Enable Calibre Web";
|
enable = mkEnableOption "Enable Calibre Web";
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
default = "phundrak";
|
default = "phundrak";
|
||||||
};
|
};
|
||||||
group = mkOption {
|
group = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
default = "users";
|
default = "users";
|
||||||
};
|
};
|
||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
example = "/tank/calibre/conf";
|
example = "/tank/calibre/conf";
|
||||||
default = "/tank/calibre/conf";
|
default = "/tank/calibre/conf";
|
||||||
};
|
};
|
||||||
library = mkOption {
|
library = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
example = "/tank/calibre/library";
|
example = "/tank/calibre/library";
|
||||||
default = "/tank/calibre/library";
|
default = "/tank/calibre/library";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config.services.calibre-web = mkIf cfg.enable {
|
config.services.calibre-web = mkIf cfg.enable {
|
||||||
inherit (cfg) enable user group dataDir;
|
inherit (cfg) enable user dataDir group;
|
||||||
options = {
|
options = {
|
||||||
calibreLibrary = cfg.library;
|
calibreLibrary = cfg.library;
|
||||||
enableBookConversion = true;
|
enableBookConversion = true;
|
||||||
|
|||||||
@@ -9,16 +9,16 @@ in {
|
|||||||
options.mySystem.services.jellyfin = {
|
options.mySystem.services.jellyfin = {
|
||||||
enable = mkEnableOption "Enable Jellyfin";
|
enable = mkEnableOption "Enable Jellyfin";
|
||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
default = "/tank/jellyfin/data";
|
default = "/tank/jellyfin/data";
|
||||||
example = "/tank/jellyfin/data";
|
example = "/tank/jellyfin/data";
|
||||||
};
|
};
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
default = "phundrak";
|
default = "phundrak";
|
||||||
};
|
};
|
||||||
group = mkOption {
|
group = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
default = "users";
|
default = "users";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,17 +9,17 @@ in {
|
|||||||
options.mySystem.services.plex = {
|
options.mySystem.services.plex = {
|
||||||
enable = mkEnableOption "Enable Plex";
|
enable = mkEnableOption "Enable Plex";
|
||||||
group = mkOption {
|
group = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
default = "users";
|
default = "users";
|
||||||
example = "users";
|
example = "users";
|
||||||
description = "Group under which Plex runs";
|
description = "Group under which Plex runs";
|
||||||
};
|
};
|
||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
example = "/tank/plex-config";
|
example = "/tank/plex-config";
|
||||||
};
|
};
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
type = types.string;
|
type = types.str;
|
||||||
default = "phundrak";
|
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
|
with lib; let
|
||||||
cfg = config.home.dev.ollama;
|
cfg = config.home.dev.ai.ollama;
|
||||||
in {
|
in {
|
||||||
options.home.dev.ollama = {
|
options.home.dev.ai.ollama = {
|
||||||
enable = mkEnableOption "Enables Ollama";
|
enable = mkEnableOption "Enables Ollama";
|
||||||
gpu = mkOption {
|
gpu = mkOption {
|
||||||
type = types.nullOr types.enum ["none" "amd" "nvidia"];
|
type = types.nullOr (types.enum [false "rocm" "cuda"]);
|
||||||
example = "amd";
|
example = "rocm";
|
||||||
default = "none";
|
default = null;
|
||||||
description = "Which type of GPU should be used for hardware acceleration";
|
description = "Which type of GPU should be used for hardware acceleration";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.services.ollama = mkIf cfg.enable {
|
config.services.ollama = mkIf cfg.enable {
|
||||||
inherit (cfg) enable;
|
inherit (cfg) enable;
|
||||||
|
acceleration = cfg.gpu;
|
||||||
environmentVariables = {
|
environmentVariables = {
|
||||||
OLLAMA_CONTEXT_LENGTH = "8192";
|
OLLAMA_CONTEXT_LENGTH = "8192";
|
||||||
};
|
};
|
||||||
@@ -7,8 +7,8 @@ with lib; let
|
|||||||
cfg = config.home.dev;
|
cfg = config.home.dev;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
./ai
|
||||||
./editors
|
./editors
|
||||||
./ollama.nix
|
|
||||||
./vcs
|
./vcs
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -37,10 +37,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
desktop.waybar.style = ./config/waybar/style.css;
|
desktop.waybar.style = ./config/waybar/style.css;
|
||||||
dev.ollama = {
|
dev.ai.claude.enable = true;
|
||||||
enable = true;
|
|
||||||
gpu = "amd";
|
|
||||||
};
|
|
||||||
fullDesktop = true;
|
fullDesktop = true;
|
||||||
shell.fish.enable = true;
|
shell.fish.enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
imports = [../home.nix];
|
imports = [../home.nix];
|
||||||
home = {
|
home = {
|
||||||
cli.nh.flake = "${config.home.homeDirectory}/.dotfiles";
|
cli.nh.flake = "${config.home.homeDirectory}/.dotfiles";
|
||||||
|
dev.ai.ollama = {
|
||||||
|
enable = true;
|
||||||
|
gpu = "rocm";
|
||||||
|
};
|
||||||
desktop.hyprland.host = "marpa";
|
desktop.hyprland.host = "marpa";
|
||||||
phundrak.sshKey = {
|
phundrak.sshKey = {
|
||||||
content = builtins.readFile ../../../keys/id_marpa.pub;
|
content = builtins.readFile ../../../keys/id_marpa.pub;
|
||||||
|
|||||||
Reference in New Issue
Block a user