Skip to content

Instantly share code, notes, and snippets.

@cmacrae
Last active December 17, 2019 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmacrae/35f2842f684dacc6750d3d73cae1a433 to your computer and use it in GitHub Desktop.
Save cmacrae/35f2842f684dacc6750d3d73cae1a433 to your computer and use it in GitHub Desktop.
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
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";
};
};
}
{ 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;
};
}
{ 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