From 2ca5f9351e8dc8c6c6d4bcb6b4e3c62b06449223 Mon Sep 17 00:00:00 2001 From: pagedmov Date: Sat, 2 Nov 2024 17:14:19 -0400 Subject: [PATCH] updated hosts in network.nix --- modules/home/scripts/commands/icanhazip.nix | 6 ++++++ modules/home/scripts/default.nix | 4 ++++ modules/sys/hardware/network.nix | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 modules/home/scripts/commands/icanhazip.nix diff --git a/modules/home/scripts/commands/icanhazip.nix b/modules/home/scripts/commands/icanhazip.nix new file mode 100644 index 0000000..2580b88 --- /dev/null +++ b/modules/home/scripts/commands/icanhazip.nix @@ -0,0 +1,6 @@ +{ pkgs }: + +pkgs.writeShellScriptBin "icanhazip" '' + echo "Public IP: $(curl -s icanhazip.com -4)" + ip route | awk '/default/ {print "Default Gateway: " $3} /src/ {print "Local IP: " $9}' | head -n 2 +'' diff --git a/modules/home/scripts/default.nix b/modules/home/scripts/default.nix index 988777f..aae86eb 100644 --- a/modules/home/scripts/default.nix +++ b/modules/home/scripts/default.nix @@ -11,6 +11,7 @@ splash = import ./commands/splash.nix { inherit self pkgs; }; runbg = import ./commands/runbg.nix { inherit self pkgs; }; mkbackup = import ./commands/mkbackup.nix { inherit pkgs; }; + icanhazip = import ./commands/icanhazip.nix { inherit pkgs; }; garbage-collect = import ./nix/garbage-collect.nix { inherit self pkgs; }; nsp = import ./nix/nsp.nix { inherit self pkgs; }; scheck = import ./wm-controls/s_check.nix { inherit self pkgs; }; @@ -44,6 +45,8 @@ in { # Individual options using scriptOverride or mkEnableOption directly movScripts.commandScripts.mkbackup.enable = scriptOverride "Enables the mkbackup command" "commandScripts" "mkbackup"; + movScripts.commandScripts.icanhazip.enable = + scriptOverride "Enables the icanhazip command" "commandScripts" "icanhazip"; movScripts.commandScripts.invoke.enable = scriptOverride "Enables the invoke command" "commandScripts" "invoke"; movScripts.commandScripts.runbg.enable = @@ -80,6 +83,7 @@ in { home.packages = lib.optionals config.movScripts.commandScripts.invoke.enable [ invoke ] ++ lib.optionals config.movScripts.commandScripts.runbg.enable [ runbg ] ++ lib.optionals config.movScripts.commandScripts.mkbackup.enable [ mkbackup ] + ++ lib.optionals config.movScripts.commandScripts.icanhazip.enable [ icanhazip ] ++ lib.optionals config.movScripts.commandScripts.splash.enable [ splash ] ++ lib.optionals config.movScripts.commandScripts.toolbelt.enable [ toolbelt ] ++ lib.optionals config.movScripts.commandScripts.viconf.enable [ viconf ] diff --git a/modules/sys/hardware/network.nix b/modules/sys/hardware/network.nix index 85638ac..db8e3ce 100644 --- a/modules/sys/hardware/network.nix +++ b/modules/sys/hardware/network.nix @@ -8,8 +8,8 @@ networkmanager.enable = true; hostName = "${host}"; hosts = { - "192.168.1.201" = ["xenon"]; - "192.168.1.111" = ["argon"]; + "192.168.1.200" = ["xenon"]; + "192.168.1.201" = ["oganesson"]; "192.168.1.223" = ["mercury"]; }; firewall = {