mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 18:30:43 -06:00
properly handle rune module
This commit is contained in:
parent
86bc2bf44f
commit
b32f7e3989
1 changed files with 14 additions and 11 deletions
|
@ -7,6 +7,7 @@
|
||||||
let
|
let
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
types
|
types
|
||||||
|
mkMerge
|
||||||
mkOption
|
mkOption
|
||||||
mkIf
|
mkIf
|
||||||
mkEnableOption
|
mkEnableOption
|
||||||
|
@ -18,11 +19,11 @@ let
|
||||||
};
|
};
|
||||||
mkRune =
|
mkRune =
|
||||||
{
|
{
|
||||||
rune,
|
name,
|
||||||
number ? "6",
|
number ? "6",
|
||||||
runeKind ? "braille",
|
kind ? "braille",
|
||||||
}:
|
}:
|
||||||
"[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n[0m";
|
"[1;3${number}m\n" + runes.${name}.${kind} + "\n[0m";
|
||||||
cfg = config.oizys.rune;
|
cfg = config.oizys.rune;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -50,19 +51,21 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = mkMerge [
|
||||||
mkIf cfg.enable {
|
(mkIf cfg.enable {
|
||||||
environment.etc.issue = {
|
environment.etc.issue = {
|
||||||
source = pkgs.writeText "issue" (mkRune {
|
source = pkgs.writeText "issue" (mkRune {
|
||||||
rune = cfg.name;
|
name = cfg.name;
|
||||||
runeKind = cfg.kind;
|
kind = cfg.kind;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
// mkIf cfg.motd.enable {
|
(mkIf cfg.motd.enable {
|
||||||
users.motd = mkRune {
|
users.motd = mkRune {
|
||||||
number = "2"; # todo: autogenerate based on hostname?
|
number = "2"; # todo: autogenerate based on hostname?
|
||||||
rune = cfg.name;
|
name = cfg.name;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue