modules: drop any logic already done by fup

this includes creating multiPkgs, and dropping options already set by
fup
This commit is contained in:
Pacman99 2021-04-25 16:22:33 -07:00
parent abd133c244
commit 59383e871f

View File

@ -1,28 +1,16 @@
{ lib }: { lib }:
{ {
modOverrides = { overrides }: hmDefaults = { suites, modules }: {
{ config, overrideModulesPath, ... }:
let
inherit (overrides) modules disabledModules;
in
{
disabledModules = modules ++ disabledModules;
imports = map
(path: "${overrideModulesPath}/${path}")
modules;
};
hmDefaults = { userSuites, extern, homeModules }: {
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = extern.userSpecialArgs // { suites = userSuites; }; extraSpecialArgs = { inherit suites; };
sharedModules = extern.userModules ++ (builtins.attrValues homeModules); sharedModules = modules;
}; };
}; };
globalDefaults = { self, nixos, inputs, multiPkgs }: globalDefaults = { self, inputs }:
let let
experimentalFeatures = [ experimentalFeatures = [
"flakes" "flakes"
@ -31,27 +19,22 @@
"ca-derivations" "ca-derivations"
]; ];
in in
{ config, pkgs, ... }: { { channel, config, pkgs, ... }: {
users.mutableUsers = lib.mkDefault false; users.mutableUsers = lib.mkDefault false;
hardware.enableRedistributableFirmware = lib.mkDefault true; hardware.enableRedistributableFirmware = lib.mkDefault true;
nix.nixPath = [ nix.nixPath = [
"nixpkgs=${nixos}" "nixpkgs=${channel.input}"
"nixos-config=${self}/lib/compat/nixos" "nixos-config=${self}/lib/compat/nixos"
"home-manager=${inputs.home}" "home-manager=${inputs.home}"
]; ];
nixpkgs.pkgs = lib.mkDefault multiPkgs.${config.nixpkgs.system};
nix.registry = { nix.registry = {
devos.flake = self; devos.flake = self;
nixos.flake = nixos; nixos.flake = channel.input;
override.flake = inputs.override;
}; };
nix.package = pkgs.nixFlakes;
nix.extraOptions = '' nix.extraOptions = ''
experimental-features = ${lib.concatStringsSep " " experimental-features = ${lib.concatStringsSep " "
experimentalFeatures experimentalFeatures
@ -61,19 +44,10 @@
system.configurationRevision = lib.mkIf (self ? rev) self.rev; system.configurationRevision = lib.mkIf (self ? rev) self.rev;
}; };
cachix = { self }: isoConfig = { self, inputs, fullHostConfig }:
let rootCachix = "${self}/cachix.nix"; in { config, modulesPath, suites, ... }: {
if builtins.pathExists rootCachix
then rootCachix
else { };
flakeModules = { self, extern }: { imports = builtins.attrValues self.nixosModules ++ extern.modules; }; imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-minimal-new-kernel.nix" ];
isoConfig = { self, nixos, inputs, fullHostConfig }:
{ config, suites, ... }: {
imports = let modpath = "nixos/modules"; in
[ "${nixos}/${modpath}/installer/cd-dvd/installation-cd-minimal-new-kernel.nix" ];
# avoid unwanted systemd service startups # avoid unwanted systemd service startups
# all strings in disabledModules get appended to modulesPath # all strings in disabledModules get appended to modulesPath
# so convert each to list which can be coerced to string # so convert each to list which can be coerced to string