From 59d8273efae6a48ddf755e70639b65d30d6b0204 Mon Sep 17 00:00:00 2001 From: pagedmov Date: Sun, 3 Nov 2024 01:48:20 -0400 Subject: [PATCH] added openrct2 to gaming_pkgs.nix, altered some network configuration to make hosting servers easier. Kitty now changes theme in ssh. --- modules/home/environment/userpkgs.nix | 1 + modules/home/environment/zshell.nix | 8 ++ modules/home/files.nix | 96 ++++++++++++++++++++- modules/sys/hardware/network.nix | 4 +- modules/sys/software/gaming/gaming_pkgs.nix | 15 +++- 5 files changed, 120 insertions(+), 4 deletions(-) diff --git a/modules/home/environment/userpkgs.nix b/modules/home/environment/userpkgs.nix index fc9943b..0f1ccef 100755 --- a/modules/home/environment/userpkgs.nix +++ b/modules/home/environment/userpkgs.nix @@ -37,6 +37,7 @@ in { chafa nemo flavours + nicotine-plus ags sassc gtk3 diff --git a/modules/home/environment/zshell.nix b/modules/home/environment/zshell.nix index 4ed1723..865c7ef 100755 --- a/modules/home/environment/zshell.nix +++ b/modules/home/environment/zshell.nix @@ -76,6 +76,13 @@ runbg aplay "$1" fi } + kitty_ssh_theme() { + if [ -n "$SSH_CONNECTION" ]; then + kitty @ set-colors -a ~/.config/kitty/ssh-theme.conf + else + kitty @ set-colors -a ~/.config/kitty/ssh-theme.conf + fi + } gitcheckout_sfx() { if git checkout "$@"; then playshellsound ${self}/assets/sound/gitcheckout.wav @@ -186,6 +193,7 @@ autoload -U down-line-or-beginning-search; zle -N down-line-or-beginning-search bindkey -v + kitty_ssh_theme type starship_zle-keymap-select >/dev/null || \ { eval "$(starship init zsh)" diff --git a/modules/home/files.nix b/modules/home/files.nix index 7081622..734847c 100755 --- a/modules/home/files.nix +++ b/modules/home/files.nix @@ -1,7 +1,30 @@ -{ lib, self, config, ... }: +{pkgs, scheme, lib, self, config, ... }: # This folder is for programs that do not have existing configuration modules in NixOS. # Basically a to-do list for stuff I need to write my own modules for. +let + # Custom theme that activates in ssh + ssh_base16 = "atelier-cave"; + + scheme_path = "${pkgs.base16-schemes}/share/themes/${ssh_base16}.yaml"; + scheme_string = builtins.readFile scheme_path; + scheme_list = lib.splitString "\n" "${scheme_string}"; + colors = lib.filter (line: builtins.match "^ *base[0-9A-F]{2}: .*" line != null) scheme_list; + ssh_scheme = + lib.lists.foldl' ( + acc: line: let + splitLine = lib.splitString ": " line; + key = builtins.elemAt splitLine 0; + value = builtins.elemAt splitLine 1; + trimmedKey = lib.trim key; + cleanValue_step1 = lib.splitString " " value; + cleanValue_step2 = builtins.elemAt cleanValue_step1 0; + cleanValue_final = builtins.substring 1 (builtins.stringLength cleanValue_step2 - 2) cleanValue_step2; + in + acc // {"${trimmedKey}" = cleanValue_final;} + ) {} + colors; +in { options = { homeFiles.enable = lib.mkEnableOption "enables declared custom files"; @@ -115,6 +138,77 @@ stdout="off" ''; + + ".config/kitty/default-theme.conf".text = '' + background #${scheme.base00} + foreground #${scheme.base05} + selection_background #${scheme.base05} + selection_foreground #${scheme.base00} + url_color #${scheme.base04} + cursor #${scheme.base05} + active_border_color #${scheme.base03} + inactive_border_color #${scheme.base01} + active_tab_background #${scheme.base00} + active_tab_foreground #${scheme.base05} + inactive_tab_background #${scheme.base01} + inactive_tab_foreground #${scheme.base04} + tab_bar_background #${scheme.base01} + + # normal + color0 #${scheme.base01} + color1 #${scheme.base08} + color2 #${scheme.base0B} + color3 #${scheme.base0A} + color4 #${scheme.base0D} + color5 #${scheme.base0E} + color6 #${scheme.base0C} + color7 #${scheme.base05} + + # bright + color8 #${scheme.base03} + color9 #${scheme.base09} + color10 #${scheme.base01} + color11 #${scheme.base02} + color12 #${scheme.base04} + color13 #${scheme.base06} + color14 #${scheme.base0F} + color15 #${scheme.base07} + ''; + ".config/kitty/ssh-theme.conf".text = '' + background #${ssh_scheme.base00} + foreground #${ssh_scheme.base05} + selection_background #${ssh_scheme.base05} + selection_foreground #${ssh_scheme.base00} + url_color #${ssh_scheme.base04} + cursor #${ssh_scheme.base05} + active_border_color #${ssh_scheme.base03} + inactive_border_color #${ssh_scheme.base01} + active_tab_background #${ssh_scheme.base00} + active_tab_foreground #${ssh_scheme.base05} + inactive_tab_background #${ssh_scheme.base01} + inactive_tab_foreground #${ssh_scheme.base04} + tab_bar_background #${ssh_scheme.base01} + + # normal + color0 #${ssh_scheme.base01} + color1 #${ssh_scheme.base08} + color2 #${ssh_scheme.base0B} + color3 #${ssh_scheme.base0A} + color4 #${ssh_scheme.base0D} + color5 #${ssh_scheme.base0E} + color6 #${ssh_scheme.base0C} + color7 #${ssh_scheme.base05} + + # bright + color8 #${ssh_scheme.base03} + color9 #${ssh_scheme.base09} + color10 #${ssh_scheme.base01} + color11 #${ssh_scheme.base02} + color12 #${ssh_scheme.base04} + color13 #${ssh_scheme.base06} + color14 #${ssh_scheme.base0F} + color15 #${ssh_scheme.base07} + ''; }; }; } diff --git a/modules/sys/hardware/network.nix b/modules/sys/hardware/network.nix index 8acbab2..227762b 100755 --- a/modules/sys/hardware/network.nix +++ b/modules/sys/hardware/network.nix @@ -10,11 +10,11 @@ hosts = { "192.168.1.200" = ["xenon"]; "192.168.1.201" = ["oganesson"]; - "192.168.1.223" = ["mercury"]; + "192.168.1.202" = ["mercury"]; }; firewall = { enable = true; - allowedTCPPorts = [ 443 ]; + allowedTCPPorts = [ 443 8080 ]; }; }; }; diff --git a/modules/sys/software/gaming/gaming_pkgs.nix b/modules/sys/software/gaming/gaming_pkgs.nix index 054e5f8..918a253 100755 --- a/modules/sys/software/gaming/gaming_pkgs.nix +++ b/modules/sys/software/gaming/gaming_pkgs.nix @@ -1,10 +1,23 @@ -{lib, config, pkgs, ...}: { +{lib, config, pkgs, ...}: + +let + cust-openrct2 = pkgs.openrct2.overrideAttrs (oldAttrs: { + cmakeFlags = [ + "-DDOWNLOAD_OBJECTS=ON" + "-DDOWNLOAD_OPENMSX=ON" + "-DDOWNLOAD_OPENSFX=ON" + "-DDOWNLOAD_TITLE_SEQUENCES=ON" + ]; + }); +in +{ options = { gamingPkgs.enable = lib.mkEnableOption "enables gaming packages"; }; config = lib.mkIf config.gamingPkgs.enable { environment.systemPackages = with pkgs; [ snes9x-gtk + cust-openrct2 ]; }; }