-
-
Save cmacrae/35f2842f684dacc6750d3d73cae1a433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: while evaluating the attribute 'config.deployment' at undefined position: | |
< REDACTED> | |
while evaluating the attribute 'config' at /Users/cmacrae/dev/example/some-module.nix:61:3: | |
attempt to call something which is not a function but a set, at /Users/cmacrae/dev/example/some-module.nix:61:12 | |
error: evaluation of the deployment specification failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
computeDefaults = { | |
compute.local.someOption = "hello"; | |
some.module.enable = true; | |
some.module.opt = "someValue"; | |
}; | |
in with import <nixos> {}; { | |
network.description = "Some Deployment"; | |
network.enableRollback = true; | |
compute1 = computeDefaults // { | |
imports = [ ./compute/configuration.nix ]; | |
compute.local = { | |
some.module.opt = "override this"; | |
}; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, lib, options, modulesPath }: | |
let | |
cfg = config.compute.local; | |
in with lib; { | |
imports = [ | |
./some-module.nix | |
]; | |
options = { | |
compute.local = { | |
someOption = mkOption { | |
type = types.str; | |
description = "blah."; | |
}; | |
}; | |
}; | |
config = { | |
some.config.here = cfg.someOption; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, lib, options, modulesPath }: | |
with lib; | |
let | |
cfg = config.some.module; | |
in { | |
options = { | |
some.module = { | |
enable = mkEnableOption "Enable this thing"; | |
opt = mkOption { | |
type = types.str; | |
description = "Some other option."; | |
}; | |
}; | |
}; | |
config = mkIf cfg.enable { | |
services.some.thing.enable = true; | |
services.some.thing.blah = cfg.someOption; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment