Skip to content

Commit b4ecb1f

Browse files
committed
modules/kanshi: init
1 parent 3c61eca commit b4ecb1f

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

modules/kanshi/check.nix

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
pkgs,
3+
self,
4+
}:
5+
6+
let
7+
kanshiWrapped =
8+
(self.wrapperModules.kanshi.apply {
9+
inherit pkgs;
10+
11+
configFile.content = ''
12+
profile {
13+
output eDP-1 enable scale 2
14+
}
15+
'';
16+
17+
}).wrapper;
18+
19+
in
20+
pkgs.runCommand "kanshi-test" { } ''
21+
22+
"${kanshiWrapped}/bin/kanshi" --help 2>&1 | grep -q "config"
23+
24+
touch $out
25+
''

modules/kanshi/module.nix

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
config,
3+
lib,
4+
wlib,
5+
...
6+
}:
7+
{
8+
_class = "wrapper";
9+
options = {
10+
configFile = lib.mkOption {
11+
type = wlib.types.file config.pkgs;
12+
default.content = "";
13+
description = ''
14+
Kanshi configuration file.
15+
See {manpage}`kanshi(5)` for the configuration format.
16+
'';
17+
example = ''
18+
profile {
19+
output LVDS-1 disable
20+
output "Some Company ASDF 4242" mode 1600x900 position 0,0
21+
}
22+
23+
profile nomad {
24+
output LVDS-1 enable scale 2
25+
}
26+
'';
27+
};
28+
};
29+
config.flags = {
30+
"--config" = "${config.configFile.path}";
31+
};
32+
config.package = config.pkgs.kanshi;
33+
config.meta.maintainers = [ lib.maintainers.adeci ];
34+
config.meta.platforms = lib.platforms.linux;
35+
}

0 commit comments

Comments
 (0)