chore: use yaml generator for flake

Signed-off-by: jolheiser <john.olheiser@gmail.com>
ffdhall
jolheiser 2024-01-15 17:00:38 -06:00
parent 868ca2125a
commit 38c0c9c54b
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
1 changed files with 5 additions and 4 deletions

View File

@ -58,7 +58,8 @@
... ...
}: let }: let
cfg = config.services.ugit; cfg = config.services.ugit;
configFile = pkgs.writeText "ugit.yaml" cfg.configFile; yamlFormat = pkgs.formats.yaml {};
configFile = pkgs.writeText "ugit.yaml" (builtins.readFile (yamlFormat.generate "ugit-yaml" cfg.config));
authorizedKeysFile = pkgs.writeText "ugit_keys" (builtins.concatStringsSep "\n" cfg.authorizedKeys); authorizedKeysFile = pkgs.writeText "ugit_keys" (builtins.concatStringsSep "\n" cfg.authorizedKeys);
in { in {
options = with lib; { options = with lib; {
@ -95,9 +96,9 @@
default = "/var/lib/ugit/ugit_ed25519"; default = "/var/lib/ugit/ugit_ed25519";
}; };
configFile = mkOption { config = mkOption {
type = types.str; type = types.attrs;
default = ""; default = {};
description = "config.yaml contents"; description = "config.yaml contents";
}; };