Skip to content

Commit dd5bebe

Browse files
authored
chore(nix): make HM settings optional (#67)
Default settings to null and only write the config file when provided.
1 parent c01dbef commit dd5bebe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

flake.nix

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
};
6767

6868
settings = lib.mkOption {
69-
type = lib.types.attrs;
70-
default = { };
69+
type = lib.types.nullOr lib.types.attrs;
70+
default = null;
7171
description = "Configuration to put in `~/.paneru.toml`.";
7272
example = {
7373
options = {
@@ -124,12 +124,12 @@
124124
};
125125
};
126126

127-
xdg.configFile."paneru/paneru.toml" = lib.mkIf (config.xdg.enable) {
128-
source = tomlFormat.generate "paneru.toml" config.services.paneru.settings;
127+
xdg.configFile."paneru/paneru.toml" = lib.mkIf (config.xdg.enable && cfg.settings != null) {
128+
source = tomlFormat.generate "paneru.toml" cfg.settings;
129129
};
130130

131-
home.file.".paneru.toml" = lib.mkIf (!config.xdg.enable) {
132-
source = tomlFormat.generate ".paneru.toml" config.services.paneru.settings;
131+
home.file.".paneru.toml" = lib.mkIf (!config.xdg.enable && cfg.settings != null) {
132+
source = tomlFormat.generate ".paneru.toml" cfg.settings;
133133
};
134134
};
135135
};

0 commit comments

Comments
 (0)