To try out fish, I copied verbatim from the wiki:
https://nixos.wiki/wiki/Fish
programs.fish.enable = true;
programs.fish.plugins = [
{
name = "z";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "z";
rev = "e0e1b9dfdba362f8ab1ae8c1afc7ccf62b89f7eb";
sha256 = "0dbnir6jbwjpjalz14snzd3cgdysgcs3raznsijd6savad3qhijc";
};
}
{ name = "grc"; src = pkgs.fishPlugins.grc.src; }
];
However, it fails on the grc plugin:
home-manager switch
error: attribute 'grc' missing
at /home/b0ef/.config/nixpkgs/home.nix:207:25:
206| }
207| { name = "grc"; src = pkgs.fishPlugins.grc.src; }
| ^
208| ];
(use '--show-trace' to show detailed location information)
It works fine if I remove that grc plugin
The grc plugin is part of nixpkgs so I expect this to work. You can check with:
$ nix repl '<nixpkgs>'
nix-repl> fishPlugins.grc.src
«derivation /nix/store/vpzp1a6l84mmnsbpkfii7qfki96v57qa-source.drv»
Can you maybe tell us the version of nixpkgs that you are using and how you defined the pkgs variable in your fish file?
Version of nixpkgs is 22.05. What do you mean with “how you defined the pkgs variable in your fish file”? I haven’t made a fish file. I just inserted that block of code into home.nix. Here is the home.nix file: { config, pkgs, ... }:letorgDesktopItem = pkgs.makeDesktopItem { na - Pastebin.com
22.05 is too old, if you check the history the plugin was added later History for pkgs/shells/fish/plugins/grc.nix - NixOS/nixpkgs · GitHub and it has not been backported (you can check it by going on the 22.05 branch in the appropriate folder)
But in any case it is not hard to upgrade (potentially partially) your channel or add it yourself, it should be just:
programs.fish.plugins = [
{
name = "grc";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "plugin-grc";
rev = "61de7a8a0d7bda3234f8703d6e07c671992eb079";
sha256 = "sha256-NQa12L0zlEz2EJjMDhWUhw5cz/zcFokjuCK5ZofTn+Q=";
};
}
]
home-manager switch
error: hash ‘61de7a8a0d7bda3234f8703d6e07c671992eb079’ has wrong length for hash type ‘sha256’
(use ‘–show-trace’ to show detailed location information)
I should use nix-prefetch to get this shasum?
Arg I copied the rev to the sha256 instead of the hash ^^ I edited my post. Otherwise yes nix-prefetch should work or you can just write sha256 = lib.fakeSha256;
(or sha256 = "";
on recent systems at least) and it should work and update the hash with the error you get the first time you compile.