feat: add flake-friendly nix-index overlay

See: https://github.com/nix-community/nix-index/pull/227
This commit is contained in:
teutat3s 2023-12-04 12:34:44 +01:00
parent 1da6ee9126
commit 53f007f48a
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
4 changed files with 30 additions and 1 deletions

View file

@ -24,7 +24,7 @@ in {
PROMPT_COMMAND='echo -e -n "\e]2;$(basename "$PWD" | sed "s/${psCfg.user.name}/~/")\e\\"'
# If a command is not found, show me where it is
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
source ${pkgs.nix-index}/etc/profile.d/command-not-found.bash
# Helps you navigate directories faster
# https://github.com/gsamokovarov/jump

View file

@ -21,6 +21,10 @@ in {
config = {
programs.command-not-found.enable = false;
programs.nix-index.enable = true;
# We do this manually in modules/terminal-life/bash/default.nix
# until https://github.com/nix-community/nix-index/pull/227 is merged
programs.nix-index.enableBashIntegration = false;
users.users."${psCfg.user.name}".packages = with pkgs; [
ack

View file

@ -27,6 +27,7 @@
(import ../pkgs)
(import ./blesh.nix)
(import ./mdbook-multilang.nix inputs)
(import ./nix-index.nix)
(import ./prr.nix)
(import ./neovim-plugins.nix)
(import ./element-desktop.nix)

24
overlays/nix-index.nix Normal file
View file

@ -0,0 +1,24 @@
final: prev: {
nix-index-unwrapped = prev.nix-index-unwrapped.overrideAttrs (oldAttrs: rec {
inherit (oldAttrs) pname;
src = prev.fetchFromGitHub {
owner = "teutat3s";
repo = "nix-index";
rev = "e2d1917f474083f6d5a2c3368a6073f6427c19e4";
hash = "sha256-3nTphxyqI6Hci7yJ2bKLcgdRl2qOY3BzUqoIl1YmmsA=";
};
version = "unstable-2023-11-25";
cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const {
name = "${pname}-vendor.tar.gz";
inherit src;
outputHash = "sha256-x4oejbS1/L3WkN2S6PzvJni9UasRTP3TVVp3Ur9ge8U=";
});
postInstall = ''
substituteInPlace etc/command-not-found.* \
--subst-var out
install -Dm444 etc/command-not-found.* -t $out/etc/profile.d
'';
});
}