From 59383e871f882cb1a72c64392bdb48220db1367c Mon Sep 17 00:00:00 2001 From: Pacman99 Date: Sun, 25 Apr 2021 16:22:33 -0700 Subject: [PATCH] modules: drop any logic already done by fup this includes creating multiPkgs, and dropping options already set by fup --- lib/modules.nix | 46 ++++++++++------------------------------------ 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/lib/modules.nix b/lib/modules.nix index 7024f13..2cd965f 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -1,28 +1,16 @@ { lib }: { - modOverrides = { overrides }: - { config, overrideModulesPath, ... }: - let - inherit (overrides) modules disabledModules; - in - { - disabledModules = modules ++ disabledModules; - imports = map - (path: "${overrideModulesPath}/${path}") - modules; - }; - - hmDefaults = { userSuites, extern, homeModules }: { + hmDefaults = { suites, modules }: { home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = extern.userSpecialArgs // { suites = userSuites; }; - sharedModules = extern.userModules ++ (builtins.attrValues homeModules); + extraSpecialArgs = { inherit suites; }; + sharedModules = modules; }; }; - globalDefaults = { self, nixos, inputs, multiPkgs }: + globalDefaults = { self, inputs }: let experimentalFeatures = [ "flakes" @@ -31,27 +19,22 @@ "ca-derivations" ]; in - { config, pkgs, ... }: { + { channel, config, pkgs, ... }: { users.mutableUsers = lib.mkDefault false; hardware.enableRedistributableFirmware = lib.mkDefault true; nix.nixPath = [ - "nixpkgs=${nixos}" + "nixpkgs=${channel.input}" "nixos-config=${self}/lib/compat/nixos" "home-manager=${inputs.home}" ]; - nixpkgs.pkgs = lib.mkDefault multiPkgs.${config.nixpkgs.system}; - nix.registry = { devos.flake = self; - nixos.flake = nixos; - override.flake = inputs.override; + nixos.flake = channel.input; }; - nix.package = pkgs.nixFlakes; - nix.extraOptions = '' experimental-features = ${lib.concatStringsSep " " experimentalFeatures @@ -61,19 +44,10 @@ system.configurationRevision = lib.mkIf (self ? rev) self.rev; }; - cachix = { self }: - let rootCachix = "${self}/cachix.nix"; in - if builtins.pathExists rootCachix - then rootCachix - else { }; + isoConfig = { self, inputs, fullHostConfig }: + { config, modulesPath, suites, ... }: { - flakeModules = { self, extern }: { imports = builtins.attrValues self.nixosModules ++ extern.modules; }; - - isoConfig = { self, nixos, inputs, fullHostConfig }: - { config, suites, ... }: { - - imports = let modpath = "nixos/modules"; in - [ "${nixos}/${modpath}/installer/cd-dvd/installation-cd-minimal-new-kernel.nix" ]; + imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-minimal-new-kernel.nix" ]; # avoid unwanted systemd service startups # all strings in disabledModules get appended to modulesPath # so convert each to list which can be coerced to string