mirror of
https://github.com/nix-community/home-manager
synced 2025-01-11 19:49:49 +01:00
parent
face4094d4
commit
ef990143b6
1 changed files with 8 additions and 4 deletions
|
@ -58,7 +58,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
configFile = mkOption {
|
configFile = mkOption {
|
||||||
type = linesOrSource "config.nu";
|
type = types.nullOr (linesOrSource "config.nu");
|
||||||
|
default = null;
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
{ text = '''
|
{ text = '''
|
||||||
let $config = {
|
let $config = {
|
||||||
|
@ -78,7 +79,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
envFile = mkOption {
|
envFile = mkOption {
|
||||||
type = linesOrSource "env.nu";
|
type = types.nullOr (linesOrSource "env.nu");
|
||||||
|
default = null;
|
||||||
example = ''
|
example = ''
|
||||||
let-env FOO = 'BAR'
|
let-env FOO = 'BAR'
|
||||||
'';
|
'';
|
||||||
|
@ -94,7 +96,9 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile."nushell/config.nu" = cfg.configFile;
|
xdg.configFile = mkMerge [
|
||||||
xdg.configFile."nushell/env.nu" = cfg.envFile;
|
(mkIf (cfg.configFile != null) { "nushell/config.nu" = cfg.configFile; })
|
||||||
|
(mkIf (cfg.envFile != null) { "nushell/env.nu" = cfg.envFile; })
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue