Merge pull request #309550 from linj-fork/pr/kanata-check-config-at-build-time

nixos/kanata: check the config file at build time
This commit is contained in:
Pol Dellaiera 2024-05-07 09:59:18 +02:00 committed by GitHub
commit 9f3f549360
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,7 +75,9 @@ let
in
optionalString ((length devices) > 0) "linux-dev (${devicesString})";
mkConfig = name: keyboard: pkgs.writeText "${mkName name}-config.kdb" ''
mkConfig = name: keyboard: pkgs.writeTextFile {
name = "${mkName name}-config.kdb";
text = ''
(defcfg
${keyboard.extraDefCfg}
${mkDevices keyboard.devices}
@ -83,6 +85,10 @@ let
${keyboard.config}
'';
checkPhase = ''
${getExe cfg.package} --cfg "$target" --check --debug
'';
};
mkService = name: keyboard: nameValuePair (mkName name) {
wantedBy = [ "multi-user.target" ];