mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
nixos/direnv: format with nixfmt
This commit is contained in:
parent
9cb99744c3
commit
b99fff4723
@ -3,9 +3,11 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.direnv;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.programs.direnv = {
|
||||
|
||||
enable = lib.mkEnableOption ''
|
||||
@ -14,7 +16,7 @@ in {
|
||||
integration. Note that you need to logout and login for this change to apply
|
||||
'';
|
||||
|
||||
package = lib.mkPackageOption pkgs "direnv" {};
|
||||
package = lib.mkPackageOption pkgs "direnv" { };
|
||||
|
||||
direnvrcExtra = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
@ -61,7 +63,11 @@ in {
|
||||
};
|
||||
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule ["programs" "direnv" "persistDerivations"] "persistDerivations was removed as it is no longer necessary")
|
||||
(lib.mkRemovedOptionModule [
|
||||
"programs"
|
||||
"direnv"
|
||||
"persistDerivations"
|
||||
] "persistDerivations was removed as it is no longer necessary")
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
@ -91,17 +97,19 @@ in {
|
||||
|
||||
environment = {
|
||||
systemPackages =
|
||||
if cfg.loadInNixShell then [cfg.package]
|
||||
else [
|
||||
#direnv has a fish library which sources direnv for some reason
|
||||
(cfg.package.overrideAttrs (old: {
|
||||
installPhase =
|
||||
(old.installPhase or "")
|
||||
+ ''
|
||||
rm -rf $out/share/fish
|
||||
'';
|
||||
}))
|
||||
];
|
||||
if cfg.loadInNixShell then
|
||||
[ cfg.package ]
|
||||
else
|
||||
[
|
||||
#direnv has a fish library which sources direnv for some reason
|
||||
(cfg.package.overrideAttrs (old: {
|
||||
installPhase =
|
||||
(old.installPhase or "")
|
||||
+ ''
|
||||
rm -rf $out/share/fish
|
||||
'';
|
||||
}))
|
||||
];
|
||||
|
||||
variables = {
|
||||
DIRENV_CONFIG = "/etc/direnv";
|
||||
|
Loading…
Reference in New Issue
Block a user