diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..1d953f4b --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/.gitignore b/.gitignore index 80249fc6..6ab41ba4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .python-version .DS_Store __pycache__ +.direnv diff --git a/.rsyncignore b/.rsyncignore index c806e2f8..5466af14 100644 --- a/.rsyncignore +++ b/.rsyncignore @@ -1,4 +1,6 @@ .git* .pre-commit-config.yaml .stylua.toml +.envrc +./shell.nix Makefile diff --git a/Makefile b/Makefile index 65836209..a1782220 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/common.nix b/common.nix index 2d4e79c4..71c35195 100644 --- a/common.nix +++ b/common.nix @@ -45,4 +45,9 @@ dates = "daily"; options = "--delete-older-than 7d"; }; + + nix.extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; } diff --git a/home/env/direnv.nix b/home/env/direnv.nix index dd836e9c..3a7b8add 100644 --- a/home/env/direnv.nix +++ b/home/env/direnv.nix @@ -1,3 +1,6 @@ {...}: { - programs.direnv.enable = true; + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; } diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..0e8a0e98 --- /dev/null +++ b/shell.nix @@ -0,0 +1,2 @@ +{pkgs ? import {}, ...}: +pkgs.mkShell {buildInputs = with pkgs; [gnumake pre-commit];}