os/hosts/default.nix
Timothy DeHerrera 1c79781936
niximg: init iso configuration
Easily build the iso using `nix build $ISO` thanks to direnv.
2020-01-01 19:12:59 -07:00

51 lines
1,021 B
Nix

{ home, nixpkgs, flake, ... }:
let
utils = import ../lib/utils.nix { lib = nixpkgs.lib; };
inherit (utils)
recImport
;
inherit (builtins)
attrValues
;
config = self:
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = let
core = ../profiles/core.nix;
global = {
networking.hostName = self;
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
];
system.configurationRevision = flake.rev;
nixpkgs.overlays = flake.overlays;
};
local = import "${toString ./.}/${self}.nix";
iso = nixpkgs.lib.optionalAttrs (self == "niximg")
(import "${nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.nix");
in
attrValues flake.nixosModules ++ [
core
global
local
home
iso
];
};
hosts =
recImport { dir = ./.; _import = config; };
in
hosts