forked from clan/clan-core
build-clan: fix specialArgs not passed
This commit is contained in:
parent
a9f0e90d12
commit
d7475bef37
@ -25,7 +25,8 @@ let
|
||||
specialArgs
|
||||
clan-core
|
||||
;
|
||||
} { self = directory; };
|
||||
self = directory;
|
||||
};
|
||||
meta = attrs.meta or { };
|
||||
rest = builtins.removeAttrs attrs [
|
||||
"meta"
|
||||
|
@ -3,16 +3,17 @@
|
||||
nixpkgs,
|
||||
clan-core,
|
||||
specialArgs ? { },
|
||||
self,
|
||||
}:
|
||||
# Returns a function that takes self, which should point to the directory of the flake
|
||||
{ self }:
|
||||
module:
|
||||
(lib.evalModules {
|
||||
specialArgs = {
|
||||
inherit self clan-core nixpkgs;
|
||||
} // specialArgs;
|
||||
};
|
||||
modules = [
|
||||
./interface.nix
|
||||
module
|
||||
{ inherit specialArgs; }
|
||||
];
|
||||
}).config
|
||||
|
@ -6,10 +6,10 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
eval = import ./eval.nix { inherit lib nixpkgs clan-core; };
|
||||
|
||||
self = ./.;
|
||||
evalClan = eval { inherit self; };
|
||||
evalClan = import ./eval.nix {
|
||||
inherit lib nixpkgs clan-core;
|
||||
self = ./.;
|
||||
};
|
||||
|
||||
in
|
||||
#######
|
||||
@ -131,4 +131,22 @@ in
|
||||
"machine2"
|
||||
];
|
||||
};
|
||||
|
||||
test_buildClan_specialArgs =
|
||||
let
|
||||
result = buildClan {
|
||||
directory = ./.;
|
||||
meta.name = "test";
|
||||
specialArgs.foo = "dream2nix";
|
||||
machines.machine2 =
|
||||
{ foo, ... }:
|
||||
{
|
||||
networking.hostName = foo;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
expr = result.nixosConfigurations.machine2.config.networking.hostName;
|
||||
expected = "dream2nix";
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user