From 56708c463d5d43347cf69be07c4e20ffc179986b Mon Sep 17 00:00:00 2001 From: Don Harper Date: Thu, 1 May 2025 22:28:32 -0500 Subject: [PATCH] added bzmenu and iwmenu to sway/waybar --- flake.nix | 2 + home/gui/default.nix | 2 + home/gui/sway.nix | 3 +- hosts/workstation/default.nix | 92 ++++++++++++++++++++--------------- 4 files changed, 58 insertions(+), 41 deletions(-) diff --git a/flake.nix b/flake.nix index c41e5a5..3759229 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,8 @@ # nixpkgs-zoom.url = "github:NixOS/nixpkgs/79077930a404da8b7cd7ecf2fe05e8a80347e340"; nixvim.url = "github:nix-community/nixvim"; nixvim.inputs.nixpkgs.follows = "nixpkgs"; + bzmenu.url = "github:e-tho/bzmenu"; + iwmenu.url = "github:e-tho/iwmenu"; }; outputs = inputs@{ self, nixpkgs, nix, nixpkgs-stable, nixos-hardware diff --git a/home/gui/default.nix b/home/gui/default.nix index bcbee50..20832d9 100644 --- a/home/gui/default.nix +++ b/home/gui/default.nix @@ -29,6 +29,8 @@ in { # poweralertd # prusa-slicer # thunderbird + inputs.bzmenu.packages.${pkgs.system}.default + inputs.iwmenu.packages.${pkgs.system}.default at-spi2-core blueberry calibre diff --git a/home/gui/sway.nix b/home/gui/sway.nix index d0a7b12..162370f 100644 --- a/home/gui/sway.nix +++ b/home/gui/sway.nix @@ -46,7 +46,7 @@ format-connected = "^bt"; format-off = "!bt"; format-disabled = "xbt"; - on-click = "bluetoogle"; + on-click = "bzmenu -l rofi"; tooltip-format = "{status}"; }; backlight = { @@ -125,6 +125,7 @@ format-linked = "{ifname} (No IP)"; format-disconnected = "Disconnected"; format-alt = "{ifname}: {ipaddr}/{cidr}"; + on-click = "iwmenu -l rofi"; }; pulseaudio = { format = "v:{volume}%"; diff --git a/hosts/workstation/default.nix b/hosts/workstation/default.nix index acd3286..6f07d18 100644 --- a/hosts/workstation/default.nix +++ b/hosts/workstation/default.nix @@ -41,11 +41,58 @@ in { ./tlp.nix ]; - # Enable networking - networking.networkmanager.enable = true; - networking.enableIPv6 = true; - networking.networkmanager.wifi.powersave = true; - networking.useDHCP = false; + networking = { + networkmanager.enable = true; + enableIPv6 = true; + networkmanager = { + wifi = { + powersave = true; + }; + }; + useDHCP = false; + wireless = { + iwd = { + enable = true; + settings = { + IPv6 = { + Enabled = true; + }; + Settings = { + AutoConnect = true; + }; + }; + }; + }; + firewall = { + enable = true; + trustedInterfaces = [ "tailscale0" ]; # always allow traffic from your Tailscale network + checkReversePath = "loose"; + allowedUDPPorts = [ config.services.tailscale.port ]; + allowedTCPPortRanges = [{ + from = 1714; + to = 1764; + }]; + allowedUDPPortRanges = [{ + from = 1714; + to = 1764; + }]; + allowedTCPPorts = [ 22 ]; + interfaces = { + "tailscale0" = { + allowedTCPPorts = [ 22 8080 8443 ]; + allowedTCPPortRanges = [{ + from = 1714; + to = 1764; + }]; + allowedUDPPortRanges = [{ + from = 1714; + to = 1764; + }]; + }; + }; + }; + }; + # Set your time zone. time = { @@ -290,41 +337,6 @@ in { nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; - # Open ports in the firewall. - networking.firewall = { - enable = true; - # always allow traffic from your Tailscale network - trustedInterfaces = [ "tailscale0" ]; - checkReversePath = "loose"; - - # allow the Tailscale UDP port through the firewall - allowedUDPPorts = [ config.services.tailscale.port ]; - allowedTCPPortRanges = [{ - from = 1714; - to = 1764; - }]; - allowedUDPPortRanges = [{ - from = 1714; - to = 1764; - }]; - - # allow you to SSH in over the public internet - allowedTCPPorts = [ 22 ]; - interfaces = { - "tailscale0" = { - allowedTCPPorts = [ 22 8080 8443 ]; - allowedTCPPortRanges = [{ - from = 1714; - to = 1764; - }]; - allowedUDPPortRanges = [{ - from = 1714; - to = 1764; - }]; - }; - }; - }; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leavecatenate(variables, "bootdev", bootdev)