bdfdc4da54
Fixes #44. Easily add external modules from other flakes by dropping them in the list.
82 lines
1.8 KiB
Nix
82 lines
1.8 KiB
Nix
{ home
|
|
, lib
|
|
, nixos
|
|
, master
|
|
, pkgset
|
|
, self
|
|
, system
|
|
, utils
|
|
, externModules
|
|
, ...
|
|
}:
|
|
let
|
|
inherit (utils) recImport;
|
|
inherit (builtins) attrValues removeAttrs;
|
|
inherit (pkgset) osPkgs unstablePkgs;
|
|
|
|
config = hostName:
|
|
lib.nixosSystem {
|
|
inherit system;
|
|
|
|
modules =
|
|
let
|
|
core = self.nixosModules.profiles.core;
|
|
|
|
global = {
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
|
|
networking.hostName = hostName;
|
|
nix.nixPath = let path = toString ../.; in
|
|
[
|
|
"nixos-unstable=${master}"
|
|
"nixpkgs=${nixos}"
|
|
"nixos-config=${path}/configuration.nix"
|
|
"nixpkgs-overlays=${path}/overlays"
|
|
"home-manager=${home}"
|
|
];
|
|
|
|
nixpkgs.pkgs = osPkgs;
|
|
|
|
nix.registry = {
|
|
master.flake = master;
|
|
nixflk.flake = self;
|
|
nixpkgs.flake = nixos;
|
|
home-manager.flake = home;
|
|
};
|
|
|
|
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
|
};
|
|
|
|
overrides = {
|
|
nixpkgs.overlays =
|
|
let
|
|
override = import ../pkgs/override.nix unstablePkgs;
|
|
|
|
overlay = pkg: final: prev: {
|
|
"${pkg.pname}" = pkg;
|
|
};
|
|
in
|
|
map overlay override;
|
|
};
|
|
|
|
local = import "${toString ./.}/${hostName}.nix";
|
|
|
|
# Everything in `./modules/list.nix`.
|
|
flakeModules =
|
|
attrValues (removeAttrs self.nixosModules [ "profiles" ]);
|
|
|
|
in
|
|
flakeModules ++ [ core global local overrides ] ++ externModules;
|
|
|
|
extraArgs = {
|
|
inherit system;
|
|
};
|
|
};
|
|
|
|
hosts = recImport {
|
|
dir = ./.;
|
|
_import = config;
|
|
};
|
|
in
|
|
hosts
|