mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 10:10:45 -06:00
completely rework rune system
This commit is contained in:
parent
ee519f94c9
commit
bb87af5136
10 changed files with 72 additions and 40 deletions
|
@ -13,6 +13,7 @@
|
|||
"node" # for docker langservers
|
||||
"python"
|
||||
];
|
||||
rune.motd = enabled;
|
||||
|
||||
docker = enabled;
|
||||
backups = enabled;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
{ lib, enabled, ... }:
|
||||
{ enabled, ... }:
|
||||
{
|
||||
users.motd = lib.mkRune {
|
||||
number = "6";
|
||||
rune = "algiz";
|
||||
};
|
||||
|
||||
services.resolved = enabled;
|
||||
|
||||
services.fail2ban = {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
oizys = {
|
||||
desktop = enabled;
|
||||
nix-ld = enabled;
|
||||
rune.motd = enabled;
|
||||
};
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
|
|
|
@ -2,15 +2,9 @@
|
|||
config,
|
||||
pkgs,
|
||||
enabled,
|
||||
mkRune,
|
||||
...
|
||||
}:
|
||||
{
|
||||
users.motd = mkRune {
|
||||
number = "2";
|
||||
rune = "mannaz";
|
||||
};
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader = {
|
||||
systemd-boot = enabled;
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{
|
||||
pkgs,
|
||||
enabled,
|
||||
mkRune,
|
||||
...
|
||||
}:
|
||||
{ pkgs, enabled, ... }:
|
||||
{
|
||||
networking.networkmanager = enabled;
|
||||
services.printing = enabled;
|
||||
|
@ -28,14 +23,6 @@
|
|||
|
||||
environment.systemPackages = with pkgs; [ pamixer ];
|
||||
|
||||
services.getty = {
|
||||
greetingLine = mkRune {
|
||||
rune = "othalan";
|
||||
runeKind = "ascii";
|
||||
};
|
||||
helpLine = "";
|
||||
};
|
||||
|
||||
networking.hostName = "othalan";
|
||||
time.timeZone = "US/Central";
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ let
|
|||
mkDefaultOizysModule
|
||||
mkOizysModule
|
||||
enabled
|
||||
mkRune
|
||||
;
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
|
||||
|
@ -46,7 +45,6 @@ rec {
|
|||
mkDefaultOizysModule
|
||||
mkOizysModule
|
||||
enabled
|
||||
mkRune
|
||||
;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,7 +7,6 @@ let
|
|||
mkOption
|
||||
types
|
||||
;
|
||||
runes = import ../modules/runes;
|
||||
in
|
||||
rec {
|
||||
enabled = {
|
||||
|
@ -38,13 +37,6 @@ rec {
|
|||
|
||||
isNixFile = path: hasSuffix ".nix" path;
|
||||
mkIfIn = name: list: prev.mkIf (builtins.elem name list);
|
||||
mkRune =
|
||||
{
|
||||
rune,
|
||||
number ? "6",
|
||||
runeKind ? "braille",
|
||||
}:
|
||||
"[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n[0m";
|
||||
|
||||
mkOizysModule = config: attr: content: {
|
||||
options.oizys.${attr}.enable = mkEnableOption "enable ${attr} support";
|
||||
|
|
|
@ -5,7 +5,9 @@ in
|
|||
{
|
||||
imports = with self.nixosModules; [
|
||||
users
|
||||
runes
|
||||
nix
|
||||
|
||||
cli
|
||||
dev
|
||||
nvim
|
||||
|
|
|
@ -1,5 +1,68 @@
|
|||
{
|
||||
othalan = import ./othalan.nix;
|
||||
algiz = import ./algiz.nix;
|
||||
mannaz = import ./mannaz.nix;
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
types
|
||||
mkOption
|
||||
mkIf
|
||||
mkEnableOption
|
||||
;
|
||||
runes = {
|
||||
othalan = import ./othalan.nix;
|
||||
algiz = import ./algiz.nix;
|
||||
mannaz = import ./mannaz.nix;
|
||||
};
|
||||
mkRune =
|
||||
{
|
||||
rune,
|
||||
number ? "6",
|
||||
runeKind ? "braille",
|
||||
}:
|
||||
"[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n[0m";
|
||||
cfg = config.oizys.rune;
|
||||
in
|
||||
{
|
||||
options.oizys = {
|
||||
rune = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
motd.enable = mkEnableOption "set rune for MOTD";
|
||||
name = mkOption {
|
||||
default = config.networking.hostName;
|
||||
type = types.either (types.enum (builtins.attrNames runes)) types.str;
|
||||
description = "Name of rune (probabaly matches hostname)";
|
||||
};
|
||||
kind = mkOption {
|
||||
type =
|
||||
with types;
|
||||
either (enum [
|
||||
"ascii"
|
||||
"braille"
|
||||
]) str;
|
||||
default = "ascii";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable {
|
||||
environment.etc.issue = {
|
||||
source = pkgs.writeText "issue" (mkRune {
|
||||
rune = cfg.name;
|
||||
runeKind = cfg.kind;
|
||||
});
|
||||
};
|
||||
}
|
||||
// mkIf cfg.motd.enable {
|
||||
users.motd = mkRune {
|
||||
number = "2"; # todo: autogenerate based on hostname?
|
||||
rune = cfg.name;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
|
||||
installShellFiles,
|
||||
buildGoModule,
|
||||
lib,
|
||||
|
|
Loading…
Reference in a new issue