1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-27 18:16:59 +03:00
digga/hosts/default.nix
2020-06-12 19:18:27 -06:00

51 lines
1.1 KiB
Nix

inputs@{ home, nixpkgs, unstablePkgs, 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 {
inherit system;
specialArgs = {
inherit unstablePkgs;
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"
];
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