os/hosts/default.nix
Timothy DeHerrera e078e7a229
DOC.md: split off from README.md
Keep the README.md lean and use DOC.md for more detailed explanations. While
revising user documentation, a default `nixos` user profile was created, which
serves as a goood base example.
2020-01-10 23:49:18 -07:00

50 lines
1.1 KiB
Nix

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