diff options
| author | Martin Fischer <martin@push-f.com> | 2025-10-31 07:10:25 +0100 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2025-11-17 07:41:47 +0100 |
| commit | ae1ba47a679903e6a1b98a5b1e00f65e32b082a3 (patch) | |
| tree | af310a989b68c4a6d7b92f70c5352a030ff370dc | |
| parent | ad2889e6d62c64d133c1147f247f761b13d6d374 (diff) | |
| -rw-r--r-- | nixos/profiles/workstation/default.nix | 2 | ||||
| -rw-r--r-- | nixos/profiles/workstation/dev.nix | 4 | ||||
| -rw-r--r-- | user/direnv/direnv.toml | 4 | ||||
| -rw-r--r-- | user/direnv/direnvrc | 12 | ||||
| -rw-r--r-- | user/zsh/zshrc-workstation.sh | 2 |
5 files changed, 23 insertions, 1 deletions
diff --git a/nixos/profiles/workstation/default.nix b/nixos/profiles/workstation/default.nix index 9df5328..2fb983a 100644 --- a/nixos/profiles/workstation/default.nix +++ b/nixos/profiles/workstation/default.nix @@ -57,6 +57,8 @@ in MYNIX_PROFILE = "workstation"; }; + nix.settings.experimental-features = ["nix-command" "flakes"]; + # Age defaults to this anyway when openssh is enabled. # We're setting this here for workstations where openssh is disabled. age.identityPaths = ["/etc/ssh/ssh_host_ed25519_key"]; diff --git a/nixos/profiles/workstation/dev.nix b/nixos/profiles/workstation/dev.nix index a40d574..262c55e 100644 --- a/nixos/profiles/workstation/dev.nix +++ b/nixos/profiles/workstation/dev.nix @@ -4,10 +4,12 @@ environment.systemPackages = with pkgs; [ rustup go - golangci-lint python313 nodejs_22 + direnv + nix-direnv + # CLI tools skim docker-compose diff --git a/user/direnv/direnv.toml b/user/direnv/direnv.toml new file mode 100644 index 0000000..1573479 --- /dev/null +++ b/user/direnv/direnv.toml @@ -0,0 +1,4 @@ +[global] +# direnv by default prints which environment variables are being exported +# Since nix-direnv sets quite a lot I'm filtering this out. +log_filter = "^(un)?loading" diff --git a/user/direnv/direnvrc b/user/direnv/direnvrc new file mode 100644 index 0000000..f64197b --- /dev/null +++ b/user/direnv/direnvrc @@ -0,0 +1,12 @@ +# direnv by default puts its cache in .direnv/ next to the .envrc. +# I rather have my caches in ~/.cache. +: "${XDG_CACHE_HOME:="${HOME}/.cache"}" +declare -A direnv_layout_dirs +direnv_layout_dir() { + local hash path + echo "${direnv_layout_dirs[$PWD]:=$( + hash="$(sha1sum - <<< "$PWD" | head -c40)" + path="${PWD//[^a-zA-Z0-9]/-}" + echo "${XDG_CACHE_HOME}/direnv/layouts/${hash}${path}" + )}" +} diff --git a/user/zsh/zshrc-workstation.sh b/user/zsh/zshrc-workstation.sh index 9a255a7..b7458b0 100644 --- a/user/zsh/zshrc-workstation.sh +++ b/user/zsh/zshrc-workstation.sh @@ -17,6 +17,8 @@ path+=$CARGO_HOME/bin path+=$GOPATH/bin path+=$NPM_CONFIG_PREFIX/bin +eval "$(direnv hook zsh)" + function ssh() { # In my ~/.ssh/config I configure host-specific background colors, for example: # |
