Merge pull request #66 from nrdxp/override-modules

Make modules overridable
This commit is contained in:
Timothy DeHerrera 2020-12-31 14:04:03 -07:00 committed by GitHub
commit 4f4cd72fdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 3 deletions

View file

@ -28,7 +28,11 @@
externModules = [ home.nixosModules.home-manager ]; externModules = [ home.nixosModules.home-manager ];
pkgset = pkgset =
let overlays = (attrValues self.overlays) ++ externOverlays; in let overlays =
(attrValues self.overlays)
++ externOverlays
++ [ self.overlay ];
in
genPkgset { genPkgset {
inherit master nixos overlays system; inherit master nixos overlays system;
}; };

View file

@ -14,14 +14,28 @@ let
inherit (builtins) attrValues removeAttrs; inherit (builtins) attrValues removeAttrs;
inherit (pkgset) osPkgs unstablePkgs; inherit (pkgset) osPkgs unstablePkgs;
unstableModules = [ ];
config = hostName: config = hostName:
lib.nixosSystem { lib.nixosSystem {
inherit system; inherit system;
specialArgs =
{
unstableModulesPath = "${master}/nixos/modules";
};
modules = modules =
let let
core = self.nixosModules.profiles.core; core = self.nixosModules.profiles.core;
modOverrides = { config, unstableModulesPath, ... }: {
disabledModules = unstableModules;
imports = map
(path: "${unstableModulesPath}/${path}")
unstableModules;
};
global = { global = {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;

View file

@ -1,10 +1,10 @@
{ modulesPath, ... }: { { unstableModulesPath, ... }: {
imports = [ imports = [
# passwd is nixos by default # passwd is nixos by default
../users/nixos ../users/nixos
# passwd is empty by default # passwd is empty by default
../users/root ../users/root
"${modulesPath}/installer/cd-dvd/iso-image.nix" "${unstableModulesPath}/installer/cd-dvd/iso-image.nix"
]; ];
isoImage.makeEfiBootable = true; isoImage.makeEfiBootable = true;