os/hosts/default.nix
Timothy DeHerrera 425f7894a4
export profiles via flake outputs
Export those listed in `profiles/default.nix` to be included in the
flake output `nixosModules` for easy use in other flakes.
2020-01-03 20:01:22 -07:00

52 lines
988 B
Nix

args@{ home, nixpkgs, self, ... }:
let
utils = import ../lib/utils.nix { lib = nixpkgs.lib; };
inherit (utils)
recImport
;
inherit (builtins)
attrValues
removeAttrs
;
config = this:
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = let
core = ../profiles/core.nix;
global = {
networking.hostName = this;
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
];
system.configurationRevision = self.rev;
nixpkgs.overlays = self.overlays;
};
local = import "${toString ./.}/${this}.nix";
flakeModules = removeAttrs self.nixosModules
[ "profiles" ];
in
attrValues flakeModules ++ [
core
global
local
home.nixosModules.home-manager
];
};
hosts =
recImport { dir = ./.; _import = config; };
in
hosts