Skip to content

Commit f0a9ba8

Browse files
committed
autosave (pavel-fw / Linux)
1 parent f24cb40 commit f0a9ba8

File tree

6 files changed

+10
-205
lines changed

6 files changed

+10
-205
lines changed

hosts/pavel-am5/cfg-pavel-am5.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@
185185
desktop.cosmic.enable = true;
186186
# desktop.cosmic.minimal-keybindings = true;
187187

188-
audio.autoswitch = {
189-
enable = true;
190-
formFactors = [ "headset" "headphone" ];
191-
};
192-
193188
gaming.steam.enable = true;
194189

195190
desktop.plymouth.enable = true;

hosts/pavel-fw/cfg-pavel-fw.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ in
109109
};
110110
desktop.gnome.fractional-scaling.enable = true;
111111
desktop.gnome.vrr.enable = true;
112-
desktop.gnome.framework-fan-control.enable = false;
113112
desktop.gnome.gdm.monitors-xml = ./monitors.xml;
114113
desktop.gnome.touchpad.disableWhileTyping = true;
115114

modules/nixos/_imports.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
./alien-filesystems.nix
33
./amnezia-vpn.nix
44
./audio.nix
5-
./audio-autoswitch.nix
65
./btrfs-snapshots.nix
76
./bluetooth.nix
87
./bootloader-grub.nix

modules/nixos/audio-autoswitch.nix

Lines changed: 0 additions & 133 deletions
This file was deleted.

modules/nixos/gnome-extensions.nix

Lines changed: 9 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
let
44
hibernateCfg = config.smind.power-management.hibernate;
5-
fanControlCfg = config.smind.desktop.gnome.framework-fan-control;
6-
batteryHealthCfg = config.smind.desktop.gnome.battery-health-charging;
75
kanataSwitcherCfg = config.smind.keyboard.super-remap.kanata-switcher;
86
extCfg = config.smind.desktop.gnome.extensions;
97

@@ -18,16 +16,6 @@ let
1816
hibernateExtensionPatched = patchGnomeExtension pkgs.gnomeExtensions.hibernate-status-button;
1917
roundedWindowCornersRebornPatched = patchGnomeExtension pkgs.gnomeExtensions.rounded-window-corners-reborn;
2018

21-
# Patch battery-health-charging to use NixOS paths instead of /usr/local/bin
22-
batteryHealthChargingPatched = pkgs.gnomeExtensions.battery-health-charging.overrideAttrs (old: {
23-
postPatch = (old.postPatch or "") + ''
24-
# Replace hardcoded /usr/local/bin path with NixOS system path
25-
substituteInPlace lib/driver.js \
26-
--replace-fail '/usr/local/bin/batteryhealthchargingctl-''${user}' \
27-
'/run/current-system/sw/bin/batteryhealthchargingctl'
28-
'';
29-
});
30-
3119
ghosttyCfg = config.smind.desktop.gnome.ghostty-toggle;
3220

