pub-solar-os/hosts/default.nix

51 lines
1.1 KiB
Nix
Raw Normal View History

inputs@{ home, nixpkgs, unstablePkgs, self, pkgs, system, ... }:
let
inherit (nixpkgs) lib;
utils = import ../lib/utils.nix { inherit lib; };
inherit (utils) recImport;
2019-12-31 01:00:09 +00:00
2020-01-04 05:06:31 +00:00
inherit (builtins) attrValues removeAttrs;
config = hostName:
lib.nixosSystem {
inherit system;
specialArgs = {
inherit unstablePkgs;
usr = { inherit utils; };
};
modules = let
inherit (home.nixosModules) home-manager;
2020-07-16 21:27:39 +00:00
core = self.nixosModules.profiles.core;
global = {
networking.hostName = hostName;
2019-12-16 04:36:05 +00:00
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays"
2019-12-16 04:36:05 +00:00
];
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 ];
};
2020-01-04 05:06:31 +00:00
hosts = recImport {
dir = ./.;
_import = config;
};
in hosts