Closed spease closed 3 years ago
I don't have a macOS machine to test, you might need a slightly different path - e.g. for me on NixOS, nix-env -iA nixos.pkgs.haskellPackages.postgrest
works. Have you tried nix-env -iA pkgs.haskellPackages.postgrest
, can any other package be installed? What channel are you on (nix-channel --list
)?
Ugh, my Unifi Dream Machine is acting up again. Really wish things would just work like they’re supposed to. So I’m typing up my findings on my phone for now.
Doing -iA nixpkgs.haskellPackages.postgrest did find the package, but it’s marked as broken. Overriding by setting allow broken packages environment variable then kicked off a fairly massive dependency download process, which crapped out when the dream machine did.
So, unfortunately I can’t provide an exact error, but it looks like someone else has encountered it already to mark the package as broken (maybe this is just under macOS?)
Ah, no - you most likely just need a newer set of nixpkgs.
We unbroke the package with https://github.com/NixOS/nixpkgs/pull/85230. It was originally automatically marked as broken because the test suite didn't pass, which was unavoidable as we need additional setup for a Postges db to run them.
See if you can upgrade your channel tk unstable or at least 20.09, I suspect you are on 20.03 or older.
Got it. I figured out the issue. It looks like the nixpkgs-unstable channel is based on pre-21.03 or something weird. I've filed a ticket for the nixos homepage and switched over to the nixos-20.09 channel. Now it's only installing version 7.0.0 instead of 7.0.1, but it's not marked as broken.
https://github.com/NixOS/nixos-homepage/issues/664
EDIT: Doh, just realized I glossed over the years. Well, something weird is going on.
Hm, that's weird - I'm not aware that there ever was an unbroken 7.0.0 in Nixpkgs. To figure this out, can you provide the output of nix-channel --list
?
EDIT: Ugh sorry for the massive blob, I assumed it'd scroll it
Right now it's
$ nix-channel --list ~
darwin https://github.com/LnL7/nix-darwin/archive/master.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable
Now if I try to install postgrest it says it's broken:
nix-env -iA nixpkgs.haskellPackages.postgrest ~
warning: name collision in input Nix expressions, skipping '/Users/spease/.nix-defexpr/channels_root/nixpkgs'
replacing old 'postgrest-7.0.1'
installing 'postgrest-7.0.1'
error: Package ‘postgrest-7.0.1’ in /nix/store/0g07yy92hd5prdkh0pjhnfnygszhgmp4-nixpkgs-21.03pre260406.bea44d5ebe3/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix:203132 is marked as broken, refusing to evaluate.
a) To temporarily allow broken packages, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_BROKEN=1
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowBroken = true; }
to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)
but if I override that it goes ahead and installs:
Is it possible that it's marked as broken but you've got allow broken set in your config or environment? That would explain the discrepancy.
Updated again:
$ nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
"21.03pre262620.a67cfc0cdc1"
Still get:
$ nix-env -iA nixpkgs.haskellPackages.postgrest
warning: name collision in input Nix expressions, skipping '/Users/spease/.nix-defexpr/channels_root/darwin'
warning: name collision in input Nix expressions, skipping '/Users/spease/.nix-defexpr/channels_root/nixpkgs'
replacing old 'postgrest-7.0.1'
installing 'postgrest-7.0.1'
error: Package ‘postgrest-7.0.1’ in /nix/store/p4ar6xlngwcgks1zpmi8ljr8va3w5fdp-nixpkgs-21.03pre262620.a67cfc0cdc1/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix:203236 is marked as broken, refusing to evaluate.
a) To temporarily allow broken packages, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_BROKEN=1
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowBroken = true; }
to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)
Hm, not sure what happens there.
We had marked the package as not broken a year ago by disabling running the tests automatically, as they require a test database:
It's not marked as broken here:
For me, it builds without issue on
nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
"21.05pre280331.54c1e44240d"
The build is also cached at cache.nixos.org as /nix/store/jyvwqfgdxbfcn2x3dnl1xhgrfxrb13iq-postgrest-7.0.1
It's either some platform dependent issue (not sure where that would come from) or some outdated nixpkgs creeping up.
I'm closing this for now, but please reopen if the issue persists.
Environment
Description of issue
Attempting to follow the install instructions for nix in the 7.0.1 documentation does not work, and suggests postgrest is not available in nixpkgs. Tried on two different machines, also tried updating system nix environment just to be sure.