infat: add module
This commit is contained in:
parent
ab8e4b2b5a
commit
06f81463bb
5 changed files with 149 additions and 0 deletions
6
tests/modules/programs/infat/default.nix
Normal file
6
tests/modules/programs/infat/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin {
|
||||
infat-example-settings = ./example-settings.nix;
|
||||
infat-no-settings = ./no-settings.nix;
|
||||
}
|
||||
39
tests/modules/programs/infat/example-settings.nix
Normal file
39
tests/modules/programs/infat/example-settings.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.infat = {
|
||||
enable = true;
|
||||
settings = {
|
||||
extensions = {
|
||||
md = "TextEdit";
|
||||
};
|
||||
schemes = {
|
||||
web = "Safari";
|
||||
};
|
||||
types = {
|
||||
plain-text = "VSCode";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.infat = { };
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
expectedConfigPath = "home-files/.config/infat/config.toml";
|
||||
expectedConfigContent = pkgs.writeText "infat.config.expected" ''
|
||||
[extensions]
|
||||
md = "TextEdit"
|
||||
|
||||
[schemes]
|
||||
web = "Safari"
|
||||
|
||||
[types]
|
||||
plain-text = "VSCode"
|
||||
'';
|
||||
in
|
||||
''
|
||||
assertFileExists "${expectedConfigPath}"
|
||||
assertFileContent "${expectedConfigPath}" "${expectedConfigContent}"
|
||||
'';
|
||||
}
|
||||
13
tests/modules/programs/infat/no-settings.nix
Normal file
13
tests/modules/programs/infat/no-settings.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
programs.infat.enable = true;
|
||||
|
||||
test.stubs.infat = { };
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
expectedConfigPath = "home-files/.config/infat/config.toml";
|
||||
in
|
||||
''
|
||||
assertPathNotExists "${expectedConfigPath}"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue