add direnv and nixify shell function

This commit is contained in:
Dmitriy Holkin 2019-12-13 23:15:07 +04:00
parent caeea8a017
commit 7b0a6f338a
3 changed files with 27 additions and 0 deletions

View File

@ -18,6 +18,7 @@
./workspace/xresources.nix
./workspace/barrier.nix
./workspace/podman.nix
./workspace/direnv.nix
./themes.nix
./mullvad.nix
./applications.nix

View File

@ -0,0 +1,6 @@
{ pkgs, config, ... }: {
home-manager.users.alukard.programs.direnv = {
enable = true;
enableZshIntegration = true;
};
}

View File

@ -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 <nixpkgs> {} }:
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
}
'';
};
}