From 57cbceb82b900f8f2286cc437fc57b1c0ceb288c Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 18 Jul 2024 16:24:19 -0500 Subject: [PATCH 1/2] Add lag alias --- modules/home-manager/default.nix | 7 +++ modules/home-manager/fish.nix | 85 -------------------------------- 2 files changed, 7 insertions(+), 85 deletions(-) delete mode 100644 modules/home-manager/fish.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 30ee7a1..44658b7 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -424,6 +424,13 @@ end ''; }; + lag = { + wraps = "g"; + body = '' + lA + g $argv + ''; + }; }; }; diff --git a/modules/home-manager/fish.nix b/modules/home-manager/fish.nix deleted file mode 100644 index c889e31..0000000 --- a/modules/home-manager/fish.nix +++ /dev/null @@ -1,85 +0,0 @@ -{pkgs, ...}: { - home = { - packages = [ - pkgs.gawk # used in prompt - ]; - }; - - programs.fish = { - enable = true; - # I load long scripts from files for a better editing experience - shellInit = builtins.readFile ./fish/shellInit.fish; - interactiveShellInit = builtins.readFile ./fish/interactiveShellInit.fish; - loginShellInit = ""; - functions = { - # TODO: I think these should be loaded from fish files too for better editor experience? - d = '' - # --wraps=cd --description "Quickly jump to NICE_HOME (or given relative or absolute path) and list files." - if count $argv > /dev/null - cd $argv - else - cd $NICE_HOME - end - la - ''; - - c = '' - if count $argv > /dev/null - cd $NICE_HOME && d $argv - else - d $NICE_HOME - end - ''; - - ltl = '' - set d $argv[1] . - set -l l "" - for f in $d[1]/* - if test -z $l; set l $f; continue; end - if command test $f -nt $l; and test ! -d $f - set l $f - end - end - echo $l - ''; - - has_command = "command --quiet --search $argv[1]"; - }; - shellAbbrs = {}; - shellAliases = { - ls = "eza --group-directories-first --classify"; - l = "ls"; - ll = "ls --long --group"; - la = "ll --all"; - lA = "la --all"; # --all twice to show . and .. - tree = "ls --tree --level=3"; - lt = "ll --sort=modified"; - lat = "la --sort=modified"; - lc = "lt --sort=accessed"; - lT = "lt --reverse"; - lC = "lc --reverse"; - lD = "la --only-dirs"; - "cd.." = "d .."; - "cdc" = "d $XDG_CONFIG_HOME"; - "cdn" = "d $NOTES_PATH"; - "cdl" = "d $XDG_DOWNLOAD_DIR"; - "cdg" = "d $XDG_GAMES_DIR"; - ".." = "d .."; - "..." = "d ../.."; - "...." = "d ../../.."; - "....." = "d ../../../.."; - "......" = "d ../../../../.."; - "......." = "d ../../../../../.."; - "........" = "d ../../../../../../.."; - "........." = "d ../../../../../../../.."; - p = "ping"; - dc = "docker compose"; - pc = "podman-compose"; - k = "kubectl"; - kg = "kubectl get"; - v = "$EDITOR"; - sv = "sudo $EDITOR"; - kssh = "kitty +kitten ssh"; - }; - }; -} From 803e78147a5d57dcbef25976b6109c8c7f08e56a Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 19 Jul 2024 12:15:39 -0500 Subject: [PATCH 2/2] Musicbox --- flake.nix | 35 +++++++++++++++++++++++++++++++++++ nixos/router.nix | 11 ++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 3293983..641b74a 100644 --- a/flake.nix +++ b/flake.nix @@ -367,6 +367,41 @@ ]; }; + musicbox = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + { + _module.args = { + disks = ["/dev/sda"]; + # swapSize = "8G"; + }; + } + outputs.diskoConfigurations.unencrypted + hardware.nixosModules.common-pc-laptop-ssd + + music-production + common + graphical-workstation + wifi + + # ./nixos/musicbox.nix + + { + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + hardware.bluetooth.enable = true; + networking.networkmanager.enable = true; + + home-manager.users.daniel = { + imports = with homeManagerModules; [ + firefox-no-tabs + linux-desktop-environment-config + ]; + }; + } + ]; + }; + rascal = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = with nixosModules; [ diff --git a/nixos/router.nix b/nixos/router.nix index c98400c..794bb7c 100644 --- a/nixos/router.nix +++ b/nixos/router.nix @@ -35,6 +35,12 @@ dragon = { ip = "192.168.0.10"; }; + bald = { + ip = "192.168.0.11"; + additionalHosts = [ + "ourcraft.lyte.dev" + ]; + }; beefcake = { ip = "192.168.0.9"; additionalHosts = [ @@ -174,6 +180,7 @@ in { tcp dport { 80, 443 } accept comment "Allow HTTP/HTTPS to server (see nat prerouting)" udp dport { 80, 443 } accept comment "Allow QUIC to server (see nat prerouting)" tcp dport { 22 } accept comment "Allow SSH to server (see nat prerouting)" + tcp dport { 25565 } accept comment "Allow Minecraft server connections (see nat prerouting)" iifname "${lan}" accept comment "Allow local network to access the router" iifname "tailscale0" accept comment "Allow local network to access the router" @@ -213,7 +220,9 @@ in { iifname ${wan} tcp dport {22} dnat to ${hosts.beefcake.ip} iifname ${wan} tcp dport {80, 443} dnat to ${hosts.beefcake.ip} iifname ${wan} udp dport {80, 443} dnat to ${hosts.beefcake.ip} - iifname ${wan} tcp dport {25565, 26966} dnat to ${hosts.beefcake.ip} + iifname ${wan} tcp dport {26966} dnat to ${hosts.beefcake.ip} + iifname ${wan} tcp dport {25565} dnat to ${hosts.bald.ip} + iifname ${wan} udp dport {25565} dnat to ${hosts.bald.ip} } chain postrouting {