diff --git a/features/dev/nix-direnv.nix b/features/dev/nix-direnv.nix new file mode 100644 index 0000000..89e1be6 --- /dev/null +++ b/features/dev/nix-direnv.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ + # https://github.com/nix-community/nix-direnv + environment.systemPackages = with pkgs; [ direnv nix-direnv ]; + # nix options for derivations to persist garbage collection + nix.extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; + environment.pathsToLink = [ + "/share/nix-direnv" + ]; + nixpkgs.overlays = [ + (self: super: { nix-direnv = super.nix-direnv.override { enableFlakes = true; }; }) + ]; + +} diff --git a/flake.nix b/flake.nix index 253b5d7..da26563 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,7 @@ ./features/caches ./features/current-location.nix ./features/passwordstore.nix + ./features/dev/nix-direnv.nix # home-manager configuration home-manager.nixosModules.home-manager