Skip to content

Commit

Permalink
add specialArg and test
Browse files Browse the repository at this point in the history
closes #10
  • Loading branch information
viperML committed Nov 6, 2023
1 parent 34316bc commit 2ce0163
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions doc/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ https://github.com/viperML/wrapper-manager/issues

## Changelog

- 2023-11-06
- Users can now pass their own `specialArgs`

- 2023-10-05
- Changed wrapper.name.env to be an attrset instead
- Added the ability to unset a variable with wrapper.name.env.unset
Expand Down
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
(self.lib {
inherit pkgs;
modules = [./tests/test-module.nix];
specialArgs = {
some-special-arg = "foo";
};
})
.config
.build
Expand Down
6 changes: 2 additions & 4 deletions lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
eval = {
pkgs,
modules ? [],
specialArgs ? {},
}:
lib.evalModules {
modules =
[
./modules
{
_module.args.pkgs = pkgs;
}
]
++ modules;
specialArgs = {};
specialArgs = {inherit pkgs;} // specialArgs;
};
in {
__functor = _: eval;
Expand Down
7 changes: 5 additions & 2 deletions tests/test-module.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{
pkgs,
lib,
some-special-arg,
...
}: {
wrappers.hello = {
env.FOO.value = "foo";
env.BAR.value = "bar";
basePackage = pkgs.hello;
flags = [
"-g Greetings"
"-g"
some-special-arg
];
};

wrappers.neofetch = {
basePackage = pkgs.neofetch.override {x11Support = false;};
flags = [
"--ascii_distro guix"
"--ascii_distro"
"guix"
];
renames = {
"neofetch" = "neofetch2";
Expand Down

0 comments on commit 2ce0163

Please sign in to comment.