I’ve run into a couple of problems using flakes and need a bit of help.
I’ve created the following simple flake for dotnet development that includes packages from both the stable 22.11 and unstable channels.
{
description = "My JetBrians Rider + dotnet 7.x Devenv";
inputs = {
nixpkgs.url = "nixpkgs/nixos-21.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, nixpkgs-unstable, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
unstable_pkgs = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
in rec {
devShell = pkgs.mkShell {
packages = with pkgs; [
unstable_pkgs.jetbrains.rider
unstable_pkgs.dotnet-sdk_7
nodejs
yarn
nss
];
shellHook = ''
echo "Devenv initialized"
'';
};
});
}
Problem #1
With respect to the nodejs
package; if I load this package via /etc/nixos/configuration.nix
from the 22.11 stable channel, I get one version, while if I load the same package from my flake 22.11 stable channel I get another version.
/etc/nixos/configuration.nix: nodejs --> v18.14.1
flake.nix: nodejs --> v14.19.3
Why? In both cases, I believe that I’m referencing the 22.11 stable channels. Searching nixos packages, I don’t see nodejs
version 14.19.3 in either the 22.11 stable or unstable channels.
Problem #2
With respect to the nss
package, which includes a number of utilities such as ‘certutil’ that I need, whether I add this package in /etc/nixos/configuration.nix
or my flake.nix
– the package (utilities) never seem to get loaded.
$ certutil
The program 'certutil' is not in your PATH. It is provided by several packages.
You can make it available in an ephemeral shell by typing one of the following:
nix-shell -p nss
nix-shell -p nss_latest
Running nix-locate ‘/bin/certutil’ I see the results below, however, if I simply try to list these directories, neither of them exists.
nss_latest.tools 220,904 x /nix/store/zjzsnpb607hs6pscc8ssr1ad6kls6msr-nss-3.89-tools/bin/certutil
nss.tools 220,904 x /nix/store/damycn7l0k8qcn0mjyfpfp5pkbkh2g2n-nss-3.79.4-tools/bin/certutil
Thoughts? I suspect I’m overlooking something quite simple.