2023-11-14 22:32:04 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2023-11-22 18:31:56 +01:00
|
|
|
cfg = config.sisyphus.programs.direnv;
|
2023-11-14 22:32:04 +01:00
|
|
|
in {
|
|
|
|
options.sisyphus.programs.direnv.enable = lib.mkEnableOption "direnv";
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
programs.direnv = {
|
|
|
|
enable = true;
|
|
|
|
nix-direnv.enable = true; # Use nix-specific direnv.
|
|
|
|
persistDerivations = true; # Sets the extraOptions listed below.
|
|
|
|
};
|
|
|
|
|
|
|
|
# This is also done by setting programs.direnv.persistDerivations.
|
|
|
|
# Keep derivations so shells don't break.
|
2023-11-22 18:31:56 +01:00
|
|
|
nix.extraOptions = ''
|
2023-11-14 22:32:04 +01:00
|
|
|
keep-outputs = true
|
|
|
|
keep-derivations = true
|
|
|
|
'';
|
|
|
|
};
|
2023-11-22 18:31:56 +01:00
|
|
|
}
|