feat: more AI-related tools

This commit is contained in:
Lucien Cartier-Tilet 2025-09-03 11:45:12 +02:00
parent 5a5730a840
commit a210ae58e6
8 changed files with 125 additions and 33 deletions

57
flake.lock generated
View File

@ -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": [

View File

@ -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

View 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;
};
};
}

View 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;
};
}

View File

@ -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";
};

View File

@ -7,8 +7,8 @@ with lib; let
cfg = config.home.dev;
in {
imports = [
./ai
./editors
./ollama.nix
./vcs
];

View File

@ -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;
};

View File

@ -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;