boxxy: add module (#4075)
* boxxy: add module * boxxy: added nikp123 to maintainers list * boxxy: use mkPackageOption instead for the package Co-authored-by: Naïm Favier <n@monade.li> * boxxy: use yaml generator instead of json Co-authored-by: Naïm Favier <n@monade.li> * boxxy: various fixes * boxxy: various fixes (part 2) * boxxy: various fixes (part 3) * boxxy: various fixes (part 4) forgot to run ./format, whoops * boxxy: use literalExpression for the rewrite example Co-authored-by: Naïm Favier <n@monade.li> * boxxy: add news entry --------- Co-authored-by: Naïm Favier <n@monade.li>
This commit is contained in:
parent
2a69182c56
commit
0945875a2a
9 changed files with 183 additions and 0 deletions
4
tests/modules/programs/boxxy/default.nix
Normal file
4
tests/modules/programs/boxxy/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
boxxy-empty-settings = ./empty-settings.nix;
|
||||
boxxy-example-settings = ./example-settings.nix;
|
||||
}
|
||||
15
tests/modules/programs/boxxy/empty-settings.nix
Normal file
15
tests/modules/programs/boxxy/empty-settings.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.boxxy.enable = true;
|
||||
|
||||
test.stubs.boxxy = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/boxxy
|
||||
'';
|
||||
};
|
||||
}
|
||||
12
tests/modules/programs/boxxy/example-boxxy.yaml
Normal file
12
tests/modules/programs/boxxy/example-boxxy.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
rules:
|
||||
- context:
|
||||
- /home/test_user/your_project_repo
|
||||
env:
|
||||
ENVIRONMENT_THING: some value
|
||||
mode: directory
|
||||
name: example rule
|
||||
only:
|
||||
- arduino
|
||||
- Arduino
|
||||
rewrite: ~/.local/share/boxxy
|
||||
target: ~/Arduino
|
||||
26
tests/modules/programs/boxxy/example-settings.nix
Normal file
26
tests/modules/programs/boxxy/example-settings.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.boxxy.enable = true;
|
||||
programs.boxxy.rules = [{
|
||||
name = "example rule";
|
||||
target = "~/Arduino";
|
||||
rewrite = "~/.local/share/boxxy";
|
||||
mode = "directory";
|
||||
only = [ "arduino" "Arduino" ];
|
||||
env = { "ENVIRONMENT_THING" = "some value"; };
|
||||
context = [ "/home/test_user/your_project_repo" ];
|
||||
}];
|
||||
|
||||
test.stubs.boxxy = { };
|
||||
|
||||
nmt.script = ''
|
||||
boxxyyaml=home-files/.config/boxxy/boxxy.yaml
|
||||
assertFileExists $boxxyyaml
|
||||
assertFileContent $boxxyyaml ${./example-boxxy.yaml}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue