summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home-manager/zsh.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-03-23 10:15:42 +0100
committerlassulus <lassulus@lassul.us>2020-03-23 10:15:42 +0100
commit8c27f12f86096f06e56333125eb6c713aece34ed (patch)
tree83d29ab23719468ff6e8d31f29963dd449edbef2 /makefu/2configs/home-manager/zsh.nix
parentcab3be8a19d445d3292454099dbc1ca97bca60c5 (diff)
parent8e3cd9fcffc473706a3ebafa5cb80f7a75c29aa5 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/home-manager/zsh.nix')
-rw-r--r--makefu/2configs/home-manager/zsh.nix61
1 files changed, 2 insertions, 59 deletions
diff --git a/makefu/2configs/home-manager/zsh.nix b/makefu/2configs/home-manager/zsh.nix
index d24969ef0..4cd9becc7 100644
--- a/makefu/2configs/home-manager/zsh.nix
+++ b/makefu/2configs/home-manager/zsh.nix
@@ -2,65 +2,8 @@
{
imports = [
{ #direnv
- home-manager.users.makefu.home.packages = [ pkgs.direnv ];
- home-manager.users.makefu.home.file.".direnvrc".text = ''
- use_nix() {
- local path="$(nix-instantiate --find-file nixpkgs)"
-
- if [ -f "$${path}/.version-suffix" ]; then
- local version="$(< $path/.version-suffix)"
- elif [ -f "$path/.version" ]; then
- local version="$(< $path/.version)"
- else
- local version="$(< $(< $path/.git/HEAD))"
- fi
-
- local cache=".direnv/cache-''${version:-unknown}"
-
- if [[ ! -e "$cache" ]] || \
- [[ "$HOME/.direnvrc" -nt "$cache" ]] || \
- [[ .envrc -nt "$cache" ]] || \
- [[ default.nix -nt "$cache" ]] || \
- [[ shell.nix -nt "$cache" ]];
- then
- [ -d .direnv ] || mkdir .direnv
- local tmp=$(nix-shell --show-trace "$@" \
- --run "\"$direnv\" dump zsh")
- echo "$tmp" > "$cache"
- fi
-
- local path_backup=$PATH term_backup=$TERM
- . "$cache"
-
- export PATH=$PATH:$path_backup TERM=$term_backup
-
- if [[ $# = 0 ]]; then
- watch_file default.nix
- watch_file shell.nix
- fi
- }
- '';
- home-manager.users.makefu.programs.zsh.initExtra = ''
- nixify() {
- if [ ! -e ./.envrc ]; then
- echo "use nix" > .envrc
- direnv allow
- fi
- if [ ! -e default.nix ]; then
- cat > default.nix <<'EOF'
- with import <nixpkgs> {};
- stdenv.mkDerivation {
- name = "env";
- buildInputs = [
- bashInteractive
- ];
- }
- EOF
- ''${EDITOR:-vim} default.nix
- fi
- }
- eval "$(direnv hook zsh)"
- '';
+ home-manager.users.makefu.home.packages = [ pkgs.direnv pkgs.nur.repos.kalbasit.nixify ];
+ # home-manager.users.makefu.home.file.".direnvrc".text = '''';
}
{ # bat
home-manager.users.makefu.home.packages = [ pkgs.bat ];