diff --git a/modules/default.nix b/modules/default.nix index aa3e291..3ce2438 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -18,6 +18,7 @@ ./workspace/xresources.nix ./workspace/barrier.nix ./workspace/podman.nix + ./workspace/direnv.nix ./themes.nix ./mullvad.nix ./applications.nix diff --git a/modules/workspace/direnv.nix b/modules/workspace/direnv.nix new file mode 100644 index 0000000..e446285 --- /dev/null +++ b/modules/workspace/direnv.nix @@ -0,0 +1,6 @@ +{ pkgs, config, ... }: { + home-manager.users.alukard.programs.direnv = { + enable = true; + enableZshIntegration = true; + }; +} \ No newline at end of file diff --git a/modules/workspace/zsh.nix b/modules/workspace/zsh.nix index cd0a89a..02eaef6 100644 --- a/modules/workspace/zsh.nix +++ b/modules/workspace/zsh.nix @@ -52,5 +52,25 @@ "wgup" = "_ systemctl start wg-quick-wg0.service"; "wgdown" = "_ systemctl stop wg-quick-wg0.service"; }; + initExtra = '' + nixify() { + if [ ! -e ./.envrc ]; then + wget -O ./.envrc https://raw.githubusercontent.com/kalbasit/nur-packages/master/pkgs/nixify/envrc + sed -i '$s/use_nix.\+/use_nix/' ./.envrc + direnv allow + fi + if [ ! -e shell.nix ]; then + cat > shell.nix <<'EOF' + { pkgs ? import {} }: + pkgs.mkShell { + # Hack to SSL Cert error + GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt; + SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt; + buildInputs = []; + } + EOF + fi + } + ''; }; }