diff --git a/flake.lock b/flake.lock index fac178b..7b60f50 100644 --- a/flake.lock +++ b/flake.lock @@ -915,11 +915,32 @@ "nixpkgs": "nixpkgs_4", "nixpkgs-wayland": "nixpkgs-wayland", "pixi": "pixi", + "sops-nix": "sops-nix", "stable": "stable", "tsm": "tsm", "utils": "utils" } }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1732575825, + "narHash": "sha256-xtt95+c7OUMoqZf4OvA/7AemiH3aVuWHQbErYQoPwFk=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "3433ea14fbd9e6671d0ff0dd45ed15ee4c156ffa", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, "stable": { "locked": { "lastModified": 1732632634, diff --git a/flake.nix b/flake.nix index 46e8365..b60170b 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + lix = { url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"; flake = false; diff --git a/hosts/othalan/pkgs.nix b/hosts/othalan/pkgs.nix index dbbd732..756eca9 100644 --- a/hosts/othalan/pkgs.nix +++ b/hosts/othalan/pkgs.nix @@ -7,7 +7,7 @@ ] ++ (with pkgs; [ - + sops distrobox zk quarto diff --git a/lib/generators.nix b/lib/generators.nix index d80785e..cc6b79f 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -17,13 +17,15 @@ let listify ; inherit (lib.filesystem) listFilesRecursive; - flake = flakeFromSystem "x86_64-linux"; hostPath = host: ../. + "/hosts/${host}"; + # all nix files not including pkgs.nix - # hostFiles = host: filter isNixFile (listFilesRecursive (hostPath host)); hostFiles = host: host |> hostPath |> listFilesRecursive |> filter isNixFile; + nixosModules = names: names |> listify |> map (n: inputs.${n}.nixosModules.default); + selfModules = names: names |> listify |> map (n: self.nixosModules.${n}); + commonSpecialArgs = { inherit self @@ -35,12 +37,7 @@ let mkIso = nixosSystem { system = "x86_64-linux"; - modules = [ - inputs.lix-module.nixosModules.default - self.nixosModules.nix - self.nixosModules.essentials - self.nixosModules.iso - ]; + modules = (nixosModules "lix-module") ++ (selfModules "nix|essentials|iso"); specialArgs = commonSpecialArgs; }; @@ -48,12 +45,13 @@ let hostName: nixosSystem { system = "x86_64-linux"; - modules = [ - ../modules/oizys.nix - inputs.lix-module.nixosModules.default - inputs.hyprland.nixosModules.default - inputs.comin.nixosModules.comin - ] ++ (hostFiles hostName); + modules = + [ + inputs.comin.nixosModules.comin + ] + ++ (selfModules ''oizys'') + ++ (nixosModules ''lix-module|hyprland|sops-nix'') + ++ (hostFiles hostName); specialArgs = commonSpecialArgs // { inherit