numbat: Allow specifying a path for initFile
This commit is contained in:
parent
26d405da41
commit
f117b383dd
4 changed files with 33 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
numbat-example-config = ./example-config.nix;
|
||||
numbat-empty-config = ./empty-config.nix;
|
||||
numbat-external-initfile = ./external-initfile.nix;
|
||||
}
|
||||
|
|
|
|||
27
tests/modules/programs/numbat/external-initfile.nix
Normal file
27
tests/modules/programs/numbat/external-initfile.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
"Library/Application Support/numbat"
|
||||
else
|
||||
".config/numbat";
|
||||
in
|
||||
{
|
||||
programs.numbat = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
initFile = ./init.nbt;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists 'home-files/${configDir}/init.nbt'
|
||||
assertFileContent $(normalizeStorePaths 'home-files/${configDir}/init.nbt') \
|
||||
${builtins.toFile "expected-init.nbt" ''
|
||||
unit kohm: ElectricResistance = kV/A
|
||||
''}
|
||||
'';
|
||||
}
|
||||
1
tests/modules/programs/numbat/init.nbt
Normal file
1
tests/modules/programs/numbat/init.nbt
Normal file
|
|
@ -0,0 +1 @@
|
|||
unit kohm: ElectricResistance = kV/A
|
||||
Loading…
Add table
Add a link
Reference in a new issue