nixpkgs-unstable visible imperatively but not declaratively [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I'm trying to install this Python library
python3.6-geopandas-0.3.0. And I successfully installed it imperatively with



$ nix-env -iA nixpkgs.python3Packages.geopandas



However I need to create an expression so that my Python environment includes it.



with import <nixpkgs> ;

python36.withPackages (ps: with ps; [
geopandas
])


Turns out I get



installing ‘python3-3.6.4-env’
error: undefined variable ‘geopandas’


I have both nixos and nixpkgs-unstable configured in my system. Not sure if correctly though. I have channel nixos for root and nixpkgs for my user.



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


I would like to make nixpkgs-unstable the default channel for my user, or at least make its packages visible as an overlay, so I could run the above expression successfully.







share|improve this question














closed as unclear what you're asking by Wildcard, G-Man, X Tian, Archemar, Rui F Ribeiro Feb 17 at 17:09


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


















    up vote
    1
    down vote

    favorite












    I'm trying to install this Python library
    python3.6-geopandas-0.3.0. And I successfully installed it imperatively with



    $ nix-env -iA nixpkgs.python3Packages.geopandas



    However I need to create an expression so that my Python environment includes it.



    with import <nixpkgs> ;

    python36.withPackages (ps: with ps; [
    geopandas
    ])


    Turns out I get



    installing ‘python3-3.6.4-env’
    error: undefined variable ‘geopandas’


    I have both nixos and nixpkgs-unstable configured in my system. Not sure if correctly though. I have channel nixos for root and nixpkgs for my user.



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


    I would like to make nixpkgs-unstable the default channel for my user, or at least make its packages visible as an overlay, so I could run the above expression successfully.







    share|improve this question














    closed as unclear what you're asking by Wildcard, G-Man, X Tian, Archemar, Rui F Ribeiro Feb 17 at 17:09


    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm trying to install this Python library
      python3.6-geopandas-0.3.0. And I successfully installed it imperatively with



      $ nix-env -iA nixpkgs.python3Packages.geopandas



      However I need to create an expression so that my Python environment includes it.



      with import <nixpkgs> ;

      python36.withPackages (ps: with ps; [
      geopandas
      ])


      Turns out I get



      installing ‘python3-3.6.4-env’
      error: undefined variable ‘geopandas’


      I have both nixos and nixpkgs-unstable configured in my system. Not sure if correctly though. I have channel nixos for root and nixpkgs for my user.



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


      I would like to make nixpkgs-unstable the default channel for my user, or at least make its packages visible as an overlay, so I could run the above expression successfully.







      share|improve this question














      I'm trying to install this Python library
      python3.6-geopandas-0.3.0. And I successfully installed it imperatively with



      $ nix-env -iA nixpkgs.python3Packages.geopandas



      However I need to create an expression so that my Python environment includes it.



      with import <nixpkgs> ;

      python36.withPackages (ps: with ps; [
      geopandas
      ])


      Turns out I get



      installing ‘python3-3.6.4-env’
      error: undefined variable ‘geopandas’


      I have both nixos and nixpkgs-unstable configured in my system. Not sure if correctly though. I have channel nixos for root and nixpkgs for my user.



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


      I would like to make nixpkgs-unstable the default channel for my user, or at least make its packages visible as an overlay, so I could run the above expression successfully.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 18 at 0:37

























      asked Feb 16 at 5:15









      dmvianna

      322311




      322311




      closed as unclear what you're asking by Wildcard, G-Man, X Tian, Archemar, Rui F Ribeiro Feb 17 at 17:09


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






      closed as unclear what you're asking by Wildcard, G-Man, X Tian, Archemar, Rui F Ribeiro Feb 17 at 17:09


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          Your expression works for me on current nixpkgs master. I would investigate if your NIX_PATH isn't taking some old <nixpkgs> that you didn't expect, e.g. geopandas isn't present on the 17.09 stable branch.






          share|improve this answer




















          • $ echo $NIX_PATH nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
            – dmvianna
            Feb 16 at 11:08










          • I would like to use stable in root and unstable in the user environment. Is that possible?
            – dmvianna
            Feb 18 at 9:32

















          up vote
          2
          down vote













          I was able to reproduce this on NixOS.



          Your NIX_PATH sets nixpkgs to /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs which if you look up is just a symlink to /nix/var/nix/profiles/per-user/root/channels/nixos/. It's probably a little hack to make work all the expressions that are in the wild that expect <nixpkgs> to point to a valid channel path (even though I don't think it's a requirement for a nix system and seems to originate from nix-daemon).



          To fix it you either have to redefine NIX_PATH to point to an actual nixpkgs channel or you have to explicitly state the path to the channel instead of using <nixpkgs> in your expression.



          You can find your available channels in ~/.nix-defexpr:



          $tree -l -L 2 ~/.nix-defexpr/
          /home/user1/.nix-defexpr/
          ├── channels -> /nix/var/nix/profiles/per-user/user1/channels
          │   ├── ...
          │   └── nixpkgs -> /nix/store/qz1.../nixpkgs
          └── channels_root -> /nix/var/nix/profiles/per-user/root/channels
          ├── ...
          └── nixos -> /nix/store/53b.../nixos


          (channels contains the user-specific channels while channels_root contains the channels that root subscribed to and are available to all users)



          So if you decided to use the user1's subscription to nixpkgs then you would run:



          NIX_PATH="nixpkgs=/home/user1/.nix-defexpr/channels/nixpkgs" nix-env -f default.nix -i






          share|improve this answer






















          • I understood everything until the last line. However what I need to do is to set nixpkgs-unstable as the default channel for my user. I will not be using a default.nix file. How would I correct the behaviour then?
            – dmvianna
            Feb 17 at 20:32






          • 1




            <nixpkgs> is not some magic bound to a "default channel" - it just instructs nix to look into the NIX_PATH linux environment variable and look for an assignment of the form "nixpkgs=..." and use the right side of the assignment as the value of <nixpkgs>. You can prefix any command in linux with an assignment like I showed above and it will set the environment variable just for that one command invocation.
            – fghibellini
            Feb 17 at 20:39






          • 1




            see stackoverflow.com/questions/36452057/…
            – fghibellini
            Feb 17 at 20:46






          • 1




            I believe the config gets passed the package set of the 'nixos' channel root is subscribed to, but I cannot find any documentation regarding it.
            – fghibellini
            Feb 23 at 21:22






          • 1




            another example of using fixed channels with a good explanation garbas.si/2015/reproducible-development-environments.html
            – fghibellini
            Feb 25 at 13:57

















          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          Your expression works for me on current nixpkgs master. I would investigate if your NIX_PATH isn't taking some old <nixpkgs> that you didn't expect, e.g. geopandas isn't present on the 17.09 stable branch.






          share|improve this answer




















          • $ echo $NIX_PATH nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
            – dmvianna
            Feb 16 at 11:08










          • I would like to use stable in root and unstable in the user environment. Is that possible?
            – dmvianna
            Feb 18 at 9:32














          up vote
          2
          down vote













          Your expression works for me on current nixpkgs master. I would investigate if your NIX_PATH isn't taking some old <nixpkgs> that you didn't expect, e.g. geopandas isn't present on the 17.09 stable branch.






          share|improve this answer




















          • $ echo $NIX_PATH nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
            – dmvianna
            Feb 16 at 11:08










          • I would like to use stable in root and unstable in the user environment. Is that possible?
            – dmvianna
            Feb 18 at 9:32












          up vote
          2
          down vote










          up vote
          2
          down vote









          Your expression works for me on current nixpkgs master. I would investigate if your NIX_PATH isn't taking some old <nixpkgs> that you didn't expect, e.g. geopandas isn't present on the 17.09 stable branch.






          share|improve this answer












          Your expression works for me on current nixpkgs master. I would investigate if your NIX_PATH isn't taking some old <nixpkgs> that you didn't expect, e.g. geopandas isn't present on the 17.09 stable branch.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 16 at 8:54









          Vladimír Čunát

          62135




          62135











          • $ echo $NIX_PATH nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
            – dmvianna
            Feb 16 at 11:08










          • I would like to use stable in root and unstable in the user environment. Is that possible?
            – dmvianna
            Feb 18 at 9:32
















          • $ echo $NIX_PATH nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
            – dmvianna
            Feb 16 at 11:08










          • I would like to use stable in root and unstable in the user environment. Is that possible?
            – dmvianna
            Feb 18 at 9:32















          $ echo $NIX_PATH nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
          – dmvianna
          Feb 16 at 11:08




          $ echo $NIX_PATH nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
          – dmvianna
          Feb 16 at 11:08












          I would like to use stable in root and unstable in the user environment. Is that possible?
          – dmvianna
          Feb 18 at 9:32




          I would like to use stable in root and unstable in the user environment. Is that possible?
          – dmvianna
          Feb 18 at 9:32












          up vote
          2
          down vote













          I was able to reproduce this on NixOS.



          Your NIX_PATH sets nixpkgs to /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs which if you look up is just a symlink to /nix/var/nix/profiles/per-user/root/channels/nixos/. It's probably a little hack to make work all the expressions that are in the wild that expect <nixpkgs> to point to a valid channel path (even though I don't think it's a requirement for a nix system and seems to originate from nix-daemon).



          To fix it you either have to redefine NIX_PATH to point to an actual nixpkgs channel or you have to explicitly state the path to the channel instead of using <nixpkgs> in your expression.



          You can find your available channels in ~/.nix-defexpr:



          $tree -l -L 2 ~/.nix-defexpr/
          /home/user1/.nix-defexpr/
          ├── channels -> /nix/var/nix/profiles/per-user/user1/channels
          │   ├── ...
          │   └── nixpkgs -> /nix/store/qz1.../nixpkgs
          └── channels_root -> /nix/var/nix/profiles/per-user/root/channels
          ├── ...
          └── nixos -> /nix/store/53b.../nixos


          (channels contains the user-specific channels while channels_root contains the channels that root subscribed to and are available to all users)



          So if you decided to use the user1's subscription to nixpkgs then you would run:



          NIX_PATH="nixpkgs=/home/user1/.nix-defexpr/channels/nixpkgs" nix-env -f default.nix -i






          share|improve this answer






















          • I understood everything until the last line. However what I need to do is to set nixpkgs-unstable as the default channel for my user. I will not be using a default.nix file. How would I correct the behaviour then?
            – dmvianna
            Feb 17 at 20:32






          • 1




            <nixpkgs> is not some magic bound to a "default channel" - it just instructs nix to look into the NIX_PATH linux environment variable and look for an assignment of the form "nixpkgs=..." and use the right side of the assignment as the value of <nixpkgs>. You can prefix any command in linux with an assignment like I showed above and it will set the environment variable just for that one command invocation.
            – fghibellini
            Feb 17 at 20:39






          • 1




            see stackoverflow.com/questions/36452057/…
            – fghibellini
            Feb 17 at 20:46






          • 1




            I believe the config gets passed the package set of the 'nixos' channel root is subscribed to, but I cannot find any documentation regarding it.
            – fghibellini
            Feb 23 at 21:22






          • 1




            another example of using fixed channels with a good explanation garbas.si/2015/reproducible-development-environments.html
            – fghibellini
            Feb 25 at 13:57














          up vote
          2
          down vote













          I was able to reproduce this on NixOS.



          Your NIX_PATH sets nixpkgs to /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs which if you look up is just a symlink to /nix/var/nix/profiles/per-user/root/channels/nixos/. It's probably a little hack to make work all the expressions that are in the wild that expect <nixpkgs> to point to a valid channel path (even though I don't think it's a requirement for a nix system and seems to originate from nix-daemon).



          To fix it you either have to redefine NIX_PATH to point to an actual nixpkgs channel or you have to explicitly state the path to the channel instead of using <nixpkgs> in your expression.



          You can find your available channels in ~/.nix-defexpr:



          $tree -l -L 2 ~/.nix-defexpr/
          /home/user1/.nix-defexpr/
          ├── channels -> /nix/var/nix/profiles/per-user/user1/channels
          │   ├── ...
          │   └── nixpkgs -> /nix/store/qz1.../nixpkgs
          └── channels_root -> /nix/var/nix/profiles/per-user/root/channels
          ├── ...
          └── nixos -> /nix/store/53b.../nixos


          (channels contains the user-specific channels while channels_root contains the channels that root subscribed to and are available to all users)



          So if you decided to use the user1's subscription to nixpkgs then you would run:



          NIX_PATH="nixpkgs=/home/user1/.nix-defexpr/channels/nixpkgs" nix-env -f default.nix -i






          share|improve this answer






















          • I understood everything until the last line. However what I need to do is to set nixpkgs-unstable as the default channel for my user. I will not be using a default.nix file. How would I correct the behaviour then?
            – dmvianna
            Feb 17 at 20:32






          • 1




            <nixpkgs> is not some magic bound to a "default channel" - it just instructs nix to look into the NIX_PATH linux environment variable and look for an assignment of the form "nixpkgs=..." and use the right side of the assignment as the value of <nixpkgs>. You can prefix any command in linux with an assignment like I showed above and it will set the environment variable just for that one command invocation.
            – fghibellini
            Feb 17 at 20:39






          • 1




            see stackoverflow.com/questions/36452057/…
            – fghibellini
            Feb 17 at 20:46






          • 1




            I believe the config gets passed the package set of the 'nixos' channel root is subscribed to, but I cannot find any documentation regarding it.
            – fghibellini
            Feb 23 at 21:22






          • 1




            another example of using fixed channels with a good explanation garbas.si/2015/reproducible-development-environments.html
            – fghibellini
            Feb 25 at 13:57












          up vote
          2
          down vote










          up vote
          2
          down vote









          I was able to reproduce this on NixOS.



          Your NIX_PATH sets nixpkgs to /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs which if you look up is just a symlink to /nix/var/nix/profiles/per-user/root/channels/nixos/. It's probably a little hack to make work all the expressions that are in the wild that expect <nixpkgs> to point to a valid channel path (even though I don't think it's a requirement for a nix system and seems to originate from nix-daemon).



          To fix it you either have to redefine NIX_PATH to point to an actual nixpkgs channel or you have to explicitly state the path to the channel instead of using <nixpkgs> in your expression.



          You can find your available channels in ~/.nix-defexpr:



          $tree -l -L 2 ~/.nix-defexpr/
          /home/user1/.nix-defexpr/
          ├── channels -> /nix/var/nix/profiles/per-user/user1/channels
          │   ├── ...
          │   └── nixpkgs -> /nix/store/qz1.../nixpkgs
          └── channels_root -> /nix/var/nix/profiles/per-user/root/channels
          ├── ...
          └── nixos -> /nix/store/53b.../nixos


          (channels contains the user-specific channels while channels_root contains the channels that root subscribed to and are available to all users)



          So if you decided to use the user1's subscription to nixpkgs then you would run:



          NIX_PATH="nixpkgs=/home/user1/.nix-defexpr/channels/nixpkgs" nix-env -f default.nix -i






          share|improve this answer














          I was able to reproduce this on NixOS.



          Your NIX_PATH sets nixpkgs to /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs which if you look up is just a symlink to /nix/var/nix/profiles/per-user/root/channels/nixos/. It's probably a little hack to make work all the expressions that are in the wild that expect <nixpkgs> to point to a valid channel path (even though I don't think it's a requirement for a nix system and seems to originate from nix-daemon).



          To fix it you either have to redefine NIX_PATH to point to an actual nixpkgs channel or you have to explicitly state the path to the channel instead of using <nixpkgs> in your expression.



          You can find your available channels in ~/.nix-defexpr:



          $tree -l -L 2 ~/.nix-defexpr/
          /home/user1/.nix-defexpr/
          ├── channels -> /nix/var/nix/profiles/per-user/user1/channels
          │   ├── ...
          │   └── nixpkgs -> /nix/store/qz1.../nixpkgs
          └── channels_root -> /nix/var/nix/profiles/per-user/root/channels
          ├── ...
          └── nixos -> /nix/store/53b.../nixos


          (channels contains the user-specific channels while channels_root contains the channels that root subscribed to and are available to all users)



          So if you decided to use the user1's subscription to nixpkgs then you would run:



          NIX_PATH="nixpkgs=/home/user1/.nix-defexpr/channels/nixpkgs" nix-env -f default.nix -i







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 17 at 15:44









          Thomas

          3,39741123




          3,39741123










          answered Feb 17 at 15:09









          fghibellini

          212




          212











          • I understood everything until the last line. However what I need to do is to set nixpkgs-unstable as the default channel for my user. I will not be using a default.nix file. How would I correct the behaviour then?
            – dmvianna
            Feb 17 at 20:32






          • 1




            <nixpkgs> is not some magic bound to a "default channel" - it just instructs nix to look into the NIX_PATH linux environment variable and look for an assignment of the form "nixpkgs=..." and use the right side of the assignment as the value of <nixpkgs>. You can prefix any command in linux with an assignment like I showed above and it will set the environment variable just for that one command invocation.
            – fghibellini
            Feb 17 at 20:39






          • 1




            see stackoverflow.com/questions/36452057/…
            – fghibellini
            Feb 17 at 20:46






          • 1




            I believe the config gets passed the package set of the 'nixos' channel root is subscribed to, but I cannot find any documentation regarding it.
            – fghibellini
            Feb 23 at 21:22






          • 1




            another example of using fixed channels with a good explanation garbas.si/2015/reproducible-development-environments.html
            – fghibellini
            Feb 25 at 13:57
















          • I understood everything until the last line. However what I need to do is to set nixpkgs-unstable as the default channel for my user. I will not be using a default.nix file. How would I correct the behaviour then?
            – dmvianna
            Feb 17 at 20:32






          • 1




            <nixpkgs> is not some magic bound to a "default channel" - it just instructs nix to look into the NIX_PATH linux environment variable and look for an assignment of the form "nixpkgs=..." and use the right side of the assignment as the value of <nixpkgs>. You can prefix any command in linux with an assignment like I showed above and it will set the environment variable just for that one command invocation.
            – fghibellini
            Feb 17 at 20:39






          • 1




            see stackoverflow.com/questions/36452057/…
            – fghibellini
            Feb 17 at 20:46






          • 1




            I believe the config gets passed the package set of the 'nixos' channel root is subscribed to, but I cannot find any documentation regarding it.
            – fghibellini
            Feb 23 at 21:22






          • 1




            another example of using fixed channels with a good explanation garbas.si/2015/reproducible-development-environments.html
            – fghibellini
            Feb 25 at 13:57















          I understood everything until the last line. However what I need to do is to set nixpkgs-unstable as the default channel for my user. I will not be using a default.nix file. How would I correct the behaviour then?
          – dmvianna
          Feb 17 at 20:32




          I understood everything until the last line. However what I need to do is to set nixpkgs-unstable as the default channel for my user. I will not be using a default.nix file. How would I correct the behaviour then?
          – dmvianna
          Feb 17 at 20:32




          1




          1




          <nixpkgs> is not some magic bound to a "default channel" - it just instructs nix to look into the NIX_PATH linux environment variable and look for an assignment of the form "nixpkgs=..." and use the right side of the assignment as the value of <nixpkgs>. You can prefix any command in linux with an assignment like I showed above and it will set the environment variable just for that one command invocation.
          – fghibellini
          Feb 17 at 20:39




          <nixpkgs> is not some magic bound to a "default channel" - it just instructs nix to look into the NIX_PATH linux environment variable and look for an assignment of the form "nixpkgs=..." and use the right side of the assignment as the value of <nixpkgs>. You can prefix any command in linux with an assignment like I showed above and it will set the environment variable just for that one command invocation.
          – fghibellini
          Feb 17 at 20:39




          1




          1




          see stackoverflow.com/questions/36452057/…
          – fghibellini
          Feb 17 at 20:46




          see stackoverflow.com/questions/36452057/…
          – fghibellini
          Feb 17 at 20:46




          1




          1




          I believe the config gets passed the package set of the 'nixos' channel root is subscribed to, but I cannot find any documentation regarding it.
          – fghibellini
          Feb 23 at 21:22




          I believe the config gets passed the package set of the 'nixos' channel root is subscribed to, but I cannot find any documentation regarding it.
          – fghibellini
          Feb 23 at 21:22




          1




          1




          another example of using fixed channels with a good explanation garbas.si/2015/reproducible-development-environments.html
          – fghibellini
          Feb 25 at 13:57




          another example of using fixed channels with a good explanation garbas.si/2015/reproducible-development-environments.html
          – fghibellini
          Feb 25 at 13:57


          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay