From cb7f743205a35b85cd127150e7a2eeff74f35e33 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Sun, 28 Jan 2024 23:19:30 -0600 Subject: [PATCH] rune module --- hosts/algiz/system.nix | 4 +-- hosts/mannaz/system.nix | 4 +-- hosts/othalan/rune | 16 --------- hosts/othalan/system.nix | 10 ++++-- lib/default.nix | 5 ++- modules/runes/README.md | 7 ++++ hosts/algiz/rune => modules/runes/algiz.nix | 22 ++++++++++-- modules/runes/default.nix | 5 +++ hosts/mannaz/rune => modules/runes/mannaz.nix | 23 ++++++++++-- modules/runes/othalan.nix | 36 +++++++++++++++++++ 10 files changed, 102 insertions(+), 30 deletions(-) delete mode 100644 hosts/othalan/rune create mode 100644 modules/runes/README.md rename hosts/algiz/rune => modules/runes/algiz.nix (68%) create mode 100644 modules/runes/default.nix rename hosts/mannaz/rune => modules/runes/mannaz.nix (66%) create mode 100644 modules/runes/othalan.nix diff --git a/hosts/algiz/system.nix b/hosts/algiz/system.nix index b4a5575..ef12b5c 100644 --- a/hosts/algiz/system.nix +++ b/hosts/algiz/system.nix @@ -1,5 +1,5 @@ -{...}: { - users.motdFile = ./rune; +{mkRune, ...}: { + users.motd = mkRune {number="6"; rune = "algiz";}; swapDevices = [ { diff --git a/hosts/mannaz/system.nix b/hosts/mannaz/system.nix index 14b5dd6..a61ed91 100644 --- a/hosts/mannaz/system.nix +++ b/hosts/mannaz/system.nix @@ -1,11 +1,11 @@ { inputs, - lib, config, pkgs, + mkRune, ... }: { - users.motdFile = ./rune; + users.motd = mkRune {number="2"; rune="mannaz";}; # Use the systemd-boot EFI boot loader. boot.loader = { diff --git a/hosts/othalan/rune b/hosts/othalan/rune deleted file mode 100644 index d5b1d24..0000000 --- a/hosts/othalan/rune +++ /dev/null @@ -1,16 +0,0 @@ - - .+. - .*@@@*. - .+@@- -%@*. - .+@@= -%@*. - .+@%= -%@+. - +@@- :@@* - .*@%- :#@*: - .#@%: :#@#: - :#@#-*@#: - =@@@+ - .*@#-#@#: - .*@%- :#@#: - .*@%- :%@*. - +@%- -%@+ - :- -: diff --git a/hosts/othalan/system.nix b/hosts/othalan/system.nix index f209f17..5317fd6 100644 --- a/hosts/othalan/system.nix +++ b/hosts/othalan/system.nix @@ -1,9 +1,12 @@ { config, pkgs, + mkRune, ... -} -: { +}: +let + rune = import ../../modules/runes/othalan.nix; +in { networking.networkmanager.enable = true; services.printing.enable = true; services.fwupd.enable = true; @@ -30,7 +33,8 @@ services.getty.greetingLine = ''<<< Welcome to NixOS ${config.system.nixos.label} (\m) - \l >>>'' - + (builtins.readFile ./rune); + + mkRune {rune = "othalan"; runeKind = "ascii";}; + # + inputs.self.nixosModules.runes.othalan.ascii; # catppuccin/tty boot.kernelParams = [ diff --git a/lib/default.nix b/lib/default.nix index ca3e902..efb767a 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -8,7 +8,10 @@ inherit (nixpkgs.lib.filesystem) listFilesRecursive; supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; + runes = import ../modules/runes; in rec { + mkRune = {rune, number ? "2", runeKind ? "braille"}: "\e[3${number}m" + runes.${rune}.${runeKind} + "\e[0m"; + forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system}); buildOizys = _: @@ -29,7 +32,7 @@ in rec { modules = [../modules/common.nix] ++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostname}")); - specialArgs = {inherit inputs;}; + specialArgs = {inherit inputs mkRune;}; }; mapHosts = dir: diff --git a/modules/runes/README.md b/modules/runes/README.md new file mode 100644 index 0000000..d11ae39 --- /dev/null +++ b/modules/runes/README.md @@ -0,0 +1,7 @@ +# Runes + +![](https://upload.wikimedia.org/wikipedia/commons/0/0c/Runic_letter_mannaz.png) +![](https://upload.wikimedia.org/wikipedia/commons/1/14/Runic_letter_algiz.png) +![](https://upload.wikimedia.org/wikipedia/commons/1/16/Runic_letter_othalan.png) + + diff --git a/hosts/algiz/rune b/modules/runes/algiz.nix similarity index 68% rename from hosts/algiz/rune rename to modules/runes/algiz.nix index 22be673..728a834 100644 --- a/hosts/algiz/rune +++ b/modules/runes/algiz.nix @@ -1,5 +1,5 @@ - - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +{ + braille = '' ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⢠⣾⣦⡀⠀⠀⠀⣶⣶⠀⠀⠀⢀⣴⣷⡄⠀⠀⠀ ⠀⠀⠀⠀⠙⢿⣷⣄⠀⠀⣿⣿⠀⠀⣠⣾⡿⠋⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠙⢿⣷⣄⣿⣿⣠⣾⡿⠋⠀⠀⠀⠀⠀⠀ @@ -13,4 +13,20 @@ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ - ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ + ''; + ascii = '' + :%+ ## +%: + -%@+ @@ +@%- + -%@=%%=@%- + =%@@%= + @@ + @% + @% + @% + @% + @% + @% + @@ + ## + ''; +} diff --git a/modules/runes/default.nix b/modules/runes/default.nix new file mode 100644 index 0000000..daa4cbc --- /dev/null +++ b/modules/runes/default.nix @@ -0,0 +1,5 @@ +{ + othalan = import ./othalan.nix; + algiz = import ./algiz.nix; + mannaz = import ./mannaz.nix; +} diff --git a/hosts/mannaz/rune b/modules/runes/mannaz.nix similarity index 66% rename from hosts/mannaz/rune rename to modules/runes/mannaz.nix index 5e0a52d..c2b9d98 100644 --- a/hosts/mannaz/rune +++ b/modules/runes/mannaz.nix @@ -1,5 +1,6 @@ - -⠀⠀⢰⣶⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣶⡆⠀⠀ +{ + braille = ''⠀ + ⢰⣶⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣶⡆⠀⠀ ⠀⠀⢸⣿⡿⢿⣷⣦⣄⠀⠀⠀⠀⣀⣴⣾⡿⠿⣿⡇⠀⠀ ⠀⠀⢸⣿⡇⠀⠈⠛⠿⣿⣶⣴⣿⠿⠛⠁⠀⢸⣿⡇⠀⠀ ⠀⠀⢸⣿⡇⠀⣀⣤⣶⣿⠟⠻⢿⣷⣤⣀⠀⢸⣿⡇⠀⠀ @@ -12,4 +13,20 @@ ⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀ ⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀ ⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⡇⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +''; + ascii ='' + :%*: :+%= + -@%%%*- -*%%#@+ + -@- .=#@##@#=: .@+ + -@- :=#@#*%#+: .@+ + -@%%%*- :*%%#@+ + -@*: .+@+ + -@- .@+ + -@= :@+ + -@= :@+ + -@= :@+ + -@= :@+ + -@= :@+ + -%- :%= + ''; +} diff --git a/modules/runes/othalan.nix b/modules/runes/othalan.nix new file mode 100644 index 0000000..5fdb935 --- /dev/null +++ b/modules/runes/othalan.nix @@ -0,0 +1,36 @@ +{ + ascii = '' + .+. + .*@@@*. + .+@@- -%@*. + .+@@= -%@*. + .+@%= -%@+. + +@@- :@@* + .*@%- :#@*: + .#@%: :#@#: + :#@#-*@#: + =@@@+ + .*@#-#@#: + .*@%- :#@#: + .*@%- :%@*. + +@%- -%@+ + :- -: + ''; + braille = '' +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⡿⢿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⢠⣾⣿⠏⠀⠀⠙⢿⣷⣄⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⢀⣴⣿⠟⠁⠀⠀⠀⠀⠈⠻⣿⣧⡀⠀⠀⠀⠀ +⠀⠀⢀⣴⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣿⣦⡀⠀⠀ +⠀⠀⠀⠙⢿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⠏⠀⠀⠀ +⠀⠀⠀⠀⠈⠻⣿⣷⡀⠀⠀⠀⠀⢀⣴⣿⠟⠁⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠈⠻⣿⣦⡀⢀⣴⣿⠟⠁⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠈⢻⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⡿⢿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⣠⣾⡿⠋⠀⠀⠙⢿⣷⣄⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⢠⣾⣿⠋⠀⠀⠀⠀⠀⠀⠙⢿⣷⣄⠀⠀⠀⠀ +⠀⠀⢀⣴⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣷⡀⠀⠀ +⠀⠀⠀⠙⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠋⠀⠀⠀ + ''; +} +