-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
specialArgs.sources
, infinite recursion
#55
Comments
Basic poc can be seen here https://gist.github.com/eyJhb/a1bee280d82ecf018a9dd888d29888c1 |
Ahh the problem is that In my own config I used You can do this instead, though ideally this would be exposed in a more convenient way by Nixus directly: diff --git a/default.nix b/default.nix
index 0afbc67..28b45c3 100644
--- a/default.nix
+++ b/default.nix
@@ -1,15 +1,24 @@
let
sources = import ./sources.nix;
in import sources.nixus {
- specialArgs.sources = sources;
-} ({ config, ... }: {
+} ({ config, lib, ... }: {
+
defaults = { lib, name, ... }: {
- configuration = {
- config._module.args.sources = sources;
- config.networking.hostName = lib.mkDefault name;
+
+ options.configuration = lib.mkOption {
+ type = lib.types.submoduleWith {
+ modules = [];
+ specialArgs.sources = sources;
+ };
};
- nixpkgs = lib.mkDefault sources.nixpkgs-stable;
+ config = {
+ configuration = {
+ config.networking.hostName = lib.mkDefault name;
+ };
+
+ nixpkgs = lib.mkDefault sources.nixpkgs-stable;
+ };
}; |
Works! Thanks! Should we keep this issue open, until it maybe might at some point, be implemented into nixus? |
Yeah sounds good :) |
Hello @infinisil !
I think I almost figured it out. I've based my solution on yours, where I've added
specialArgs.sources = sources
, andconfig._module.args.sources = sources;
to my deploy file. This actually works well, until I try to usesources
inside a module.Ie, the below causes a infinite recursion, and AFAIK, it's only inside modules this happens.
Is this just a NixOS limitation?
The text was updated successfully, but these errors were encountered: