diff --git a/hosts/workstation/configuration.nix b/hosts/workstation/configuration.nix index eab9627..3e11daa 100644 --- a/hosts/workstation/configuration.nix +++ b/hosts/workstation/configuration.nix @@ -151,6 +151,7 @@ in ollama = { enable = true; acceleration = "cuda"; + models = "/srv/ai/ollama"; }; resilio = { enable = true; diff --git a/hosts/workstation/hardware-configuration.nix b/hosts/workstation/hardware-configuration.nix index 009ba3e..944e1fd 100644 --- a/hosts/workstation/hardware-configuration.nix +++ b/hosts/workstation/hardware-configuration.nix @@ -6,6 +6,10 @@ lib, ... }: +let + getMapper = mapper: "/dev/mapper/${mapper}"; + getUUID = uuid: "/dev/disk/by-uuid/${uuid}"; +in { imports = [ (modulesPath + "/installer/scan/not-detected.nix") @@ -80,11 +84,17 @@ "usb_storage" "sd_mod" ]; - luks.devices.nvme = { - device = "/dev/disk/by-uuid/e9618e85-a631-4374-b2a4-22c376d6e41b"; - keyFile = "/keyfile"; - preLVM = true; - }; + luks.devices = + let + decryptLuks = uuid: { + device = getUUID uuid; + keyFile = "/keyfile"; + preLVM = true; + }; + in + { + nvme = decryptLuks "e9618e85-a631-4374-b2a4-22c376d6e41b"; + }; }; }; fileSystems = @@ -98,8 +108,8 @@ "x-systemd.idle-timeout=600" ]; }; - btrfsMount = subvol: { - device = "/dev/mapper/nvme"; + btrfsMount = device: subvol: { + inherit device; fsType = "btrfs"; options = [ "subvol=${subvol}" @@ -114,18 +124,19 @@ }; in { - "/" = btrfsMount "nixos"; - "/home" = btrfsMount "home"; - "/srv/games" = btrfsMount "games"; + "/" = btrfsMount (getMapper "nvme") "nixos"; + "/home" = btrfsMount (getMapper "nvme") "home"; + "/srv/games" = btrfsMount (getMapper "nvme") "games"; + "/srv/ai" = btrfsMount (getUUID "ca1671e1-e201-4960-ad30-593393f970fb") "ai"; "/srv/pool" = nfsMount "server" "pool"; "/srv/server_home" = nfsMount "server" "jawz"; "/srv/backups" = nfsMount "server" "backups"; "/boot" = { - device = "/dev/disk/by-uuid/ac6d349a-96b9-499e-9009-229efd7743a5"; + device = getUUID "ac6d349a-96b9-499e-9009-229efd7743a5"; fsType = "ext4"; }; "/boot/efi" = { - device = "/dev/disk/by-uuid/B05D-B5FB"; + device = getUUID "B05D-B5FB"; fsType = "vfat"; }; };