nixos/kanata: check the config file at build time
Before this patch, checking the config file is done at runtime. Doing so at build time shortens the feedback loop[1][2]. [1]: https://github.com/NixOS/nixpkgs/issues/278135 [2]: https://github.com/jtroo/kanata/issues/689
This commit is contained in:
parent
ed7d332850
commit
1d93534ec4
1 changed files with 13 additions and 7 deletions
|
@ -86,14 +86,20 @@ let
|
|||
in
|
||||
optionalString ((length devices) > 0) "linux-dev (${devicesString})";
|
||||
|
||||
mkConfig = name: keyboard: pkgs.writeText "${mkName name}-config.kdb" ''
|
||||
(defcfg
|
||||
${keyboard.extraDefCfg}
|
||||
${mkDevices keyboard.devices}
|
||||
linux-continue-if-no-devs-found yes)
|
||||
mkConfig = name: keyboard: pkgs.writeTextFile {
|
||||
name = "${mkName name}-config.kdb";
|
||||
text = ''
|
||||
(defcfg
|
||||
${keyboard.extraDefCfg}
|
||||
${mkDevices keyboard.devices}
|
||||
linux-continue-if-no-devs-found yes)
|
||||
|
||||
${keyboard.config}
|
||||
'';
|
||||
${keyboard.config}
|
||||
'';
|
||||
checkPhase = ''
|
||||
${getExe cfg.package} --cfg "$target" --check --debug
|
||||
'';
|
||||
};
|
||||
|
||||
mkService = name: keyboard: nameValuePair (mkName name) {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
|
Loading…
Reference in a new issue