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