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

error: file 'nixos/modules' was not found in the Nix search path #224

Open
milahu opened this issue Dec 4, 2021 · 3 comments · May be fixed by #225
Open

error: file 'nixos/modules' was not found in the Nix search path #224

milahu opened this issue Dec 4, 2021 · 3 comments · May be fixed by #225

Comments

@milahu
Copy link
Contributor

milahu commented Dec 4, 2021

run nix-gui

nix run github:nix-gui/nix-gui
INFO:Retrieving option values for module "/etc/nixos/configuration.nix"
INFO:Retrieving option values for module "/etc/nixos/hardware-configuration.nix"

navigate to environment.systemPackages and click on the plus button [ + ]
(whatever that button is, there is no tooltip)

ERROR:NixEvalError("""
error: file 'nixos/modules' was not found in the Nix search path (add it using $NIX_PATH or -I)

trace

ERROR:NixEvalError("""
error: file 'nixos/modules' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at /nix/store/5pgzzhbd37vrn7ndxgg1276xj0iic70m-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/nix/lib.nix:4:17:

            3|   inherit (import <nixos> {}) config;
            4|   modulesPath = <nixos/modules>;
             |                 ^
            5| in lib.makeExtensible (self: {

""")
Traceback (most recent call last):
  File "/nix/store/5pgzzhbd37vrn7ndxgg1276xj0iic70m-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/option_tree.py", line 263, in children
    children = self.tree.children(attribute)
  File "/nix/store/3rpcl8zn86vry182x86892z4kz2k9rxa-python3.9-treelib-1.6.1/lib/python3.9/site-packages/treelib/tree.py", line 360, in children
    return [self[i] for i in self.is_branch(nid)]
  File "/nix/store/3rpcl8zn86vry182x86892z4kz2k9rxa-python3.9-treelib-1.6.1/lib/python3.9/site-packages/treelib/tree.py", line 500, in is_branch
    raise NodeIDAbsentError("Node '%s' is not in the tree" % nid)
treelib.exceptions.NodeIDAbsentError: Node 'environment.systemPackages.newAttribute' is not in the tree

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/5pgzzhbd37vrn7ndxgg1276xj0iic70m-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/navlist.py", line 305, in add_clicked
    item = OptionListItem(
  File "/nix/store/5pgzzhbd37vrn7ndxgg1276xj0iic70m-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/navlist.py", line 115, in __init__
    num_direct_children = len(self.option_tree.children(self.option))
  File "/nix/store/5pgzzhbd37vrn7ndxgg1276xj0iic70m-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/option_tree.py", line 269, in children
    raise ValueError()
ValueError
Aborted

/etc/nixos/configuration.nix

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

let
  packageList = with pkgs; [
    gparted
    usbutils # lsusb
    nano
    wget
  ];
in

{
  environment.systemPackages = packageList;
}

env

sudo nix-channel --list 
nixos https://nixos.org/channels/nixos-21.05

echo $NIX_PATH | tr : '\n'
nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos
nixos-config=/etc/nixos/configuration.nix
/nix/var/nix/profiles/per-user/root/channels

ls /nix/var/nix/profiles/per-user/root/channels/nixos/modules
No such file or directory

ls /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/
config    i18n       misc             profiles  rename.nix  services  tasks    virtualisation
hardware  installer  module-list.nix  programs  security    system    testing

nix repl

nix-repl> <nixos/modules>
error: file 'nixos/modules' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «string»:1:1:

            1| <nixos/modules>
             | ^
            2|

nix-repl> <nixos/nixos/modules>
/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules
milahu added a commit to milahu/nix-gui that referenced this issue Dec 4, 2021
@milahu milahu linked a pull request Dec 4, 2021 that will close this issue
@milahu
Copy link
Contributor Author

milahu commented Dec 4, 2021

with #225 nix-gui throws

nix run . 

# navigate to environment.systemPackages
# click on the plus button [ + ]

Traceback (most recent call last):
  File "/nix/store/ga4x4k7mxzmv97ws0drgfj63mswg1rbf-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/option_tree.py", line 263, in children
    children = self.tree.children(attribute)
  File "/nix/store/3rpcl8zn86vry182x86892z4kz2k9rxa-python3.9-treelib-1.6.1/lib/python3.9/site-packages/treelib/tree.py", line 360, in children
    return [self[i] for i in self.is_branch(nid)]
  File "/nix/store/3rpcl8zn86vry182x86892z4kz2k9rxa-python3.9-treelib-1.6.1/lib/python3.9/site-packages/treelib/tree.py", line 500, in is_branch
    raise NodeIDAbsentError("Node '%s' is not in the tree" % nid)
treelib.exceptions.NodeIDAbsentError: Node 'environment.systemPackages.newAttribute' is not in the tree

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/ga4x4k7mxzmv97ws0drgfj63mswg1rbf-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/navlist.py", line 305, in add_clicked
    item = OptionListItem(
  File "/nix/store/ga4x4k7mxzmv97ws0drgfj63mswg1rbf-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/graphics/navlist.py", line 115, in __init__
    num_direct_children = len(self.option_tree.children(self.option))
  File "/nix/store/ga4x4k7mxzmv97ws0drgfj63mswg1rbf-python3.9-nix-gui-0.1.5/lib/python3.9/site-packages/nixui/options/option_tree.py", line 269, in children
    raise ValueError()
ValueError
Aborted

This was referenced Dec 5, 2021
@lapp0
Copy link
Collaborator

lapp0 commented Dec 5, 2021

Please try merging #229 into your branch. It fixed additions to dynamic navlists.

Dynamic navlists are still a WIP (only remaining issue in milestone 1)

@lapp0 lapp0 added this to the V0.3 milestone Dec 10, 2021
@milahu
Copy link
Contributor Author

milahu commented Aug 15, 2022

error: file 'nixos/modules' was not found in the Nix search path (add it using $NIX_PATH or -I)

still an issue on a fresh nixos install

$ echo $NIX_PATH | tr : '\n'
nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos
nixos-config=/etc/nixos/configuration.nix
/nix/var/nix/profiles/per-user/root/channels

workaround: nixos=$nixpkgs

$ NIX_PATH=$NIX_PATH:nixos=/nix/var/nix/profiles/per-user/root/channels/nixos nix run .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants