refactor(arion): remove toYAML and use writeYAML instead
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-03-19 13:36:02 -04:00
parent c1b5d2e360
commit cea02da54c
2 changed files with 10 additions and 17 deletions

View file

@ -1,6 +1,10 @@
{config, ...}: let {
inherit (config.arion) toYAML; config,
pkgs,
...
}: let
inherit (config.sops) secrets; inherit (config.sops) secrets;
inherit (pkgs.writers) writeYAML;
in { in {
arion.projects."homepage"."homepage" = { arion.projects."homepage"."homepage" = {
image = ./images/homepage.nix; image = ./images/homepage.nix;
@ -15,11 +19,11 @@ in {
env_file = [secrets.homepage.path]; env_file = [secrets.homepage.path];
volumes = let volumes = let
services = toYAML "services.yaml" (import ./services.nix); services = writeYAML "services.yaml" (import ./services.nix);
bookmarks = toYAML "bookmarks.yaml" {}; bookmarks = writeYAML "bookmarks.yaml" {};
settings = toYAML "settings.yaml" { settings = writeYAML "settings.yaml" {
# FIXME: title not working # FIXME: title not working
title = "bruh"; title = "bruh";
theme = "dark"; theme = "dark";
@ -33,7 +37,7 @@ in {
}; };
}; };
widgets = toYAML "widgets.yaml" [ widgets = writeYAML "widgets.yaml" [
{ {
resources = { resources = {
cpu = true; cpu = true;

View file

@ -27,17 +27,6 @@ in {
options.arion = { options.arion = {
enable = mkEnableOption (lib.mdDoc "My custom arion config layer module"); enable = mkEnableOption (lib.mdDoc "My custom arion config layer module");
# TODO: move this somewhere else
toYAML = mkOption {
type = types.anything;
readOnly = true;
default = name: attrs:
pkgs.runCommandCC name {} ''
echo '${builtins.toJSON attrs}' |
${pkgs.remarshal}/bin/remarshal --if json --of yaml > $out
'';
};
rwDataDir = mkOption { rwDataDir = mkOption {
default = "/var/lib/arion"; default = "/var/lib/arion";
type = types.str; type = types.str;