nixpkgs-unstable visible imperatively but not declaratively [closed]
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm trying to install this Python librarypython3.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.
python nix nixpkgs
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.
add a comment |Â
up vote
1
down vote
favorite
I'm trying to install this Python librarypython3.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.
python nix nixpkgs
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.
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to install this Python librarypython3.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.
python nix nixpkgs
I'm trying to install this Python librarypython3.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.
python nix nixpkgs
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.
add a comment |Â
add a comment |Â
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.
$ 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
add a comment |Â
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
I understood everything until the last line. However what I need to do is to setnixpkgs-unstable
as the default channel for my user. I will not be using adefault.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
 |Â
show 11 more comments
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.
$ 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
add a comment |Â
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.
$ 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
add a comment |Â
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.
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.
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
add a comment |Â
$ 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
add a comment |Â
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
I understood everything until the last line. However what I need to do is to setnixpkgs-unstable
as the default channel for my user. I will not be using adefault.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
 |Â
show 11 more comments
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
I understood everything until the last line. However what I need to do is to setnixpkgs-unstable
as the default channel for my user. I will not be using adefault.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
 |Â
show 11 more comments
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
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
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 setnixpkgs-unstable
as the default channel for my user. I will not be using adefault.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
 |Â
show 11 more comments
I understood everything until the last line. However what I need to do is to setnixpkgs-unstable
as the default channel for my user. I will not be using adefault.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
 |Â
show 11 more comments