diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index ad4c49934..9974a28fb 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -15,8 +15,6 @@ in { "direnv" "enableNixDirenvIntegration" ] [ "programs" "direnv" "nix-direnv" "enable" ]) - (mkRemovedOptionModule [ "programs" "direnv" "nix-direnv" "enableFlakes" ] - "Flake support is now always enabled.") ]; meta.maintainers = [ maintainers.rycee ]; @@ -81,6 +79,7 @@ in { nix-direnv, a fast, persistent use_nix implementation for direnv''; + enableFlakes = mkEnableOption "Flake support in nix-direnv"; }; }; @@ -93,9 +92,11 @@ in { }; xdg.configFile."direnv/direnvrc" = let + package = + pkgs.nix-direnv.override { inherit (cfg.nix-direnv) enableFlakes; }; text = concatStringsSep "\n" (optional (cfg.stdlib != "") cfg.stdlib ++ optional cfg.nix-direnv.enable - "source ${pkgs.nix-direnv}/share/nix-direnv/direnvrc"); + "source ${package}/share/nix-direnv/direnvrc"); in mkIf (text != "") { inherit text; }; programs.bash.initExtra = mkIf cfg.enableBashIntegration (