ark/hosts/default.nix
Timothy DeHerrera d5ba9f6173
flake.nix: define pkgs in flake
Set the global package set via `hosts/default.nix` passed in from its
definition in `flake.nix`.
2020-01-29 08:50:07 -07:00

50 lines
1.1 KiB
Nix

inputs@{ home, nixpkgs, self, pkgs, system, ... }:
let
inherit (nixpkgs) lib;
utils = import ../lib/utils.nix { inherit lib; };
inherit (utils) recImport;
inherit (builtins) attrValues removeAttrs;
config = hostName:
lib.nixosSystem rec {
inherit system;
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 = { inherit pkgs; };
};
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