fix: constructors of mkFlake function family

This commit is contained in:
David Arnold 2021-04-18 22:29:28 -05:00
parent 6f0392b55e
commit 362cc31827
No known key found for this signature in database
GPG Key ID: 6D6A936E69C59D08
4 changed files with 22 additions and 19 deletions

View File

@ -16,14 +16,6 @@
lib = nixpkgs.lib.makeExtensible (self:
let
callLibs = file: import file
({
lib = self;
userFlakeNixos = {};
userFlakeSelf = {};
userFlakeInputs = {}; # TODO: Erm, theese must become proper arguments to mkFlake
} // inputs);
attrs = import ./attrs.nix { lib = nixpkgs.lib // self; };
lists = import ./lists.nix { lib = nixpkgs.lib // self; };
strings = import ./strings.nix { lib = nixpkgs.lib // self; };
@ -40,9 +32,12 @@
};
mkFlake = {
__functor = callLibs ./mkFlake;
evalArgs = callLibs ./mkFlake/evalArgs.nix;
evalOldArgs = callLibs ./mkFlake/evalOldArgs.nix;
__functor = import ./mkFlake {
lib = nixpkgs.lib // self;
inherit deploy;
};
evalArgs = import ./mkFlake/evalArgs.nix { lib = nixpkgs.lib // self; };
evalOldArgs = import ./mkFlake/evalOldArgs.nix { lib = nixpkgs.lib // self; };
};
pkgs-lib = import ./pkgs-lib {

View File

@ -1,6 +1,6 @@
{ lib, deploy, ... }:
{ lib, deploy }:
let
inherit (dev) os;
inherit (lib) os;
in
_: { self, inputs, nixos, ... } @ args:
@ -10,7 +10,11 @@ let
userFlakeInputs = inputs;
userFlakeNixOS = nixos;
cfg = (lib.mkFlake.evalOldArgs { inherit args; }).config;
cfg = (
lib.mkFlake.evalOldArgs
{ inherit userFlakeSelf userFlakeInputs; }
{ inherit args; }
).config;
multiPkgs = os.mkPkgs
{ inherit userFlakeSelf userFlakeInputs userFlakeNixOS; }

View File

@ -1,4 +1,6 @@
{ userFlakeSelf, lib, nixpkgs, ... }:
{ lib }:
{ userFlakeSelf, userFlakeNixOS }:
{ args }:
let
@ -54,7 +56,7 @@ let
options = with types; {
input = mkOption {
type = flakeType;
default = nixpkgs;
default = userFlakeNixOS;
description = ''
nixpkgs flake input to use for this channel
'';
@ -199,7 +201,7 @@ let
let
default = {
nixpkgs = {
input = nixpkgs;
input = userFlakeNixOS;
};
};
in

View File

@ -1,4 +1,6 @@
{ userFlakeSelf, lib, inputs, ... }:
{ lib }:
{ userFlakeSelf, userFlakeInputs }:
{ args }:
let
@ -121,7 +123,7 @@ let
{ modules = []; overlays = []; specialArgs = []; userModules = []; userSpecialArgs = []; }
'';
# So unneeded extern attributes can safely be deleted
apply = x: defaults // (x { inputs = inputs // userFlakeSelf.inputs; });
apply = x: defaults // (x { inputs = userFlakeInputs // userFlakeSelf.inputs; });
description = ''
Function with argument 'inputs' that contains all devos and ''${userFlakeSelf}'s inputs.
The function should return an attribute set with modules, overlays, and