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,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)
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" ];