From cd7fb4f54c81e19c93e7cc067b2022d6216bf0fc Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sat, 17 Apr 2021 20:46:20 -0500 Subject: [PATCH] ref: flatten out inputs --- lib/devos/devosSystem.nix | 4 ++-- lib/devos/mkHosts.nix | 6 +++--- lib/devos/mkPkgs.nix | 6 +++--- lib/flake.nix | 2 +- lib/mkFlake/default.nix | 3 +-- lib/mkFlake/evalArgs.nix | 6 +++--- lib/pkgs-lib/shell/default.nix | 6 +++--- lib/pkgs-lib/tests/default.nix | 4 ++-- 8 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lib/devos/devosSystem.nix b/lib/devos/devosSystem.nix index dbe3af4..249e2c7 100644 --- a/lib/devos/devosSystem.nix +++ b/lib/devos/devosSystem.nix @@ -1,4 +1,4 @@ -{ lib, nixpkgs, userSelf, inputs, ... }: +{ lib, nixpkgs, userSelf, userFlakeInputs, ... }: { modules, ... } @ args: lib.nixosSystem (args // { @@ -23,7 +23,7 @@ lib.nixosSystem (args // { disabledModules = map (x: [ x ]) (lib.remove modules.core suites.allProfiles); - nix.registry = lib.mapAttrs (n: v: { flake = v; }) inputs; + nix.registry = lib.mapAttrs (n: v: { flake = v; }) userFlakeInputs; isoImage.isoBaseName = "nixos-" + config.networking.hostName; isoImage.contents = [{ diff --git a/lib/devos/mkHosts.nix b/lib/devos/mkHosts.nix index 056c4e7..21ece03 100644 --- a/lib/devos/mkHosts.nix +++ b/lib/devos/mkHosts.nix @@ -1,4 +1,4 @@ -{ lib, nixpkgs, inputs, userSelf, ... }: +{ lib, nixpkgs, userFlakeInputs, userSelf, ... }: { dir, extern, suites, overrides, multiPkgs, ... }: let @@ -38,7 +38,7 @@ let nix.nixPath = [ "nixpkgs=${nixpkgs}" "nixos-config=${userSelf}/compat/nixos" - "home-manager=${inputs.home}" + "home-manager=${userFlakeInputs.home}" ]; nixpkgs.pkgs = lib.mkDefault multiPkgs.${config.nixpkgs.system}; @@ -46,7 +46,7 @@ let nix.registry = { devos.flake = userSelf; nixos.flake = nixpkgs; - override.flake = inputs.override; + override.flake = userFlakeInputs.override; }; nix.package = pkgs.nixFlakes; diff --git a/lib/devos/mkPkgs.nix b/lib/devos/mkPkgs.nix index fda3cad..6165707 100644 --- a/lib/devos/mkPkgs.nix +++ b/lib/devos/mkPkgs.nix @@ -1,10 +1,10 @@ -{ lib, nixpkgs, userSelf, inputs, ... }: +{ lib, nixpkgs, userSelf, utils, userFlakeInputs, ... }: { extern, overrides }: -(inputs.utils.lib.eachDefaultSystem +(utils.lib.eachDefaultSystem (system: let - overridePkgs = lib.os.pkgImport inputs.override [ ] system; + overridePkgs = lib.os.pkgImport userFlakeInputs.override [ ] system; overridesOverlay = overrides.packages; overlays = [ diff --git a/lib/flake.nix b/lib/flake.nix index 75bfb89..47b9ffc 100644 --- a/lib/flake.nix +++ b/lib/flake.nix @@ -21,7 +21,7 @@ let callLibs = file: import file ({ lib = final; - inputs = inputs; + userFlakeInputs = {}; # TODO: Erm, this must become a proper argument to mkFlake } // inputs); in with final; diff --git a/lib/mkFlake/default.nix b/lib/mkFlake/default.nix index eadb7e4..a37fa83 100644 --- a/lib/mkFlake/default.nix +++ b/lib/mkFlake/default.nix @@ -1,7 +1,6 @@ -{ lib, inputs, ... }: +{ lib, utils, deploy, ... }: let inherit (dev) os; - inherit (inputs) utils deploy; in _: { self, ... } @ args: diff --git a/lib/mkFlake/evalArgs.nix b/lib/mkFlake/evalArgs.nix index 9836b25..c157164 100644 --- a/lib/mkFlake/evalArgs.nix +++ b/lib/mkFlake/evalArgs.nix @@ -1,4 +1,4 @@ -{ userSelf, lib, inputs, utils, ... }: +{ userSelf, lib, nixpkgs, utils, ... }: { args }: let @@ -54,7 +54,7 @@ let options = with types; { input = mkOption { type = flakeType; - default = inputs.nixpkgs; + default = nixpkgs; description = '' nixpkgs flake input to use for this channel ''; @@ -199,7 +199,7 @@ let let default = { nixpkgs = { - input = inputs.nixpkgs; + input = nixpkgs; }; }; in diff --git a/lib/pkgs-lib/shell/default.nix b/lib/pkgs-lib/shell/default.nix index e5c2d7c..71c6c29 100644 --- a/lib/pkgs-lib/shell/default.nix +++ b/lib/pkgs-lib/shell/default.nix @@ -1,10 +1,10 @@ -{ lib, inputs, system, nixpkgs, ... }: +{ lib, devshell, deploy, system, nixpkgs, ... }: let overlays = [ - inputs.devshell.overlay + devshell.overlay (final: prev: { deploy-rs = - inputs.deploy.packages.${prev.system}.deploy-rs; + deploy.packages.${prev.system}.deploy-rs; }) ]; diff --git a/lib/pkgs-lib/tests/default.nix b/lib/pkgs-lib/tests/default.nix index 64ca44e..a72ade6 100644 --- a/lib/pkgs-lib/tests/default.nix +++ b/lib/pkgs-lib/tests/default.nix @@ -1,11 +1,11 @@ -{ pkgs, system, inputs, nixpkgs, lib, ... }: +{ pkgs, system, deploy, nixpkgs, lib, ... }: let mkChecks = { hosts, nodes, homes ? { } }: let deployHosts = lib.filterAttrs (n: _: hosts.${n}.config.nixpkgs.system == system) nodes; - deployChecks = inputs.deploy.lib.${system}.deployChecks { nodes = deployHosts; }; + deployChecks = deploy.lib.${system}.deployChecks { nodes = deployHosts; }; tests = lib.optionalAttrs (deployHosts != { }) { profilesTest = profilesTest (hosts.${(builtins.head (builtins.attrNames deployHosts))});