1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-05 16:41:04 +01:00

numbat: Add initFile option

This commit is contained in:
Alex Hamilton 2025-06-28 17:20:34 -04:00 committed by Austin Horstman
parent d75a547415
commit 26d405da41
3 changed files with 24 additions and 0 deletions

View file

@ -38,11 +38,26 @@ in
<https://numbat.dev/doc/cli-customization.html#configuration> for options.
'';
};
initFile = lib.mkOption {
type = lib.types.nullOr lib.types.lines;
default = null;
example = ''
unit kohm: ElectricResistance = kV/A
'';
description = ''
User initialization file ({file}`init.nbt`) contents.
'';
};
};
config = mkIf cfg.enable {
home.packages = mkIf (cfg.package != null) [ cfg.package ];
home.file."${configDir}/init.nbt" = mkIf (cfg.initFile != null) {
text = cfg.initFile;
};
home.file."${configDir}/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "numbat-config" cfg.settings;
};