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:
nikp123 2023-06-09 22:32:11 +02:00 committed by GitHub
parent 2a69182c56
commit 0945875a2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 183 additions and 0 deletions

View file

@ -0,0 +1,4 @@
{
boxxy-empty-settings = ./empty-settings.nix;
boxxy-example-settings = ./example-settings.nix;
}

View 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
'';
};
}

View 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

View 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}
'';
};
}