diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-15 03:27:54 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-15 03:27:54 +0900 |
| commit | 4433c993fae86634b813ee212803a84aaeedd374 (patch) | |
| tree | c407029bf3e7df57398ef5ba40f7630176348241 /nixos.nix | |
| parent | 430991c39bedafb231e0017277e69ad95cb1d56e (diff) | |
nix: check config via hakurei
This is unfortunately the only feasible way of doing this in nix.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'nixos.nix')
| -rw-r--r-- | nixos.nix | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -204,11 +204,20 @@ in ] ); }; - }; + + checkedConfig = + name: value: + let + file = pkgs.writeText name (builtins.toJSON value); + in + pkgs.runCommand "checked-${name}" { nativeBuildInputs = [ cfg.package ]; } '' + ln -vs ${file} "$out" + hakurei show ${file} + ''; in pkgs.writeShellScriptBin app.name '' - exec hakurei${if app.verbose then " -v" else ""} app ${pkgs.writeText "hakurei-app-${app.name}.json" (builtins.toJSON conf)} $@ + exec hakurei${if app.verbose then " -v" else ""} app ${checkedConfig "hakurei-app-${app.name}.json" conf} $@ '' ) ] |
