properly handle rune module

This commit is contained in:
Daylin Morgan 2024-05-06 15:49:11 -05:00
parent 86bc2bf44f
commit b32f7e3989
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -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;
};
})
];
}