nix-software-center icon indicating copy to clipboard operation
nix-software-center copied to clipboard

NixOS Flakes Installation example fails to build.

Open ciferkey opened this issue 2 years ago • 5 comments

I followed the new instructions added to the README for installing with flakes.

Here is a branch of my nix configuration where I tried to apply the changes. This is the error I get when building:

nixos on  nix-software-center [?] took 6s 
❯ sudo nixos-rebuild test
building the system configuration...
error: undefined variable 'inputs'

       at /nix/store/ja0mwaax64phr09dmdhraj8zd1l8fibq-source/configuration.nix:72:5:

           71|     git
           72|     inputs.nix-software-center.packages.${system}.nix-software-center
             |     ^
           73|     libsForQt5.ark
(use '--show-trace' to show detailed location information)
Full output of --show-trace
nixos on  nix-software-center [?] 
✦ ❯ sudo nixos-rebuild test --show-trace
[sudo] password for ciferkey: 
building the system configuration...
error:
       … while evaluating the attribute 'activationScript' of the derivation 'nixos-system-nixos-23.05.20230213.545c7a3'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/pkgs/stdenv/generic/make-derivation.nix:293:7:

          292|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          293|       name =
             |       ^
          294|         let

       … while evaluating the attribute 'system.activationScripts.script'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/activation/activation-script.nix:137:9:

          136|       apply = set: set // {
          137|         script = systemActivationScript set false;
             |         ^
          138|       };

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/activation/activation-script.nix:137:18:

          136|       apply = set: set // {
          137|         script = systemActivationScript set false;
             |                  ^
          138|       };

       … while calling 'systemActivationScript'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/activation/activation-script.nix:20:33:

           19|
           20|   systemActivationScript = set: onlyDry: let
             |                                 ^
           21|     set' = mapAttrs (_: v: if isString v then (noDepEntry v) // { supportsDryActivation = false; } else v) set;

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/activation/activation-script.nix:49:9:

           48|
           49|       ${textClosureMap id (withDrySnippets) (attrNames withDrySnippets)}
             |         ^
           50|

       … while calling 'textClosureMap'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/strings-with-deps.nix:75:35:

           74|
           75|   textClosureMap = f: predefined: names:
             |                                   ^
           76|     concatStringsSep "\n" (map f (textClosureList predefined names));

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'id'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/trivial.nix:14:5:

           13|     # The value to return
           14|     x: x;
             |     ^
           15|

       … while evaluating the attribute 'text'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/activation/activation-script.nix:9:5:

            8|   addAttributeName = mapAttrs (a: v: v // {
            9|     text = ''
             |     ^
           10|       #### Activation script snippet ${a}:

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'g'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/attrsets.nix:535:19:

          534|           g =
          535|             name: value:
             |                   ^
          536|             if isAttrs value && cond value

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/attrsets.nix:538:20:

          537|               then recurse (path ++ [name]) value
          538|               else f (path ++ [name]) value;
             |                    ^
          539|         in mapAttrs g;

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:270:72:

          269|           # For definitions that have an associated option
          270|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          271|

       … while evaluating the attribute 'value'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:728:9:

          727|     in warnDeprecation opt //
          728|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          729|         inherit (res.defsFinal') highestPrio;

       … while evaluating the option `system.activationScripts.etc.text':

       … while evaluating the attribute 'mergedValue'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:763:5:

          762|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          763|     mergedValue =
             |     ^
          764|       if isDefined then

       … while evaluating the attribute 'values'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:757:9:

          756|       in {
          757|         values = defs''';
             |         ^
          758|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:856:7:

          855|     in {
          856|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          857|       inherit highestPrio;

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:743:17:

          742|         # Process mkMerge and mkIf properties.
          743|         defs' = concatMap (m:
             |                 ^
          744|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:743:28:

          742|         # Process mkMerge and mkIf properties.
          743|         defs' = concatMap (m:
             |                            ^
          744|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/etc/etc-activation.nix':

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:744:137:

          743|         defs' = concatMap (m:
          744|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          745|         ) defs;

       … while calling 'dischargeProperties'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:815:25:

          814|   */
          815|   dischargeProperties = def:
             |                         ^
          816|     if def._type or "" == "merge" then

       … while evaluating the attribute 'value'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:568:44:

          567|       defnsByName' = byName "config" (module: value:
          568|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          569|         ) configs;

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/attrsets.nix:716:24:

          715|     let f = attrPath:
          716|       zipAttrsWith (n: values:
             |                        ^
          717|         let here = attrPath ++ [n]; in

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/types.nix:546:29:

          545|       merge = loc: defs:
          546|         zipAttrsWith (name: defs:
             |                             ^
          547|           let merged = mergeDefinitions (loc ++ [name]) elemType defs;

       … while evaluating the attribute 'optionalValue.value'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:775:5:

          774|
          775|     optionalValue =
             |     ^
          776|       if isDefined then { value = mergedValue; }

       … while evaluating the attribute 'values'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:757:9:

          756|       in {
          757|         values = defs''';
             |         ^
          758|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:856:7:

          855|     in {
          856|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          857|       inherit highestPrio;

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:743:17:

          742|         # Process mkMerge and mkIf properties.
          743|         defs' = concatMap (m:
             |                 ^
          744|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:743:28:

          742|         # Process mkMerge and mkIf properties.
          743|         defs' = concatMap (m:
             |                            ^
          744|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/etc/etc.nix':

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:744:137:

          743|         defs' = concatMap (m:
          744|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          745|         ) defs;

       … while calling 'dischargeProperties'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:815:25:

          814|   */
          815|   dischargeProperties = def:
             |                         ^
          816|     if def._type or "" == "merge" then

       … while evaluating the attribute 'value'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/types.nix:552:58:

          551|         # Push down position info.
          552|         (map (def: mapAttrs (n: v: { inherit (def) file; value = v; }) def.value) defs);
             |                                                          ^
          553|       emptyValue = { value = {}; };

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/attrsets.nix:88:39:

           87|         then value
           88|         else { ${elemAt attrPath n} = atDepth (n + 1); };
             |                                       ^
           89|     in atDepth 0;

       … while calling 'atDepth'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/attrsets.nix:85:17:

           84|       len = length attrPath;
           85|       atDepth = n:
             |                 ^
           86|         if n == len

       … while evaluating the attribute 'value'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:568:44:

          567|       defnsByName' = byName "config" (module: value:
          568|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          569|         ) configs;

       … while evaluating the attribute 'buildCommand' of the derivation 'etc'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/pkgs/stdenv/generic/make-derivation.nix:293:7:

          292|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          293|       name =
             |       ^
          294|         let

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/etc/etc.nix:54:7:

           53|     mkdir -p "$out/etc"
           54|     ${concatMapStringsSep "\n" (etcEntry: escapeShellArgs [
             |       ^
           55|       "makeEtcEntry"

       … while calling 'concatMapStringsSep'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/strings.nix:112:5:

          111|     # List of input strings
          112|     list: concatStringsSep sep (map f list);
             |     ^
          113|

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/etc/etc.nix:54:33:

           53|     mkdir -p "$out/etc"
           54|     ${concatMapStringsSep "\n" (etcEntry: escapeShellArgs [
             |                                 ^
           55|       "makeEtcEntry"

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/nixos/modules/system/etc/etc.nix:54:43:

           53|     mkdir -p "$out/etc"
           54|     ${concatMapStringsSep "\n" (etcEntry: escapeShellArgs [
             |                                           ^
           55|       "makeEtcEntry"

       … while calling 'concatMapStringsSep'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/strings.nix:112:5:

          111|     # List of input strings
          112|     list: concatStringsSep sep (map f list);
             |     ^
          113|

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'escapeShellArg'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/strings.nix:366:20:

          365|   */
          366|   escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
             |                    ^
          367|

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'g'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/attrsets.nix:535:19:

          534|           g =
          535|             name: value:
             |                   ^
          536|             if isAttrs value && cond value

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/attrsets.nix:538:20:

          537|               then recurse (path ++ [name]) value
          538|               else f (path ++ [name]) value;
             |                    ^
          539|         in mapAttrs g;

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:270:72:

          269|           # For definitions that have an associated option
          270|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          271|

       … while evaluating the attribute 'value'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:728:9:

          727|     in warnDeprecation opt //
          728|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          729|         inherit (res.defsFinal') highestPrio;

       … while evaluating the option `environment.etc.dbus-1.source':

       … while evaluating the attribute 'mergedValue'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:763:5:

          762|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          763|     mergedValue =
             |     ^
          764|       if isDefined then

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:765:12:

          764|       if isDefined then
          765|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |            ^
          766|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:765:17:

          764|       if isDefined then
          765|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                 ^
          766|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:765:22:

          764|       if isDefined then
          765|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                      ^
          766|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling 'check'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/types.nix:482:15:

          481|       descriptionClass = "noun";
          482|       check = x: isStringLike x && builtins.substring 0 1 (toString x) == "/";
             |               ^
          483|       merge = mergeEqualOption;

       … while evaluating the attribute 'serviceDirectories' of the derivation 'dbus-1'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/pkgs/stdenv/generic/make-derivation.nix:293:7:

          292|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          293|       name =
             |       ^
          294|         let

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/types.nix:492:14:

          491|       merge = loc: defs:
          492|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
             |              ^
          493|           imap1 (m: def':

       … while evaluating the attribute 'value'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:776:27:

          775|     optionalValue =
          776|       if isDefined then { value = mergedValue; }
             |                           ^
          777|       else {};

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:765:12:

          764|       if isDefined then
          765|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |            ^
          766|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:765:17:

          764|       if isDefined then
          765|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                 ^
          766|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:765:22:

          764|       if isDefined then
          765|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                      ^
          766|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling 'check'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/types.nix:482:15:

          481|       descriptionClass = "noun";
          482|       check = x: isStringLike x && builtins.substring 0 1 (toString x) == "/";
             |               ^
          483|       merge = mergeEqualOption;

       … while evaluating the attribute 'passAsFile' of the derivation 'system-path'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/pkgs/stdenv/generic/make-derivation.nix:293:7:

          292|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          293|       name =
             |       ^
          294|         let

       … while evaluating the attribute 'passAsFile'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/pkgs/build-support/buildenv/default.nix:77:5:

           76|     # XXX: The size is somewhat arbitrary
           77|     passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
             |     ^
           78|   }

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'g'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/attrsets.nix:535:19:

          534|           g =
          535|             name: value:
             |                   ^
          536|             if isAttrs value && cond value

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/attrsets.nix:538:20:

          537|               then recurse (path ++ [name]) value
          538|               else f (path ++ [name]) value;
             |                    ^
          539|         in mapAttrs g;

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:270:72:

          269|           # For definitions that have an associated option
          270|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          271|

       … while evaluating the attribute 'value'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:728:9:

          727|     in warnDeprecation opt //
          728|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          729|         inherit (res.defsFinal') highestPrio;

       … while evaluating the option `environment.systemPackages':

       … while evaluating the attribute 'mergedValue'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:763:5:

          762|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          763|     mergedValue =
             |     ^
          764|       if isDefined then

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:765:59:

          764|       if isDefined then
          765|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                                                           ^
          766|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling 'merge'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/types.nix:491:20:

          490|       check = isList;
          491|       merge = loc: defs:
             |                    ^
          492|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/types.nix:492:35:

          491|       merge = loc: defs:
          492|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
             |                                   ^
          493|           imap1 (m: def':

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/lists.nix:117:29:

          116|   */
          117|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                             ^
          118|

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/lists.nix:117:32:

          116|   */
          117|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                ^
          118|

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/types.nix:493:21:

          492|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
          493|           imap1 (m: def':
             |                     ^
          494|             (mergeDefinitions

       … while evaluating the attribute 'optionalValue'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:775:5:

          774|
          775|     optionalValue =
             |     ^
          776|       if isDefined then { value = mergedValue; }

       … while evaluating the attribute 'values'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:757:9:

          756|       in {
          757|         values = defs''';
             |         ^
          758|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:856:7:

          855|     in {
          856|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          857|       inherit highestPrio;

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:743:17:

          742|         # Process mkMerge and mkIf properties.
          743|         defs' = concatMap (m:
             |                 ^
          744|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while calling anonymous lambda

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:743:28:

          742|         # Process mkMerge and mkIf properties.
          743|         defs' = concatMap (m:
             |                            ^
          744|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/ja0mwaax64phr09dmdhraj8zd1l8fibq-source/configuration.nix':

       … while evaluating call site

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:744:137:

          743|         defs' = concatMap (m:
          744|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          745|         ) defs;

       … while calling 'dischargeProperties'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/modules.nix:815:25:

          814|   */
          815|   dischargeProperties = def:
             |                         ^
          816|     if def._type or "" == "merge" then

       … while evaluating the attribute 'value'

       at /nix/store/yxcvhxxlq7q6284hmwzvnzcg1g5aph47-source/lib/types.nix:497:38:

          496|               elemType
          497|               [{ inherit (def) file; value = def'; }]
             |                                      ^
          498|             ).optionalValue

       error: undefined variable 'inputs'

       at /nix/store/ja0mwaax64phr09dmdhraj8zd1l8fibq-source/configuration.nix:72:5:

           71|     git
           72|     inputs.nix-software-center.packages.${system}.nix-software-center
             |     ^
           73|     libsForQt5.ark

I'm guessing there is some additional thing I need to pass to my configuration.nix. Is there anything I'm missing?

ciferkey avatar Feb 14 '23 16:02 ciferkey

Yeah, should have mentioned in the readme, you'll need to pass inputs into your configuration, so as the first line of your configuration, instead of something like this:

{ system, config, pkgs, lib, ... }:

You should have something like this

{ inputs, system, config, pkgs, lib, ... }:

vlinkz avatar Feb 21 '23 20:02 vlinkz

I did that, and then I got:

error: attribute 'inputs' missing

       at /nix/store/h6mas49w0bwjxsql1fm9j7rr6jrdqvs4-source/lib/modules.nix:483:28:

          482|         builtins.addErrorContext (context name)
          483|           (args.${name} or config._module.args.${name})
             |                            ^
          484|       ) (lib.functionArgs f);
(use '--show-trace' to show detailed location information)

iopq avatar Mar 08 '23 12:03 iopq

@iopq I think you may be missing the specialArgs attribute in your flake's calls to nixosSystem.

You should have something like:

nixosConfigurations.nixie-tube = nixpkgs.lib.nixosSystem {
  system = "...";
  modules = [
    # ...
  ];
  specialArgs = {
    # Make flake inputs available in NixOS modules.
    inherit inputs;
  };
};

jakehamilton avatar Mar 08 '23 14:03 jakehamilton

I had the same problem as @iopg. Confirming that adding inputs to specialArgs and at the top of my configuration.nix resolved the problem. Here's the commit in my config where I got it working.

ciferkey avatar Mar 08 '23 18:03 ciferkey

I had the same problem as @IOPg. Confirming that adding inputs to specialArgs and at the top of my configuration.nix resolved the problem. Here's the commit in my config where I got it working.

I copied your set-up and got it working, cheers

iopq avatar Apr 12 '23 11:04 iopq