File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change 2323 system :
2424 let
2525 pkgs = nixpkgs . legacyPackages . ${ system } ;
26+
27+ # Load checks from checks/ directory
2628 checkFiles = builtins . readDir ./checks ;
2729 importCheck = name : {
2830 name = nixpkgs . lib . removeSuffix ".nix" name ;
3133 self = self ;
3234 } ;
3335 } ;
36+ checksFromDir = builtins . listToAttrs (
37+ map importCheck (
38+ builtins . filter ( name : nixpkgs . lib . hasSuffix ".nix" name ) ( builtins . attrNames checkFiles )
39+ )
40+ ) ;
41+
42+ # Load checks from modules/**/check.nix
43+ moduleFiles = builtins . readDir ./modules ;
44+ importModuleCheck =
45+ name : type :
46+ let
47+ checkPath = ./modules + "/${ name } /check.nix" ;
48+ in
49+ if type == "directory" && builtins . pathExists checkPath then
50+ {
51+ name = "module-${ name } " ;
52+ value = import checkPath {
53+ inherit pkgs ;
54+ self = self ;
55+ } ;
56+ }
57+ else
58+ null ;
59+ checksFromModules = builtins . listToAttrs (
60+ nixpkgs . lib . filter ( x : x != null ) ( nixpkgs . lib . mapAttrsToList importModuleCheck moduleFiles )
61+ ) ;
3462 in
35- builtins . listToAttrs (
36- map importCheck (
37- builtins . filter ( name : nixpkgs . lib . hasSuffix ".nix" name ) ( builtins . attrNames checkFiles )
38- )
39- )
63+ checksFromDir // checksFromModules
4064 ) ;
4165 } ;
4266}
Original file line number Diff line number Diff line change 11{ wlib , lib } :
22lib . mapAttrs' (
3- name : _ :
4- lib . nameValuePair ( lib . removeSuffix ".nix" name ) ( import ./modules/${ name } { inherit wlib lib ; } )
5- ) ( builtins . readDir ./modules )
3+ name : type : lib . nameValuePair name ( import ./modules/${ name } /module.nix { inherit wlib lib ; } )
4+ ) ( lib . filterAttrs ( _ : type : type == "directory" ) ( builtins . readDir ./modules ) )
Original file line number Diff line number Diff line change 1+ {
2+ pkgs ,
3+ self ,
4+ } :
5+
6+ let
7+ mpvWrapped = self . wrapperModules . mpv . apply {
8+ inherit pkgs ;
9+ "mpv.conf" . content = ''
10+ ao=null
11+ vo=null
12+ '' ;
13+ } ;
14+
15+ in
16+ pkgs . runCommand "mpv-test" { } ''
17+ "${ mpvWrapped } /bin/mpv" --version | grep -q "mpv"
18+ touch $out
19+ ''
File renamed without changes.
Original file line number Diff line number Diff line change 1+ {
2+ pkgs ,
3+ self ,
4+ } :
5+
6+ let
7+ notmuchWrapped = self . wrapperModules . notmuch . apply {
8+ inherit pkgs ;
9+ settings = {
10+ database . path = "/tmp/test-mail" ;
11+ } ;
12+ } ;
13+
14+ in
15+ pkgs . runCommand "notmuch-test" { } ''
16+ "${ notmuchWrapped } /bin/notmuch" --version | grep -q "notmuch"
17+ touch $out
18+ ''
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ wlib.wrapModule (
1111 in
1212 {
1313 options = {
14- config = lib . mkOption {
14+ settings = lib . mkOption {
1515 type = iniFmt . type ;
1616 default = {
1717 database = {
@@ -22,7 +22,7 @@ wlib.wrapModule (
2222 } ;
2323 configFile = lib . mkOption {
2424 type = wlib . types . file config . pkgs ;
25- default . path = toString ( writeNotmuchConfig config . config ) ;
25+ default . path = toString ( writeNotmuchConfig config . settings ) ;
2626 } ;
2727 } ;
2828 config . package = config . pkgs . notmuch ;
You can’t perform that action at this time.
0 commit comments