diff --git a/flake.nix b/flake.nix index c8d363f..4d44a5a 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,7 @@ { self, nixpkgs, ... }@inputs: let outputs = self.outputs; - utils = import ./utils.nix { inherit nixpkgs inputs outputs; }; + utils = import ./utils.nix; homelabConfig = import ./config.nix; roles = import ./roles { inherit utils; }; @@ -22,21 +22,38 @@ inherit homelabConfig roles; lib = nixpkgs.lib; }; + pkgs = nixpkgs.legacyPackages.x86_64-linux; in { - nixosConfigurations = - (nixpkgs.lib.mapAttrs ( + devShells.x86_64-linux.default = pkgs.mkShell { + buildInputs = [ pkgs.colmena ]; + }; + colmena = + { + meta = { + nixpkgs = import nixpkgs { + system = "x86_64-linux"; + }; + specialArgs = { + inherit + inputs + outputs + hosts + ; + }; + }; + } + // (nixpkgs.lib.mapAttrs ( _: value: (utils.mkSystem { - inherit hosts; hostConfig = value; }) - ) hosts) - // { - template = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ ./systems/template/configuration.nix ]; - }; + ) hosts); + nixosConfigurations = { + template = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ ./systems/template/configuration.nix ]; }; + }; }; } diff --git a/utils.nix b/utils.nix index dba5498..e504dd5 100644 --- a/utils.nix +++ b/utils.nix @@ -1,23 +1,9 @@ -{ - nixpkgs, - inputs, - outputs, - ... -}: { mkSystem = - { hostConfig, hosts }: - nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit - inputs - outputs - hostConfig - hosts - ; - }; - modules = [ + { hostConfig }: + { inputs, ... }: + { + imports = [ inputs.impermanence.nixosModules.impermanence inputs.sops-nix.nixosModules.sops