chrillefkr / disko-images

Create disk image files from NixOS + disko configuration.
42 stars 1 forks source link

error: value is a set while a Boolean was expected #2

Open srl295 opened 8 months ago

srl295 commented 8 months ago
```terminal error: … while calling the 'seq' builtin at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:320:18: 319| options = checked options; 320| config = checked (removeAttrs config [ "_module" ]); | ^ 321| _module = checked (config._module); … ``` ```terminal … while evaluating a branch condition at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:261:9: 260| checkUnmatched = 261| if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then | ^ 262| let … in the left operand of the AND (&&) operator at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:261:72: 260| checkUnmatched = 261| if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then | ^ 262| let … in the left operand of the AND (&&) operator at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:261:33: 260| checkUnmatched = 261| if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then | ^ 262| let … while evaluating a branch condition at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:254:12: 253| 254| in if declaredConfig._module.freeformType == null then declaredConfig | ^ 255| # Because all definitions that had an associated option ended in … from call site at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:242:28: 241| # For definitions that have an associated option 242| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options; | ^ 243| … while calling 'mapAttrsRecursiveCond' at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/attrsets.nix:696:5: 695| # Attribute set to recursively map over. 696| set: | ^ 697| let … from call site at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:234:33: 233| ({ inherit lib options config specialArgs; } // specialArgs); 234| in mergeModules prefix (reverseList collected); | ^ 235| … while calling 'reverseList' at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/lists.nix:510:17: 509| */ 510| reverseList = xs: | ^ 511| let l = length xs; in genList (n: elemAt xs (l - n - 1)) l; … from call site at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:229:25: 228| merged = 229| let collected = collectModules | ^ 230| class … while calling anonymous lambda at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:443:37: 442| 443| in modulesPath: initialModules: args: | ^ 444| filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args); … from call site at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:444:7: 443| in modulesPath: initialModules: args: 444| filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args); | ^ 445| … while calling 'filterModules' at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:411:36: 410| # modules recursively. It returns the final list of unique-by-key modules 411| filterModules = modulesPath: { disabled, modules }: | ^ 412| let … while calling anonymous lambda at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:437:31: 436| disabledKeys = concatMap ({ file, disabled }: map (moduleKey file) disabled) disabled; 437| keyFilter = filter (attrs: ! elem attrs.key disabledKeys); | ^ 438| in map (attrs: attrs.module) (builtins.genericClosure { … from call site at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:398:22: 397| let 398| module = checkModule (loadModule args parentFile "${parentKey}:anon-${toString n}" x); | ^ 399| collectedImports = collectStructuredModules module._file module.key module.imports args; … while calling anonymous lambda at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:357:11: 356| then 357| m: | ^ 358| if m._class != null -> m._class == class … from call site at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:398:35: 397| let 398| module = checkModule (loadModule args parentFile "${parentKey}:anon-${toString n}" x); | ^ 399| collectedImports = collectStructuredModules module._file module.key module.imports args; … while calling 'loadModule' at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:334:53: 333| # Like unifyModuleSyntax, but also imports paths and calls functions if necessary 334| loadModule = args: fallbackFile: fallbackKey: m: | ^ 335| if isFunction m then … from call site at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:352:14: 351| throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}" 352| else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args); | ^ 353| … while calling 'unifyModuleSyntax' at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:452:34: 451| of ‘options’, ‘config’ and ‘imports’ attributes. */ 452| unifyModuleSyntax = file: key: m: | ^ 453| let … from call site at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:352:59: 351| throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}" 352| else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args); | ^ 353| … while calling 'applyModuleArgsIfFunction' at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:486:39: 485| 486| applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: | ^ 487| if isFunction f then applyModuleArgs key f args else f; … from call site at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/modules.nix:487:8: 486| applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: 487| if isFunction f then applyModuleArgs key f args else f; | ^ 488| … while calling 'isFunction' at /nix/store/9ckbs4lqcwysy2c5xlaw49xd31jwgkrp-source/lib/trivial.nix:448:16: 447| */ 448| isFunction = f: builtins.isFunction f || | ^ 449| (f ? __functor && isFunction (f.__functor f)); error: value is a set while a Boolean was expected ```
srl295 commented 8 months ago

here are my source files: https://gist.github.com/srl295/d9b20a10ab1488de228ec0a64caf705e

Built with:

$ nix --version
nix (Nix) 2.18.1
$ cat /etc/os-release
BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="23.11.2217.d02d818f22c7"
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 23.11 (Tapir)"
SUPPORT_END="2024-06-30"
SUPPORT_URL="https://nixos.org/community.html"
VERSION="23.11 (Tapir)"
VERSION_CODENAME=tapir
VERSION_ID="23.11"
$ nix --extra-experimental-features nix-command build --extra-experimental-features flakes '.#nixosConfigurations.my-machine.config.system.build.diskoImages'
srl295 commented 8 months ago

as I noted in #1 a working configuration.nix and disko.nix would be good sample files!