diff options
author | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2024-05-07 09:59:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 09:59:18 +0200 |
commit | 9f3f54936029a69e7324341f30ec1b5772f709e4 (patch) | |
tree | 62055dea69518bcf5aa018d5fbafe34af84598fe | |
parent | fa4bb2cdd20012e1484691d9cbc527f8bc330e0e (diff) | |
parent | 1d93534ec437450ac9a7afdfadfb603b2c3be512 (diff) |
Merge pull request #309550 from linj-fork/pr/kanata-check-config-at-build-time
nixos/kanata: check the config file at build time
-rw-r--r-- | nixos/modules/services/hardware/kanata.nix | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/nixos/modules/services/hardware/kanata.nix b/nixos/modules/services/hardware/kanata.nix index c7e0e93baf6e4..46af3e36b9859 100644 --- a/nixos/modules/services/hardware/kanata.nix +++ b/nixos/modules/services/hardware/kanata.nix @@ -75,14 +75,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) - - ${keyboard.config} - ''; + 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} + ''; + checkPhase = '' + ${getExe cfg.package} --cfg "$target" --check --debug + ''; + }; mkService = name: keyboard: nameValuePair (mkName name) { wantedBy = [ "multi-user.target" ]; |