added openrct2 to gaming_pkgs.nix, altered some network configuration to make hosting servers easier. Kitty now changes theme in ssh.

This commit is contained in:
pagedmov
2024-11-03 01:48:20 -04:00
parent b427e8f373
commit 59d8273efa
5 changed files with 120 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ in {
chafa chafa
nemo nemo
flavours flavours
nicotine-plus
ags ags
sassc sassc
gtk3 gtk3

View File

@@ -76,6 +76,13 @@
runbg aplay "$1" runbg aplay "$1"
fi 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() { gitcheckout_sfx() {
if git checkout "$@"; then if git checkout "$@"; then
playshellsound ${self}/assets/sound/gitcheckout.wav playshellsound ${self}/assets/sound/gitcheckout.wav
@@ -186,6 +193,7 @@
autoload -U down-line-or-beginning-search; zle -N down-line-or-beginning-search autoload -U down-line-or-beginning-search; zle -N down-line-or-beginning-search
bindkey -v bindkey -v
kitty_ssh_theme
type starship_zle-keymap-select >/dev/null || \ type starship_zle-keymap-select >/dev/null || \
{ {
eval "$(starship init zsh)" eval "$(starship init zsh)"

View File

@@ -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. # 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. # 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 = { options = {
homeFiles.enable = lib.mkEnableOption "enables declared custom files"; homeFiles.enable = lib.mkEnableOption "enables declared custom files";
@@ -115,6 +138,77 @@
stdout="off" 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}
'';
}; };
}; };
} }

View File

@@ -10,11 +10,11 @@
hosts = { hosts = {
"192.168.1.200" = ["xenon"]; "192.168.1.200" = ["xenon"];
"192.168.1.201" = ["oganesson"]; "192.168.1.201" = ["oganesson"];
"192.168.1.223" = ["mercury"]; "192.168.1.202" = ["mercury"];
}; };
firewall = { firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 443 ]; allowedTCPPorts = [ 443 8080 ];
}; };
}; };
}; };

View File

@@ -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 = { options = {
gamingPkgs.enable = lib.mkEnableOption "enables gaming packages"; gamingPkgs.enable = lib.mkEnableOption "enables gaming packages";
}; };
config = lib.mkIf config.gamingPkgs.enable { config = lib.mkIf config.gamingPkgs.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
snes9x-gtk snes9x-gtk
cust-openrct2
]; ];
}; };
} }