From 38c0c9c54b90db33798456e6f7caaf0556de0d9b Mon Sep 17 00:00:00 2001 From: jolheiser Date: Mon, 15 Jan 2024 17:00:38 -0600 Subject: [PATCH] chore: use yaml generator for flake Signed-off-by: jolheiser --- flake.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index cdcff1f..f9c52d0 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,8 @@ ... }: let 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); in { options = with lib; { @@ -95,9 +96,9 @@ default = "/var/lib/ugit/ugit_ed25519"; }; - configFile = mkOption { - type = types.str; - default = ""; + config = mkOption { + type = types.attrs; + default = {}; description = "config.yaml contents"; };