ref: flatten out inputs

This commit is contained in:
David Arnold 2021-04-17 20:46:20 -05:00
parent 16b3fad559
commit cd7fb4f54c
8 changed files with 18 additions and 19 deletions

View File

@ -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 = [{

View File

@ -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;

View File

@ -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 = [

View File

@ -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;

View File

@ -1,7 +1,6 @@
{ lib, inputs, ... }:
{ lib, utils, deploy, ... }:
let
inherit (dev) os;
inherit (inputs) utils deploy;
in
_: { self, ... } @ args:

View File

@ -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

View File

@ -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;
})
];

View File

@ -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))});