From a733249377c3e71aee3556a84db042175faf9a1f Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 17 Sep 2024 12:06:20 -0500 Subject: [PATCH 1/5] Allow media keys even when sway is locked --- modules/home-manager/sway.nix | 17 +++++++++++++++-- nixos/foxtrot.nix | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/modules/home-manager/sway.nix b/modules/home-manager/sway.nix index 49b4b75..e644688 100644 --- a/modules/home-manager/sway.nix +++ b/modules/home-manager/sway.nix @@ -284,19 +284,32 @@ # TODO: this should also reset the horizontal and vertical gaps? "${mod}+control+equal" = "gaps inner current set 0"; + "${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle"; + "${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise"; "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower"; "XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle"; "XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle"; - "${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle"; "XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; "XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; "control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%"; "control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%"; - "${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioPlay" = "exec playerctl play-pause"; "XF86AudioNext" = "exec playerctl next"; "XF86AudioPrev" = "exec playerctl previous"; + "--locked ${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle"; + "--locked ${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "--locked XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise"; + "--locked XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower"; + "--locked XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle"; + "--locked XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle"; + "--locked XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; + "--locked XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; + "--locked control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%"; + "--locked control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%"; + "--locked XF86AudioPlay" = "exec playerctl play-pause"; + "--locked XF86AudioNext" = "exec playerctl next"; + "--locked XF86AudioPrev" = "exec playerctl previous"; /* "XF86MonBrightnessUp" = " exec swayosd-client --brightness 10"; diff --git a/nixos/foxtrot.nix b/nixos/foxtrot.nix index 135d453..579d661 100644 --- a/nixos/foxtrot.nix +++ b/nixos/foxtrot.nix @@ -20,7 +20,7 @@ ]; # findmnt -no UUID -T /swap/swapfile boot.resumeDevice = "/dev/disk/by-uuid/81c3354a-f629-4b6b-a249-7705aeb9f0d5"; - systemd.sleep.extraConfig = "HibernateDelaySec=30m"; + systemd.sleep.extraConfig = "HibernateDelaySec=121m"; services.fwupd.enable = true; services.fwupd.extraRemotes = ["lvfs-testing"]; @@ -178,7 +178,7 @@ }; services.fprintd = { - enable = true; + enable = false; package = pkgs.fprintd.overrideAttrs { # Source: https://github.com/NixOS/nixpkgs/commit/87ca2dc071581aea0e691c730d6844f1beb07c9f mesonCheckFlags = [ From b8ac83f1a127836d662d7facb73086a0c0973a17 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 17 Sep 2024 12:12:40 -0500 Subject: [PATCH 2/5] Add comment with pipewire profile for fw13 speakers --- nixos/foxtrot.nix | 242 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 241 insertions(+), 1 deletion(-) diff --git a/nixos/foxtrot.nix b/nixos/foxtrot.nix index 579d661..07d67e5 100644 --- a/nixos/foxtrot.nix +++ b/nixos/foxtrot.nix @@ -1,4 +1,244 @@ -{pkgs, ...}: { +{pkgs, ...}: +/* +## source: https://community.frame.work/t/speakers-sound-quality/1078/82 +let + pipewire-speakers-profile-json = ''{ + "output": { + "blocklist": [], + "equalizer": { + "balance": 0.0, + "bypass": false, + "input-gain": 0.0, + "left": { + "band0": { + "frequency": 100.0, + "gain": 0.0, + "mode": "RLC (BT)", + "mute": false, + "q": 1.0, + "slope": "x4", + "solo": false, + "type": "Hi-pass" + }, + "band1": { + "frequency": 150.0, + "gain": 4.02, + "mode": "RLC (BT)", + "mute": false, + "q": 3.0, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band2": { + "frequency": 600.0, + "gain": -5.07, + "mode": "RLC (BT)", + "mute": false, + "q": 4.000000000000008, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band3": { + "frequency": 1200.0, + "gain": -3.49, + "mode": "RLC (BT)", + "mute": false, + "q": 4.17, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band4": { + "frequency": 2000.0, + "gain": 1.43, + "mode": "RLC (BT)", + "mute": false, + "q": 4.0, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band5": { + "frequency": 5300.0, + "gain": 3.84, + "mode": "RLC (BT)", + "mute": false, + "q": 2.64, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band6": { + "frequency": 6000.0, + "gain": 4.02, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Hi-shelf" + }, + "band7": { + "frequency": 7500.0, + "gain": -2.09, + "mode": "RLC (BT)", + "mute": false, + "q": 3.0, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band8": { + "frequency": 8000.0, + "gain": 2.01, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band9": { + "frequency": 900.0, + "gain": -4.12, + "mode": "RLC (BT)", + "mute": false, + "q": 5.909999999999967, + "slope": "x1", + "solo": false, + "type": "Bell" + } + }, + "mode": "IIR", + "num-bands": 10, + "output-gain": -1.5, + "pitch-left": 0.0, + "pitch-right": 0.0, + "right": { + "band0": { + "frequency": 100.0, + "gain": 0.0, + "mode": "RLC (BT)", + "mute": false, + "q": 1.0, + "slope": "x4", + "solo": false, + "type": "Hi-pass" + }, + "band1": { + "frequency": 150.0, + "gain": 4.02, + "mode": "RLC (BT)", + "mute": false, + "q": 3.0, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band2": { + "frequency": 600.0, + "gain": -5.07, + "mode": "RLC (BT)", + "mute": false, + "q": 4.000000000000008, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band3": { + "frequency": 1200.0, + "gain": -3.49, + "mode": "RLC (BT)", + "mute": false, + "q": 4.17, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band4": { + "frequency": 2000.0, + "gain": 1.43, + "mode": "RLC (BT)", + "mute": false, + "q": 4.0, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band5": { + "frequency": 5300.0, + "gain": 3.84, + "mode": "RLC (BT)", + "mute": false, + "q": 2.64, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band6": { + "frequency": 6000.0, + "gain": 4.02, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Hi-shelf" + }, + "band7": { + "frequency": 7500.0, + "gain": -2.09, + "mode": "RLC (BT)", + "mute": false, + "q": 3.0, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band8": { + "frequency": 8000.0, + "gain": 2.01, + "mode": "RLC (BT)", + "mute": false, + "q": 4.36, + "slope": "x1", + "solo": false, + "type": "Bell" + }, + "band9": { + "frequency": 900.0, + "gain": -4.12, + "mode": "RLC (BT)", + "mute": false, + "q": 5.909999999999967, + "slope": "x1", + "solo": false, + "type": "Bell" + } + }, + "split-channels": false + }, + "loudness": { + "bypass": false, + "clipping": false, + "clipping-range": 6.0, + "fft": "4096", + "input-gain": 0.0, + "output-gain": 0.0, + "std": "ISO226-2003", + "volume": 6.999999999999991 + }, + "plugins_order": [ + "loudness", + "equalizer" + ] + } +}''; +in +*/ +{ imports = [ { system.stateVersion = "24.05"; From 1469810d2be35e756cdd5b53e4d50e185b473bf3 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 18 Sep 2024 09:43:31 -0500 Subject: [PATCH 3/5] laptop monitor above --- modules/home-manager/fish/shellInit.fish | 2 ++ nixos/foxtrot.nix | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/fish/shellInit.fish b/modules/home-manager/fish/shellInit.fish index 4b5ffc0..66a3a84 100644 --- a/modules/home-manager/fish/shellInit.fish +++ b/modules/home-manager/fish/shellInit.fish @@ -42,6 +42,8 @@ if has_command skim set --export --universal SKIM_CTRL_T_COMMAND "fd --hidden" end +set --export --universal NEWT_COLORS "root=black,black:border=black,blue" + # colors set -U fish_color_normal normal # default color set -U fish_color_command white # base command being run (>ls< -la) diff --git a/nixos/foxtrot.nix b/nixos/foxtrot.nix index 07d67e5..2fc5f12 100644 --- a/nixos/foxtrot.nix +++ b/nixos/foxtrot.nix @@ -317,10 +317,15 @@ in output = { "BOE NE135A1M-NY1 Unknown" = { mode = "2880x1920@120Hz"; - position = "0,0"; + position = "1092,2160"; scale = toString 1.75; }; + "Dell Inc. DELL U2720Q CWTM623" = { + mode = "3840x2160@60Hz"; + position = "0,0"; + }; + /* "BOE 0x0BCA Unknown" = { mode = "2256x1504@60Hz"; From a33de2c711f08fa83a62d16f5bc68792ce8262fa Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sun, 22 Sep 2024 20:20:15 -0500 Subject: [PATCH 4/5] Some cleanup, plasma6 out by default --- flake.nix | 2 +- modules/home-manager/sway.nix | 4 ++-- modules/nixos/default.nix | 18 +++++++++++++++++- nixos/foxtrot.nix | 17 ----------------- nixos/thablet.nix | 23 +++++++++++++++++++---- 5 files changed, 39 insertions(+), 25 deletions(-) diff --git a/flake.nix b/flake.nix index 24c67f8..a2d12e5 100644 --- a/flake.nix +++ b/flake.nix @@ -364,10 +364,10 @@ home-manager-defaults hardware.nixosModules.common-pc-ssd - common gaming graphical-workstation + plasma6 ./nixos/htpc.nix diff --git a/modules/home-manager/sway.nix b/modules/home-manager/sway.nix index e644688..af49e3b 100644 --- a/modules/home-manager/sway.nix +++ b/modules/home-manager/sway.nix @@ -152,8 +152,8 @@ ]; } {command = "mako";} - {command = "firefox";} - {command = "wezterm";} + # {command = "firefox";} + # {command = "wezterm";} ]; modes = { diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 01296af..d0acb27 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -403,6 +403,19 @@ ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness" ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness" ''; + + services.upower.enable = true; + + # NOTE: I previously let plasma settings handle this + services.logind = { + lidSwitch = "suspend-then-hibernate"; + extraConfig = '' + HandleLidSwitchDocked=ignore + HandlePowerKey=suspend-then-hibernate + IdleActionSec=11m + IdleAction=suspend-then-hibernate + ''; + }; }; emacs = {pkgs, ...}: { @@ -568,7 +581,6 @@ ... }: { imports = with nixosModules; [ - plasma6 sway # hyprland enable-flatpaks-and-appimages @@ -931,6 +943,10 @@ TODO: powersave? TODO: can I pre-configure my usual wifi networks with SSIDs and PSKs loaded from secrets? */ + hardware.wirelessRegulatoryDatabase = true; + boot.extraModprobeConfig = '' + options cfg80211 ieee80211_regdom="US" + ''; }; steam = {pkgs, ...}: { diff --git a/nixos/foxtrot.nix b/nixos/foxtrot.nix index 2fc5f12..08bf9c8 100644 --- a/nixos/foxtrot.nix +++ b/nixos/foxtrot.nix @@ -246,8 +246,6 @@ in networking.hostName = "foxtrot"; } { - # laptop power management - services.upower.enable = true; swapDevices = [ # TODO: move this to disko? # NOTE(oninstall): @@ -263,17 +261,6 @@ in systemd.sleep.extraConfig = "HibernateDelaySec=121m"; services.fwupd.enable = true; services.fwupd.extraRemotes = ["lvfs-testing"]; - - # NOTE: I previously let plasma settings handle this - services.logind = { - lidSwitch = "suspend-then-hibernate"; - extraConfig = '' - HandleLidSwitchDocked=ignore - HandlePowerKey=suspend-then-hibernate - IdleActionSec=11m - IdleAction=suspend-then-hibernate - ''; - }; } ]; @@ -356,7 +343,6 @@ in ]; networking.networkmanager.wifi.powersave = false; - hardware.wirelessRegulatoryDatabase = true; hardware.framework.amd-7040.preventWakeOnAC = true; @@ -400,9 +386,6 @@ in ]; initrd.availableKernelModules = ["xhci_pci" "nvme" "thunderbolt"]; kernelModules = ["kvm-amd"]; - extraModprobeConfig = '' - options cfg80211 ieee80211_regdom="US" - ''; }; hardware.bluetooth = { enable = true; diff --git a/nixos/thablet.nix b/nixos/thablet.nix index 42c0a48..2d454a7 100644 --- a/nixos/thablet.nix +++ b/nixos/thablet.nix @@ -5,9 +5,6 @@ }: { networking.hostName = "thablet"; - home-manager.users.daniel = { - }; - boot.loader.systemd-boot.enable = true; services.fprintd = { @@ -48,7 +45,11 @@ hardware.bluetooth = { enable = true; - powerOnBoot = true; + powerOnBoot = false; + }; + + services.power-profiles-daemon = { + enable = true; }; networking = { @@ -61,5 +62,19 @@ }; }; + home-manager.users.daniel = { + wayland.windowManager.sway = { + config = { + output = { + "AU Optronics 0x2236 Unknown" = { + mode = "2560x1440@60Hz"; + position = "0,0"; + scale = toString 1.25; + }; + }; + }; + }; + }; + system.stateVersion = "24.05"; } From 9cc15d53faaceac0b9b406f67fbacc55089148f1 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 23 Sep 2024 10:21:22 -0500 Subject: [PATCH 5/5] Add comma --- modules/nixos/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index d0acb27..83bbbab 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -552,6 +552,7 @@ hexyl pkgs.unixtools.xxd usbutils + comma ]; };