From b32f7e3989da2553603278ac993549fb2aced3f1 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 6 May 2024 15:49:11 -0500 Subject: [PATCH] properly handle rune module --- modules/runes/default.nix | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/runes/default.nix b/modules/runes/default.nix index a36bdb5..4e6ede6 100644 --- a/modules/runes/default.nix +++ b/modules/runes/default.nix @@ -7,6 +7,7 @@ let inherit (lib) types + mkMerge mkOption mkIf mkEnableOption @@ -18,11 +19,11 @@ let }; mkRune = { - rune, + name, number ? "6", - runeKind ? "braille", + kind ? "braille", }: - "[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n"; + "[1;3${number}m\n" + runes.${name}.${kind} + "\n"; cfg = config.oizys.rune; in { @@ -50,19 +51,21 @@ in }; }; - config = - mkIf cfg.enable { + config = mkMerge [ + (mkIf cfg.enable { environment.etc.issue = { source = pkgs.writeText "issue" (mkRune { - rune = cfg.name; - runeKind = cfg.kind; + name = cfg.name; + kind = cfg.kind; }); }; - } - // mkIf cfg.motd.enable { + }) + (mkIf cfg.motd.enable { users.motd = mkRune { number = "2"; # todo: autogenerate based on hostname? - rune = cfg.name; + name = cfg.name; }; - }; + + }) + ]; }