3321
extensions = with pkgs; [
@@ -57,16 +45,10 @@ let
5745
++ lib.optional extCfg.no-overview.enable pkgs.gnomeExtensions.no-overview
5846
++ lib.optional hibernateCfg.enable hibernateExtensionPatched
5947
++ lib.optional config.smind.desktop.gnome.sticky-keys.enable gnomeExtensions.keyboard-modifiers-status
60-
++ lib.optional fanControlCfg.enable gnomeExtensions.framework-fan-control
61-
++ lib.optional batteryHealthCfg.enable batteryHealthChargingPatched
6248
++ lib.optional kanataSwitcherCfg.enable config.services.kanata-switcher.gnomeExtension.package;
6349
in
6450
{
6551
options = {
66-
smind.desktop.gnome.framework-fan-control.enable = lib.mkEnableOption "Framework fan control GNOME extension for Framework laptops";
67-
68-
smind.desktop.gnome.battery-health-charging.enable = lib.mkEnableOption "Battery Health Charging GNOME extension for laptops";
69-
7052
smind.desktop.gnome.allow-local-extensions = lib.mkEnableOption "local installation of GNOME Shell extensions (non-declaratively). When false, extension settings are locked via dconf";
7153

7254
smind.desktop.gnome.extensions = {
@@ -100,49 +82,17 @@ in
10082

10183
config = lib.mkIf config.smind.desktop.gnome.enable {
10284

103-
environment.systemPackages = extensions
104-
# Battery Health Charging extension control script (patched for NixOS)
105-
# The original script's CHECKINSTALLATION tries to compare polkit rules files
106-
# which don't exist on NixOS (we use security.polkit.extraConfig instead)
107-
++ lib.optional batteryHealthCfg.enable (pkgs.runCommand "batteryhealthchargingctl" { } ''
108-
mkdir -p $out/bin
109-
cp ${batteryHealthChargingPatched}/share/gnome-shell/extensions/Battery-Health-Charging@maniacx.github.com/resources/batteryhealthchargingctl $out/bin/batteryhealthchargingctl
110-
chmod +x $out/bin/batteryhealthchargingctl
111-
# Patch CHECKINSTALLATION case to always succeed on NixOS
112-
# We configure polkit declaratively, so no need to check file-based rules
113-
# Only replace the call site, not the function definition
114-
sed -i '/^ CHECKINSTALLATION)$/,/^ ;;$/{
115-
s/check_installation/echo "NixOS: polkit configured declaratively"; exit 0/
116-
}' $out/bin/batteryhealthchargingctl
117-
'');
85+
environment.systemPackages = extensions;
11886

11987
# Polkit rules for GNOME extensions
120-
security.polkit.extraConfig = lib.mkMerge [
121-
''
122-
// Allow any local session to claim sensors from iio-sensor-proxy (ALS)
123-
polkit.addRule(function(action, subject) {
124-
if (action.id == "net.hadess.SensorProxy.claim-sensor") {
125-
return polkit.Result.YES;
126-
}
127-
});
128-
''
129-
(lib.mkIf batteryHealthCfg.enable ''
130-
// Allow Battery Health Charging extension to set thresholds
131-
// Note: Don't check subject.active - after suspend/resume it may not be set immediately
132-
polkit.addRule(function(action, subject) {
133-
if (action.id == "org.freedesktop.policykit.exec" &&
134-
action.lookup("program") == "/run/current-system/sw/bin/batteryhealthchargingctl" &&
135-
subject.local && subject.isInGroup("wheel"))
136-
{
137-
return polkit.Result.YES;
138-
}
139-
});
140-
'')
141-
];
142-
143-
# Enable fw-fanctrl service for Framework fan control extension
144-
hardware.fw-fanctrl.enable = lib.mkIf fanControlCfg.enable true;
145-
hardware.fw-fanctrl.disableBatteryTempCheck = lib.mkIf fanControlCfg.enable true;
88+
security.polkit.extraConfig = ''
89+
// Allow any local session to claim sensors from iio-sensor-proxy (ALS)
90+
polkit.addRule(function(action, subject) {
91+
if (action.id == "net.hadess.SensorProxy.claim-sensor") {
92+
return polkit.Result.YES;
93+
}
94+
});
95+
'';
14696

14797
programs.dconf = {
14898
enable = true;
@@ -161,11 +111,6 @@ in
161111
"org/gnome/shell/extensions/run-or-raise" = {
162112
dbus = true;
163113
};
164-
} ++ lib.optional batteryHealthCfg.enable {
165-
# Tell Battery Health Charging extension that polkit is installed
166-
"org/gnome/shell/extensions/Battery-Health-Charging" = {
167-
polkit-status = "installed";
168-
};
169114
} ++ lib.optional (extCfg.dash-to-dock.enable && extCfg.dash-to-dock.unity-like-config.enable) {
170115
"org/gnome/shell/extensions/dash-to-dock" = {
171116
dock-position = "LEFT";

private

0 commit comments

Comments
 (0)