1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-02 21:13:33 +02:00

nushell: fix non-nullable configFile and envFile, fixes #3050 (#3060)

This commit is contained in:
Philipp Mildenberger 2022-07-07 08:49:50 +02:00 committed by GitHub
parent face4094d4
commit ef990143b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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; })
];
};
}