Enable nix-direnv integration to cache direnv builds

This commit is contained in:
Evie Litherland-Smith 2023-05-31 11:18:45 +01:00
parent f2c490e3ca
commit 825c809fa0
7 changed files with 16 additions and 2 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use nix

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
.python-version
.DS_Store
__pycache__
.direnv

View file

@ -1,4 +1,6 @@
.git*
.pre-commit-config.yaml
.stylua.toml
.envrc
./shell.nix
Makefile

View file

@ -39,7 +39,7 @@ waybar: $(CONFIG_DIR)/waybar
command -v nix > /dev/null || echo "Install nix package manager before continuing"; exit 1
/etc/nixos/config:
sudo rsync -avz --exclude-from=.rsyncignore --delete-during --delete-excluded ./ $@
sudo rsync -avz --exclude-from=.rsyncignore --filter=':- .gitignore' --delete-during --delete-excluded ./ $@
$(HOMEMANAGER_CONFIG_DIR)/home.nix: $(HOMEMANAGER_CONFIG_DIR) /nix
[ -f $(HOMEMANAGER_CONFIG) ] || touch $(HOMEMANAGER_CONFIG)

View file

@ -45,4 +45,9 @@
dates = "daily";
options = "--delete-older-than 7d";
};
nix.extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
}

5
home/env/direnv.nix vendored
View file

@ -1,3 +1,6 @@
{...}: {
programs.direnv.enable = true;
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

2
shell.nix Normal file
View file

@ -0,0 +1,2 @@
{pkgs ? import <nixpkgs> {}, ...}:
pkgs.mkShell {buildInputs = with pkgs; [gnumake pre-commit];}