nix develop gives a different result from nix develop .#devShells.x86_64-linux.default. This is weird, since the debug logs show that it is being read at the right commit hash as well…
$ nix develop -vv
evaluating derivation 'git+file:///home/jack/dev/infopt_PV#devShells.x86_64-linux.default'...
fetching git input 'git+file:///home/jack/dev/infopt_PV'
using revision 6f90a2bc6cf98fd970de6555791c4401d9fddb1d of repo '/home/jack/dev/infopt_PV'
evaluating derivation 'https://github.com/NixOS/nixpkgs/archive/release-24.11.tar.gz?narHash=sha256-kNf%2BobkpJZWar7HZymXZbW%2BRlk3HTEIMlpc6FCNz0Ds%3D#bashInteractive'...
warning: using or as an identifier is deprecated because it cannot be used in most places (try let or = 1; in or). Use --extra-deprecated-features or-as-identifier to disable this warning.
at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/lib/default.nix:88:9:
87| concat
88| or
| ^
89| and
warning: using or as an identifier is deprecated because it cannot be used in most places (try let or = 1; in or). Use --extra-deprecated-features or-as-identifier to disable this warning.
at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/lib/trivial.nix:183:3:
182| */
183| or = x: y: x || y;
| ^
184|
warning: using or as an identifier is deprecated because it cannot be used in most places (try let or = 1; in or). Use --extra-deprecated-features or-as-identifier to disable this warning.
at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/lib/options.nix:282:18:
281| else if all isBool list then
282| foldl' lib.or false list
| ^
283| else if all isString list then
$ cabal
bash: cabal: command not found
$ nix develop .#devShells.x86_64-linux.default -vv
evaluating derivation 'git+file:///home/jack/dev/infopt_PV#devShells.x86_64-linux.default'...
fetching git input 'git+file:///home/jack/dev/infopt_PV'
using revision 6f90a2bc6cf98fd970de6555791c4401d9fddb1d of repo '/home/jack/dev/infopt_PV'
warning: using or as an identifier is deprecated because it cannot be used in most places (try let or = 1; in or). Use --extra-deprecated-features or-as-identifier to disable this warning.
at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/lib/default.nix:88:9:
87| concat
88| or
| ^
89| and
warning: using or as an identifier is deprecated because it cannot be used in most places (try let or = 1; in or). Use --extra-deprecated-features or-as-identifier to disable this warning.
at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/lib/trivial.nix:183:3:
182| */
183| or = x: y: x || y;
| ^
184|
warning: using or as an identifier is deprecated because it cannot be used in most places (try let or = 1; in or). Use --extra-deprecated-features or-as-identifier to disable this warning.
at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/lib/options.nix:282:18:
281| else if all isBool list then
282| foldl' lib.or false list
| ^
283| else if all isString list then
warning: dynamic attributes are not allowed within recursive attrsets, because they would be evaluated separately from the other recursive attributes. Use --extra-deprecated-features rec-set-dynamic-attrs to disable this error.
at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/pkgs/development/compilers/ghc/9.2.4-binary.nix:238:3:
237| # the final install location.
238| ${libEnvVar} = libPath;
| ^
239|
warning: dynamic attributes are not allowed within recursive attrsets, because they would be evaluated separately from the other recursive attributes. Use --extra-deprecated-features rec-set-dynamic-attrs to disable this error.
at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/pkgs/by-name/p1/p11-kit/package.nix:70:3:
69|
70| ${
| ^
71| if stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isx86_64 then "mesonCheckFlags" else null
warning: dynamic attributes are not allowed within recursive attrsets, because they would be evaluated separately from the other recursive attributes. Use --extra-deprecated-features rec-set-dynamic-attrs to disable this error.
at /nix/store/g1wkcpwadmnn20lwbik5kfwnvfrc6ahi-source/pkgs/development/compilers/ghc/8.10.7-binary.nix:264:3:
263| # the final install location.
264| ${libEnvVar} = libPath;
| ^
265|
evaluating derivation 'https://github.com/NixOS/nixpkgs/archive/release-24.11.tar.gz?narHash=sha256-kNf%2BobkpJZWar7HZymXZbW%2BRlk3HTEIMlpc6FCNz0Ds%3D#bashInteractive'...
$ cabal
Error: cabal: no command given (try --help)
flake.nix
{
inputs = {
nixpkgs.url =
"https://github.com/NixOS/nixpkgs/archive/release-24.11.tar.gz";
};
outputs = { self, nixpkgs }:
let
name = "infopt_PV";
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
hpkgs = pkgs.haskell.packages.ghc925;
compiler = pkgs.haskell.compiler.ghc925;
in {
# nix fmt
formatter."${system}" = nixpkgs.legacyPackages."${system}".nixfmt;
packages."${system}" = {
# nix run
default = pkgs.lib.pipe (pkgs.haskell.packages.ghc925.callCabal2nix name
(pkgs.lib.cleanSource ./.) { })
[ pkgs.haskell.lib.compose.dontHaddock ];
# generated with nix run nixpkgs#cabal2nix https://github.com/wooshrow/gclparser
gclparser = hpkgs.mkDerivation {
pname = "GCLparser";
version = "0.2.1";
src = pkgs.fetchgit {
url = "https://github.com/wooshrow/gclparser/";
sha256 = "17fri8d4b0wlm5274b4ajk91ak4agz2rn3b5xwwzpaad3643gd98";
rev = "db1b784171bfe00bf226ff0491d01a074fdc373f";
fetchSubmodules = true;
};
libraryHaskellDepends = with hpkgs; [
array
base
containers
directory
optparse-applicative
pretty
];
libraryToolDepends = with hpkgs; [ alex happy ];
license = pkgs.lib.licenses.bsd3;
};
# nix shell
devShells."${system}".default = pkgs.mkShell {
strictDeps = true;
nativeBuildInputs = with pkgs;
[
(cabal-install.overrideAttrs { inherit compiler; })
compiler
haskell-language-server
# version 408.2, build with ghc 9.2.5
(haskellPackages.z3.overrideAttrs { inherit compiler; })
] ++ [ self.packages."${system}".gclparser ];
};
};
};
}
what’s going wrong here??