From 2316cb2d9c44a929961198d0fb2b92e4a69f4585 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 3 Dec 2024 10:58:47 +0100 Subject: [PATCH 1/4] fix(notify): Switch to Pipewire --- scripts/notify.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/notify.sh b/scripts/notify.sh index a9453d5..698993e 100755 --- a/scripts/notify.sh +++ b/scripts/notify.sh @@ -22,15 +22,15 @@ while getopts ":bvt:p:" options; do ;; v) # Get volume (don't use pamixer because that is way slower) - value=$( amixer sget 'Master' \ - | grep -o '\[[0-9]*%\]' \ - | tr -d '][%' \ - | head -n1 ) + value=$( pactl get-sink-volume @DEFAULT_SINK@ \ + | grep -o '[0-9]*%' \ + | tr -d '%' \ + | head -n1 ) title="Volume: ${value}%" category='sysinfo' # If audio disabled, set value to zero. - if [ "$( amixer sget 'Master' | grep -o '\[\(on\|off\)\]' | head -n1 )" == "[off]" ] ; then + if [ "$( pactl get-sink-mute @DEFAULT_SINK@ | grep -o '\(yes\|no\)' | head -n1 )" == 'yes' ] ; then title="Volume: ${value}% (Disabled)" value=0 fi From fb9cd8b9e957328b6332f6a4ba4201f9bebe36db Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 10 Dec 2024 15:52:37 +0100 Subject: [PATCH 2/4] fix(audio): Fix popping after audio suspend --- nixos/modules/services/pipewire/default.nix | 22 +++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/pipewire/default.nix b/nixos/modules/services/pipewire/default.nix index 09393f0..b83eedc 100644 --- a/nixos/modules/services/pipewire/default.nix +++ b/nixos/modules/services/pipewire/default.nix @@ -6,8 +6,6 @@ in { options.sisyphus.services.pipewire.enable = lib.mkEnableOption "Pipewire"; config = lib.mkIf cfg.enable { - sound.enable = true; - hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; @@ -20,6 +18,26 @@ in { # use the example session manager (no others are packaged yet so this is enabled by default, # no need to redefine it in your config for now) #media-session.enable = true; + + wireplumber = { + enable = true; + # Fix pops after silence + extraConfig."99-disable-suspend" = { + "monitor.alsa.rules" = [ + { + matches = [ + # Headphone jack on laptop + { "node.name" = "alsa_output.pci-0000_00_1f.3.analog-stereo"; } + ]; + actions = { + update-props = { + "session.suspend-timeout-seconds" = 0; + }; + }; + } + ]; + }; + }; }; }; } From c416cbaab9441dbd0d0e2ae35f0c95adbddaa476 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sun, 26 Jan 2025 22:12:27 +0100 Subject: [PATCH 3/4] chore(script): Improve toggle-light-dark --- scripts/toggle-light-dark.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/scripts/toggle-light-dark.sh b/scripts/toggle-light-dark.sh index ec38506..80e4d0d 100755 --- a/scripts/toggle-light-dark.sh +++ b/scripts/toggle-light-dark.sh @@ -30,6 +30,10 @@ declare -A wallpaper wallpaper[${THEME_LIGHT}]="bg-light" wallpaper[${THEME_DARK}]="bg-dark" +declare -A icon +icon[${THEME_LIGHT}]="\uf185" +icon[${THEME_DARK}]="\uf186" + ############# ### Logic ### ############# @@ -48,14 +52,14 @@ while getopts ":m:g" option; do fi ;; g) - previous_theme="$(cat ${STATE_FILE})" - if [ "${previous_theme}" == "${THEME_LIGHT}" ]; then - class="activated" - percentage=1 - else - percentage=0 + current_state="$(cat "${STATE_FILE}")" + next_state="${theme_next[${current_state}]}" + if [ "${current_state}" == "${THEME_DARK}" ]; then + class='activated' + percentage=100 fi - printf '{ "class": "%s", "percentage": %d }' "${class}" "${percentage}" + printf '{"text": "%s", "alt": "%s", "tooltip": "Set theme to %s", "percentage": %d, "class": "%s"}' \ + "${icon[${current_state}]}" "${gsettings_alt[${next_state}]}" "${next_state}" "${percentage:=0}" "${class:="none"}" exit 0 ;; *) @@ -119,7 +123,12 @@ fi # Sway if [ "$(command -v swaybg)" ]; then bg_path="${BG_DIR}/${wallpaper[${theme}]}" - /run/current-system/sw/bin/cp "${bg_path}" "${STATE_DIR}/bg" && swaymsg reload & + /run/current-system/sw/bin/cp "${bg_path}" "${STATE_DIR}/bg" + if [ "$(command -v swaymsg)" ]; then + pkill swaybg && swaymsg exec "swaybg -m fill -i ${STATE_DIR}/bg" & + elif [ "$(command -v hyprctl)" ]; then + pkill swaybg && hyprctl keyword exec "swaybg -m fill -i ${STATE_DIR}/bg" & + fi fi # Vifm From c653e73f2ec340bf7a187bcea3667bee6e761222 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 21 Feb 2025 20:25:06 +0100 Subject: [PATCH 4/4] chore: Upgrade to 24.11 --- nixos/flake.nix | 8 ++++---- nixos/modules/desktop/sway/default.nix | 6 ++---- nixos/modules/hardware/nvidia/default.nix | 3 +-- nixos/modules/nix/flakes/default.nix | 2 +- nixos/modules/virtualisation/docker/default.nix | 2 ++ nixos/users/tdpeuter/default.nix | 4 +++- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/nixos/flake.nix b/nixos/flake.nix index cda9173..95ac77c 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -2,7 +2,7 @@ description = "System configuration of my machines using flakes"; inputs = { - nixpkgs.url = "nixpkgs/nixos-24.05"; + nixpkgs.url = "nixpkgs/nixos-24.11"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; devshell = { @@ -11,7 +11,7 @@ }; flake-utils.url = "github:numtide/flake-utils"; home-manager = { - url = "github:nix-community/home-manager/release-24.05"; + url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; openconnect-sso = { @@ -41,9 +41,9 @@ unfreePackages = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "corefonts" "nvidia-settings" "nvidia-x11" "nvidia-persistenced" - "Oracle_VM_VirtualBox_Extension_Pack" + "Oracle_VirtualBox_Extension_Pack" "spotify" - "steam" "steam-original" "steam-run" + "steam" "steam-unwrapped" "steam-run" "vista-fonts" "nvidia-persistenced" # Docker ]; diff --git a/nixos/modules/desktop/sway/default.nix b/nixos/modules/desktop/sway/default.nix index bab109b..055bfb0 100644 --- a/nixos/modules/desktop/sway/default.nix +++ b/nixos/modules/desktop/sway/default.nix @@ -101,11 +101,9 @@ in { dejavu_fonts font-awesome noto-fonts - noto-fonts-cjk + noto-fonts-cjk-sans + noto-fonts-cjk-serif noto-fonts-emoji - source-han-sans - source-han-sans-japanese - source-han-serif-japanese ]; security.polkit.enable = true; diff --git a/nixos/modules/hardware/nvidia/default.nix b/nixos/modules/hardware/nvidia/default.nix index f4a0248..2b811fc 100644 --- a/nixos/modules/hardware/nvidia/default.nix +++ b/nixos/modules/hardware/nvidia/default.nix @@ -37,9 +37,8 @@ in { # }; hardware = { - opengl = { + graphics = { enable = true; - driSupport = true; driSupport32Bit = true; }; diff --git a/nixos/modules/nix/flakes/default.nix b/nixos/modules/nix/flakes/default.nix index 3c5d892..aeaf3c1 100644 --- a/nixos/modules/nix/flakes/default.nix +++ b/nixos/modules/nix/flakes/default.nix @@ -9,6 +9,6 @@ in { extraOptions = '' experimental-features = nix-command flakes ''; - package = pkgs.nixFlakes; + package = pkgs.nixVersions.stable; }; } diff --git a/nixos/modules/virtualisation/docker/default.nix b/nixos/modules/virtualisation/docker/default.nix index 51b9319..b48ae5e 100644 --- a/nixos/modules/virtualisation/docker/default.nix +++ b/nixos/modules/virtualisation/docker/default.nix @@ -10,6 +10,8 @@ in { enable = true; # Because these are made for development purposes and not for servers enableOnBoot = false; + + daemon.settings.features.cdi = true; }; # Updated version of deprecated enableNvidia. diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index 035bccf..6c1fcf3 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -39,8 +39,10 @@ in { corefonts # Calibri for Uni font-awesome # Dependency of Vifm & zsh config letter # Personal font - noto-fonts-cjk # Dependency of Zellij config + noto-fonts-cjk-sans # Dependency of Zellij config + noto-fonts-cjk-serif # Dependency of Zellij config noto-fonts # Dependency of Zellij config + noto-fonts-emoji # Dependency of Zellij config noto-fonts-color-emoji # Emoji's! vistafonts # Microsoft fonts ];