diff options
Diffstat (limited to 'lib/machines.nix')
-rw-r--r-- | lib/machines.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/machines.nix b/lib/machines.nix new file mode 100644 index 0000000..d652fcf --- /dev/null +++ b/lib/machines.nix @@ -0,0 +1,46 @@ +{ lib +, pkgs +, self +, sources +, ... +}: +let + nixos = config: import (sources.nixpkgs + "/nixos/lib/eval-config.nix") { + modules = [ + config + { + documentation.enable = false; + boot.loader.grub.device = "nodev"; + fileSystems."/".device = "tmpfs"; + nixpkgs.localSystem = { + system = "x86_64-linux"; + }; + } + ]; + specialArgs = { + inherit + pkgs + self + sources + ; + }; + system = null; + }; +in +{ + options = { + machines = lib.mkOption { + type = lib.types.attrsOf lib.types.raw; + default = {}; + }; + outputs.machines = lib.mkOption { + type = lib.types.attrsOf lib.types.raw; + default = {}; + }; + }; + config = { + outputs.machines = lib.mapAttrs (name: configuration: + nixos configuration + ) self.config.machines; + }; +} |