Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell
Last active September 8, 2020 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlacewell/33d6fad4fb3d4e7e934cf891cd46f9be to your computer and use it in GitHub Desktop.
Save dustinlacewell/33d6fad4fb3d4e7e934cf891cd46f9be to your computer and use it in GitHub Desktop.
Test Gist #test-tag
these derivations will be built:
/nix/store/fs123hb5j7rwdpvvqz4x2lpcqfnyfwlq-ranger-cd.drv
/nix/store/s1q6lpsbk500xipn7q76gv1khmvrgmkq-home_file_.configzsh.zshrc.drv
/nix/store/lgbqiimga3c578319187118br22q48d2-home-manager-files.drv
/nix/store/qf2w3f96g9h9iwcj75j7m5k8wf4nqclr-home-manager-generation.drv
building '/nix/store/fs123hb5j7rwdpvvqz4x2lpcqfnyfwlq-ranger-cd.drv'...
substitute(): ERROR: file '/nix/store/d28rxp10fnqn7kdppmfk440iarfas0k7-ranger-cd' does not exist
builder for '/nix/store/fs123hb5j7rwdpvvqz4x2lpcqfnyfwlq-ranger-cd.drv' failed with exit code 1
cannot build derivation '/nix/store/s1q6lpsbk500xipn7q76gv1khmvrgmkq-home_file_.configzsh.zshrc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/lgbqiimga3c578319187118br22q48d2-home-manager-files.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/qf2w3f96g9h9iwcj75j7m5k8wf4nqclr-home-manager-generation.drv': 1 dependencies couldn't be built
error: build of '/nix/store/qf2w3f96g9h9iwcj75j7m5k8wf4nqclr-home-manager-generation.drv' failed
There are 20 unread and relevant news items.
Read them by running the command 'home-manager news'.
{ pkgs }:
let
name = "ranger-cd";
infile = ./ranger-cd.zsh;
search = "/usr/bin/ranger";
replace = "${pkgs.ranger}/bin/ranger";
cmd = "substitute ${infile} $out --replace ${search} ${replace}";
in pkgs.runCommand name {} cmd
function ranger-cd {
tempfile="$(mktemp -t tmp.XXXXXX)"
/usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
cd "$(cat "$tempfile")"
fi
rm -f "$tempfile"
}
{ pkgs, ... }:
let
ranger-cd = (import ./ranger-cd.nix) { inherit pkgs; };
in {
home.packages = [
pkgs.nano
];
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
history.size = 100000;
enableAutosuggestions = true;
enableCompletion = true;
shellAliases = import ./aliases.nix;
initExtra = ". ${ranger-cd} \n ${builtins.readFile ./initExtras} ";
sessionVariables = {
EDITOR="nano";
PATH="$HOME/bin:/usr/local/bin:$PATH:$HOME/src/nix-virtualenv/bin";
};
oh-my-zsh = {
enable = true;
theme = "agnoster";
plugins = [ "common-aliases" "shink-path" ];
};
plugins = [
{
# will source zsh-autosuggestions.plugin.zsh
name = "zsh-autosuggestions";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autosuggestions";
rev = "v0.4.0";
sha256 = "0z6i9wjjklb4lvr7zjhbphibsyx51psv50gm07mbb0kj9058j6kc";
};
}
{
name = "enhancd";
file = "init.sh";
src = pkgs.fetchFromGitHub {
owner = "b4b4r07";
repo = "enhancd";
rev = "v2.2.1";
sha256 = "0iqa9j09fwm6nj5rpip87x3hnvbbz9w9ajgm6wkrd5fls8fn8i5g";
};
}
];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment