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:
parent
d75a547415
commit
26d405da41
3 changed files with 24 additions and 0 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue