Skip to content
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

devenv's nix breaks when ~/.config/nixpkgs/config.nix is a symlink #260

Open
Mic92 opened this issue Dec 29, 2022 · 0 comments
Open

devenv's nix breaks when ~/.config/nixpkgs/config.nix is a symlink #260

Mic92 opened this issue Dec 29, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Mic92
Copy link

Mic92 commented Dec 29, 2022

Describe the bug

Evaluating nixpkgs inside nixpkgs leads to error: getting status of '/home/joerg/.config/.homesick/repos/dotfiles/home/.config/nixpkgs/config.nix': No such file or directory

My configuration is actually in /home/joerg/.homesick/repos/dotfiles/home/.config/nixpkgs/config.nix not in /home/joerg/.config/.homesick/repos/dotfiles/home/.config/nixpkgs/config.nix. This works with the latest nix master but is broken in devshell.

Steps to reproduce

$ nix shell github:cachix/devenv/v0.5 
$ ls -la ~/.config/nixpkgs
lrwxrwxrwx joerg users 48 B 5 years ago  /home/joerg/.config/nixpkgs@ ⇒ ../.homesick/repos/dotfiles/home/.config/nixpkgs
$ mkdir example
$ cd example
$ devenv shell
$ devenv.nix does not exist. Maybe you want to run first $ devenv init
Building shell ...
warning: creating lock file '/home/joerg/example/devenv.lock'
error:
       at /home/joerg/example/.devenv.flake.nix:13:14:

           12|     let
           13|       pkgs = import nixpkgs { system = "x86_64-linux"; };
             |              ^
           14|       lib = pkgs.lib;

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/impure.nix:14:1:

           13|
           14| { # We put legacy `system` into `localSystem`, if `localSystem` was not passed.
             | ^
           15|   # If neither is passed, assume we are building packages on the current

       … while calling anonymous lambda

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/impure.nix:87:1:

           86|
           87| import ./. (builtins.removeAttrs args [ "system" ] // {
             | ^
           88|   inherit config overlays localSystem;

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/default.nix:19:1:

           18|
           19| { # The system packages will be built on. See the manual for the
             | ^
           20|   # subtle division of labor between these two `*System`s and the three

       … while calling anonymous lambda

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/default.nix:131:4:

          130|
          131| in checked pkgs
             |    ^
          132|

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/default.nix:58:108:

           57|     throwIfNot (lib.isList crossOverlays) "The crossOverlays argument to nixpkgs must be a list."
           58|     lib.foldr (x: throwIfNot (lib.isFunction x) "All crossOverlays passed to nixpkgs must be functions.") (r: r) crossOverlays
             |                                                                                                            ^
           59|     ;

       … while calling anonymous lambda

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/default.nix:129:10:

          128|
          129|   pkgs = boot stages;
             |          ^
          130|

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/stdenv/booter.nix:42:1:

           41| # other words, this does a foldr not foldl.
           42| stageFuns: let
             | ^
           43|

       … while calling anonymous lambda

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/stdenv/booter.nix:142:4:

          141|
          142| in dfold folder postStage (_: {}) withAllowCustomOverrides
             |    ^
          143|

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/stdenv/booter.nix:60:27:

           59|   */
           60|   dfold = op: lnul: rnul: list:
             |                           ^
           61|     let

       … while calling 'dfold'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/stdenv/booter.nix:72:13:

           71|       lapp = lnul cur;
           72|       cur = go lapp 0;
             |             ^
           73|     in cur;

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/stdenv/booter.nix:63:18:

           62|       len = builtins.length list;
           63|       go = pred: n:
             |                  ^
           64|         if n == len

       … while calling 'go'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/stdenv/booter.nix:78:30:

           77|   # isn't already set.
           78|   withAllowCustomOverrides = lib.lists.imap1
             |                              ^
           79|     (index: stageFun: prevStage:

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/lists.nix:117:14:

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

       … while calling 'imap1'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/stdenv/booter.nix:85:6:

           84|       // (stageFun prevStage))
           85|     (lib.lists.reverseList stageFuns);
             |      ^
           86|

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/lists.nix:394:17:

          393|   */
          394|   reverseList = xs:
             |                 ^
          395|     let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;

       … while calling 'reverseList'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/default.nix:125:12:

          124|
          125|   stages = stdenvStages {
             |            ^
          126|     inherit lib localSystem crossSystem config overlays crossOverlays;

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/stdenv/default.nix:7:1:

            6|
            7| { # Args just for stdenvs' usage
             | ^
            8|   lib

       … while calling anonymous lambda

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/default.nix:88:12:

           87|   # take all the rest as-is
           88|   config = lib.showWarnings configEval.config.warnings configEval.config;
             |            ^
           89|

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/trivial.nix:414:28:

          413|
          414|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                            ^
          415|

       … while calling 'showWarnings'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/trivial.nix:414:33:

          413|
          414|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                                 ^
          415|

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/lists.nix:53:20:

           52|   */
           53|   foldr = op: nul: list:
             |                    ^
           54|     let

       … while calling 'foldr'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/lists.nix:60:8:

           59|         else op (elemAt list n) (fold' (n + 1));
           60|     in fold' 0;
             |        ^
           61|

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/lists.nix:56:15:

           55|       len = length list;
           56|       fold' = n:
             |               ^
           57|         if n == len

       … while calling 'fold''

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:341:9:

          340|         options = checked options;
          341|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          342|         _module = checked (config._module);

       … while evaluating the attribute 'config.warnings'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/attrsets.nix:530:19:

          529|           g =
          530|             name: value:
             |                   ^
          531|             if isAttrs value && cond value

       … while calling 'g'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/attrsets.nix:533:20:

          532|               then recurse (path ++ [name]) value
          533|               else f (path ++ [name]) value;
             |                    ^
          534|         in mapAttrs g;

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:265:72:

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

       … while calling anonymous lambda

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:723:9:

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

       … while evaluating the attribute 'value'

       … while evaluating the option `_module.freeformType':

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:758:5:

          757|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          758|     mergedValue =
             |     ^
          759|       if isDefined then

       … while evaluating the attribute 'mergedValue'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:752:9:

          751|       in {
          752|         values = defs''';
             |         ^
          753|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'values'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:851:7:

          850|     in {
          851|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          852|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:562:22:

          561|       # extract the definitions for each loc
          562|       defnsByName' = byName "config" (module: value:
             |                      ^
          563|           [{ inherit (module) file; inherit value; }]

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:537:25:

          536|       */
          537|       byName = attr: f: modules:
             |                         ^
          538|         zipAttrsWith (n: concatLists)

       … while calling 'byName'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:558:21:

          557|       # an attrset 'name' => list of submodules that define ‘name’.
          558|       defnsByName = byName "config" (module: value:
             |                     ^
          559|           map (config: { inherit (module) file; inherit config; }) (pushDownProperties value)

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:537:25:

          536|       */
          537|       byName = attr: f: modules:
             |                         ^
          538|         zipAttrsWith (n: concatLists)

       … while calling 'byName'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:512:8:

          511|     mergeModules' prefix modules
          512|       (concatMap (m: map (config: { file = m._file; inherit config; }) (pushDownProperties m.config)) modules);
             |        ^
          513|

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:512:19:

          511|     mergeModules' prefix modules
          512|       (concatMap (m: map (config: { file = m._file; inherit config; }) (pushDownProperties m.config)) modules);
             |                   ^
          513|

       … while calling anonymous lambda

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:512:73:

          511|     mergeModules' prefix modules
          512|       (concatMap (m: map (config: { file = m._file; inherit config; }) (pushDownProperties m.config)) modules);
             |                                                                         ^
          513|

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:790:24:

          789|   */
          790|   pushDownProperties = cfg:
             |                        ^
          791|     if cfg._type or "" == "merge" then

       … while calling 'pushDownProperties'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:448:11:

          447|           options = m.options or {};
          448|           config = addFreeformType (addMeta (m.config or {}));
             |           ^
          449|         }

       … while evaluating the attribute 'config'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:448:20:

          447|           options = m.options or {};
          448|           config = addFreeformType (addMeta (m.config or {}));
             |                    ^
          449|         }

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:434:25:

          433|         else config;
          434|       addFreeformType = config: if m ? freeformType
             |                         ^
          435|         then mkMerge [ config { _module.freeformType = m.freeformType; } ]

       … while calling 'addFreeformType'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:448:37:

          447|           options = m.options or {};
          448|           config = addFreeformType (addMeta (m.config or {}));
             |                                     ^
          449|         }

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/modules.nix:431:17:

          430|     let
          431|       addMeta = config: if m ? meta
             |                 ^
          432|         then mkMerge [ config { meta = m.meta; } ]

       … while calling 'addMeta'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/default.nix:82:9:

           81|         _file = "nixpkgs.config";
           82|         config = config1;
             |         ^
           83|       })

       … while evaluating the attribute 'config'

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/pkgs/top-level/default.nix:73:8:

           72|   config1 =
           73|     if lib.isFunction config0
             |        ^
           74|     then config0 { inherit pkgs; }

       … from call site

       at «github:NixOS/nixpkgs/e58a7747db96c23b8a977e7c1bbfc5753b81b6fa»/lib/trivial.nix:448:16:

          447|   */
          448|   isFunction = f: builtins.isFunction f ||
             |                ^
          449|     (f ? __functor && isFunction (f.__functor f));

       … while calling 'isFunction'

       error: getting status of '/home/joerg/.config/.homesick/repos/dotfiles/home/.config/nixpkgs/config.nix': No such file or directory

Version

v0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant