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: lib = nixpkgs.lib.makeExtensible (self:
let 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; }; attrs = import ./attrs.nix { lib = nixpkgs.lib // self; };
lists = import ./lists.nix { lib = nixpkgs.lib // self; }; lists = import ./lists.nix { lib = nixpkgs.lib // self; };
strings = import ./strings.nix { lib = nixpkgs.lib // self; }; strings = import ./strings.nix { lib = nixpkgs.lib // self; };
@ -40,9 +32,12 @@
}; };
mkFlake = { mkFlake = {
__functor = callLibs ./mkFlake; __functor = import ./mkFlake {
evalArgs = callLibs ./mkFlake/evalArgs.nix; lib = nixpkgs.lib // self;
evalOldArgs = callLibs ./mkFlake/evalOldArgs.nix; 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 { pkgs-lib = import ./pkgs-lib {

View file

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

View file

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

View file

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