feat: work QOL features (lid turn off etc.)

This commit is contained in:
Swarsel 2024-09-04 16:16:30 +02:00
parent 23e1f73ce9
commit 74eabad262
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
12 changed files with 667 additions and 544 deletions

View file

@ -4941,6 +4941,7 @@ Also, the system state version is set here. No need to touch it.
./xdg-portal.nix ./xdg-portal.nix
# ./yubikey-touch-detector.nix # ./yubikey-touch-detector.nix
./safeeyes.nix ./safeeyes.nix
./lid.nix
]; ];
nix = nix =
@ -5013,7 +5014,7 @@ This ensures that all user-configuration happens here in the config file.
isNormalUser = true; isNormalUser = true;
description = "Leon S"; description = "Leon S";
hashedPasswordFile = lib.mkIf (!config.swarselsystems.initialSetup) config.sops.secrets.swarseluser.path; hashedPasswordFile = lib.mkIf (!config.swarselsystems.initialSetup) config.sops.secrets.swarseluser.path;
extraGroups = [ "networkmanager" "root" "docker""wheel" "lp" "audio" "video" "vboxusers" "scanner" ]; extraGroups = [ "networkmanager" "docker" "wheel" "lp" "audio" "video" "vboxusers" "scanner" ];
packages = with pkgs; [ ]; packages = with pkgs; [ ];
}; };
}; };
@ -5148,7 +5149,6 @@ Enable OpenGL, Sound, Bluetooth and various drivers.
keyboard.qmk.enable = true; keyboard.qmk.enable = true;
pulseaudio = { pulseaudio = {
enable = lib.mkIf (!config.services.pipewire.enable) true; enable = lib.mkIf (!config.services.pipewire.enable) true;
package = pkgs.pulseaudioFull; package = pkgs.pulseaudioFull;
@ -5187,6 +5187,7 @@ Pipewire handles communication on Wayland. This enables several sound tools as w
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
audio.enable = true; audio.enable = true;
wireplumber.enable = true;
alsa = { alsa = {
enable = true; enable = true;
support32Bit = true; support32Bit = true;
@ -5748,6 +5749,7 @@ Enables the blueman service including the nice system tray icon.
_: _:
{ {
services.blueman.enable = true; services.blueman.enable = true;
services.hardware.bolt.enable = true;
} }
#+end_src #+end_src
@ -6292,6 +6294,39 @@ A friend of mine used this service and I used to make fun of him. But I have to
} }
#+end_src #+end_src
**** Handle lid switch correctly
This turns off the display when the lid is closed.
#+begin_src nix :tangle profiles/common/nixos/lid.nix
{ config, pkgs, ... }:
{
services.logind = {
lidSwitch = "suspend";
lidSwitchDocked = "ignore";
};
services.acpid = {
enable = true;
lidEventCommands =
''
export PATH=$PATH:/run/current-system/sw/bin
export WAYLAND_DISPLAY=wayland-1
export XDG_RUNTIME_DIR=/run/user/1000
export SWAYSOCK=$(ls /run/user/1000/sway-ipc.* | head -n 1)
LID_STATE=$(cat /proc/acpi/button/lid/*/state | grep -q closed && echo "closed" || echo "open")
DOCKED=$(swaymsg -t get_outputs | grep -q 'HDMI\|DP' && echo "docked" || echo "undocked")
if [ "$LID_STATE" == "closed" ] && [ "$DOCKED" == "docked" ]; then
swaymsg output eDP-2 disable
else
swaymsg output eDP-2 enable
fi
'';
};
}
#+end_src
*** Optional *** Optional
:PROPERTIES: :PROPERTIES:
@ -6420,6 +6455,7 @@ Integrates 1password mostly. There are more options at [[#h:f0b2ea93-94c8-48d8-8
{ pkgs, ... }: { pkgs, ... }:
{ {
# boot.initrd.luks.yubikeySupport = true; # boot.initrd.luks.yubikeySupport = true;
programs.browserpass.enable = true;
programs._1password.enable = true; programs._1password.enable = true;
programs._1password-gui = { programs._1password-gui = {
enable = true; enable = true;
@ -6555,7 +6591,6 @@ This holds packages that I can use as provided, or with small modifications (as
picard-tools picard-tools
audacity audacity
sox sox
google-chrome
# printing # printing
cups cups
@ -7663,270 +7698,270 @@ The rest of the related configuration is found here:
- [[#h:f93f66f9-6b8b-478e-b139-b2f382c1f25e][waybarupdate]] - [[#h:f93f66f9-6b8b-478e-b139-b2f382c1f25e][waybarupdate]]
#+begin_src nix :tangle profiles/common/home/waybar.nix #+begin_src nix :tangle profiles/common/home/waybar.nix
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd = { systemd = {
enable = true; enable = true;
target = "sway-sessions.target"; target = "sway-sessions.target";
};
settings = {
mainBar = {
layer = "top";
position = "top";
modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ];
modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ];
"sway/mode" = {
format = "<span style=\"italic\" font-weight=\"bold\">{}</span>";
}; };
settings = {
mainBar = {
layer = "top";
position = "top";
modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ];
modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ];
"sway/mode" = {
format = "<span style=\"italic\" font-weight=\"bold\">{}</span>";
};
modules-right = config.swarselsystems.waybarModules; modules-right = config.swarselsystems.waybarModules;
"custom/pseudobat" = lib.mkIf (!config.swarselsystems.isLaptop) { "custom/pseudobat" = lib.mkIf (!config.swarselsystems.isLaptop) {
format = ""; format = "";
on-click-right = "wlogout -p layer-shell"; on-click-right = "wlogout -p layer-shell";
}; };
"custom/configwarn" = { "custom/configwarn" = {
exec = "waybarupdate"; exec = "waybarupdate";
interval = 60; interval = 60;
}; };
"custom/scratchpad-indicator" = { "custom/scratchpad-indicator" = {
interval = 3; interval = 3;
exec = "swaymsg -t get_tree | jq 'recurse(.nodes[]) | first(select(.name==\"__i3_scratch\")) | .floating_nodes | length | select(. >= 1)'"; exec = "swaymsg -t get_tree | jq 'recurse(.nodes[]) | first(select(.name==\"__i3_scratch\")) | .floating_nodes | length | select(. >= 1)'";
format = "{} "; format = "{} ";
on-click = "swaymsg 'scratchpad show'"; on-click = "swaymsg 'scratchpad show'";
on-click-right = "swaymsg 'move scratchpad'"; on-click-right = "swaymsg 'move scratchpad'";
}; };
"custom/github" = { "custom/github" = {
format = "{}  "; format = "{}  ";
return-type = "json"; return-type = "json";
interval = 60; interval = 60;
exec = "github-notifications"; exec = "github-notifications";
on-click = "xdg-open https://github.com/notifications"; on-click = "xdg-open https://github.com/notifications";
}; };
"custom/nix-updates" = { # "custom/nix-updates" = {
exec = "update-checker"; # exec = "update-checker";
on-click = "update-checker && notify-send 'The system has been updated'"; # on-click = "update-checker && notify-send 'The system has been updated'";
interval = "once"; # interval = "once";
tooltip = true; # tooltip = true;
return-type = "json"; # return-type = "json";
format = "{} {icon}"; # format = "{} {icon}";
format-icon = { # format-icon = {
"has-updates" = ""; # "has-updates" = "";
"updated" = " "; # "updated" = " ";
}; # };
}; # };
idle_inhibitor = { idle_inhibitor = {
format = "{icon}"; format = "{icon}";
format-icons = { format-icons = {
activated = ""; activated = "";
deactivated = ""; deactivated = "";
};
};
"group/hardware" = {
orientation = "inherit";
drawer = {
"transition-left-to-right" = false;
};
modules = [
"tray"
"temperature"
"power-profiles-daemon"
"custom/left-arrow-light"
"custom/left-arrow-dark"
"custom/scratchpad-indicator"
"custom/left-arrow-light"
"disk"
"custom/left-arrow-dark"
"memory"
"custom/left-arrow-light"
"cpu"
"custom/left-arrow-dark"
"backlight/slider"
"idle_inhibitor"
];
};
"backlight/slider" = {
min = 0;
max = 100;
orientation = "horizontal";
device = "intel_backlight";
};
power-profiles-daemon = {
format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
tooltip = true;
format-icons = {
"default" = "";
"performance" = "";
"balanced" = "";
"power-saver" = "";
};
};
temperature = {
hwmon-path = lib.mkIf (!config.swarselsystems.temperatureHwmon.isAbsolutePath) config.swarselsystems.temperatureHwmon.path;
hwmon-path-abs = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.path;
input-filename = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.input-filename;
critical-threshold = 80;
format-critical = " {temperatureC}°C";
format = " {temperatureC}°C";
};
mpris = {
format = "{player_icon} {title} <small>[{position}/{length}]</small>";
format-paused = "{player_icon} <i>{title} <small>[{position}/{length}]</small></i>";
player-icons = {
"default" = "▶ ";
"mpv" = "🎵 ";
"spotify" = " ";
};
status-icons = {
"paused" = " ";
};
interval = 1;
title-len = 20;
artist-len = 20;
album-len = 10;
};
"custom/left-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/outer-left-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/left-arrow-light" = {
format = "";
tooltip = false;
};
"custom/right-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/outer-right-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/right-arrow-light" = {
format = "";
tooltip = false;
};
"sway/workspaces" = {
disable-scroll = true;
format = "{name}";
};
"clock#1" = {
min-length = 8;
interval = 1;
format = "{:%H:%M:%S}";
# on-click-right= "gnome-clocks";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
"clock#2" = {
format = "{:%d. %B %Y}";
# on-click-right= "gnome-clocks";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
pulseaudio = {
format = "{icon} {volume:2}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "MUTE";
format-icons = {
headphones = "";
default = [
""
""
];
};
scroll-step = 1;
on-click = "pamixer -t";
on-click-right = "pavucontrol";
};
memory = {
interval = 5;
format = " {}%";
tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G";
};
cpu = {
format = config.swarselsystems.cpuString;
min-length = 6;
interval = 5;
format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];
# on-click-right= "com.github.stsdc.monitor";
on-click-right = "kitty -o confirm_os_window_close=0 btm";
};
"custom/vpn" = {
format = "()";
exec = "echo '{\"class\": \"connected\"}'";
exec-if = "test -d /proc/sys/net/ipv4/conf/tun0";
return-type = "json";
interval = 5;
};
battery = {
states = {
"warning" = 60;
"error" = 30;
"critical" = 15;
};
interval = 5;
format = "{icon} {capacity}%";
format-charging = "{capacity}% ";
format-plugged = "{capacity}% ";
format-icons = [
""
""
""
""
""
];
on-click-right = "wlogout -p layer-shell";
};
disk = {
interval = 30;
format = "Disk {percentage_used:2}%";
path = "/";
states = {
"warning" = 80;
"critical" = 90;
};
tooltip-format = "{used} used out of {total} on {path} ({percentage_used}%)\n{free} free on {path} ({percentage_free}%)";
};
tray = {
icon-size = 20;
};
network = {
interval = 5;
format-wifi = "{signalStrength}% ";
format-ethernet = "";
format-linked = "{ifname} (No IP) ";
format-disconnected = "Disconnected ⚠";
format-alt = "{ifname}: {ipaddr}/{cidr}";
tooltip-format-ethernet = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr}\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}";
tooltip-format-wifi = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr} \n{signaldBm}dBm @ {frequency}MHz\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}";
};
}; };
}; };
style = builtins.readFile ../../../programs/waybar/style.css;
"group/hardware" = {
orientation = "inherit";
drawer = {
"transition-left-to-right" = false;
};
modules = [
"tray"
"temperature"
"power-profiles-daemon"
"custom/left-arrow-light"
"custom/left-arrow-dark"
"custom/scratchpad-indicator"
"custom/left-arrow-light"
"disk"
"custom/left-arrow-dark"
"memory"
"custom/left-arrow-light"
"cpu"
"custom/left-arrow-dark"
"backlight/slider"
"idle_inhibitor"
];
};
"backlight/slider" = {
min = 0;
max = 100;
orientation = "horizontal";
device = "intel_backlight";
};
power-profiles-daemon = {
format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
tooltip = true;
format-icons = {
"default" = "";
"performance" = "";
"balanced" = "";
"power-saver" = "";
};
};
temperature = {
hwmon-path = lib.mkIf (!config.swarselsystems.temperatureHwmon.isAbsolutePath) config.swarselsystems.temperatureHwmon.path;
hwmon-path-abs = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.path;
input-filename = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.input-filename;
critical-threshold = 80;
format-critical = " {temperatureC}°C";
format = " {temperatureC}°C";
};
mpris = {
format = "{player_icon} {title} <small>[{position}/{length}]</small>";
format-paused = "{player_icon} <i>{title} <small>[{position}/{length}]</small></i>";
player-icons = {
"default" = "▶ ";
"mpv" = "🎵 ";
"spotify" = " ";
};
status-icons = {
"paused" = " ";
};
interval = 1;
title-len = 20;
artist-len = 20;
album-len = 10;
};
"custom/left-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/outer-left-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/left-arrow-light" = {
format = "";
tooltip = false;
};
"custom/right-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/outer-right-arrow-dark" = {
format = "";
tooltip = false;
};
"custom/right-arrow-light" = {
format = "";
tooltip = false;
};
"sway/workspaces" = {
disable-scroll = true;
format = "{name}";
};
"clock#1" = {
min-length = 8;
interval = 1;
format = "{:%H:%M:%S}";
# on-click-right= "gnome-clocks";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
"clock#2" = {
format = "{:%d. %B %Y}";
# on-click-right= "gnome-clocks";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
pulseaudio = {
format = "{icon} {volume:2}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "MUTE";
format-icons = {
headphones = "";
default = [
""
""
];
};
scroll-step = 1;
on-click = "pamixer -t";
on-click-right = "pavucontrol";
};
memory = {
interval = 5;
format = " {}%";
tooltip-format = "Memory: {used:0.1f}G/{total:0.1f}G\nSwap: {swapUsed}G/{swapTotal}G";
};
cpu = {
format = config.swarselsystems.cpuString;
min-length = 6;
interval = 5;
format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];
# on-click-right= "com.github.stsdc.monitor";
on-click-right = "kitty -o confirm_os_window_close=0 btm";
};
"custom/vpn" = {
format = "()";
exec = "echo '{\"class\": \"connected\"}'";
exec-if = "test -d /proc/sys/net/ipv4/conf/tun0";
return-type = "json";
interval = 5;
};
battery = {
states = {
"warning" = 60;
"error" = 30;
"critical" = 15;
};
interval = 5;
format = "{icon} {capacity}%";
format-charging = "{capacity}% ";
format-plugged = "{capacity}% ";
format-icons = [
""
""
""
""
""
];
on-click-right = "wlogout -p layer-shell";
};
disk = {
interval = 30;
format = "Disk {percentage_used:2}%";
path = "/";
states = {
"warning" = 80;
"critical" = 90;
};
tooltip-format = "{used} used out of {total} on {path} ({percentage_used}%)\n{free} free on {path} ({percentage_free}%)";
};
tray = {
icon-size = 20;
};
network = {
interval = 5;
format-wifi = "{signalStrength}% ";
format-ethernet = "";
format-linked = "{ifname} (No IP) ";
format-disconnected = "Disconnected ⚠";
format-alt = "{ifname}: {ipaddr}/{cidr}";
tooltip-format-ethernet = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr}\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}";
tooltip-format-wifi = "{ifname} via {gwaddr}: {essid} {ipaddr}/{cidr} \n{signaldBm}dBm @ {frequency}MHz\n\n⇡{bandwidthUpBytes} ⇣{bandwidthDownBytes}";
};
}; };
} };
style = builtins.readFile ../../../programs/waybar/style.css;
};
}
#+end_src #+end_src
**** Firefox **** Firefox
@ -8249,6 +8284,10 @@ Currently, I am too lazy to explain every option here, but most of it is very se
"${modifier}+Ctrl+Shift+m" = "move container to workspace 11:M"; "${modifier}+Ctrl+Shift+m" = "move container to workspace 11:M";
"${modifier}+Ctrl+s" = "workspace 12:S"; "${modifier}+Ctrl+s" = "workspace 12:S";
"${modifier}+Ctrl+Shift+s" = "move container to workspace 12:S"; "${modifier}+Ctrl+Shift+s" = "move container to workspace 12:S";
"${modifier}+Ctrl+e" = "workspace 13:E";
"${modifier}+Ctrl+Shift+e" = "move container to workspace 13:E";
"${modifier}+Ctrl+t" = "workspace 14:T";
"${modifier}+Ctrl+Shift+t" = "move container to workspace 14:T";
"${modifier}+Left" = "focus left"; "${modifier}+Left" = "focus left";
"${modifier}+Right" = "focus right"; "${modifier}+Right" = "focus right";
"${modifier}+Down" = "focus down"; "${modifier}+Down" = "focus down";
@ -8355,6 +8394,12 @@ Currently, I am too lazy to explain every option here, but most of it is very se
app_id = "firefox"; app_id = "firefox";
}; };
} }
{
command = "opacity 0.99";
criteria = {
app_id = "chromium-browser";
};
}
{ {
command = "sticky enable, shadows enable"; command = "sticky enable, shadows enable";
criteria = { criteria = {
@ -8561,51 +8606,72 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
stable.teams-for-linux stable.teams-for-linux
google-chrome
shellcheck shellcheck
dig dig
docker docker
]; ];
programs.ssh = { programs = {
matchBlocks = { git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at";
"uc" = {
hostname = "uc.clip.vbc.ac.at"; ssh = {
user = "stack"; matchBlocks = {
}; "uc" = {
"uc-stg" = { hostname = "uc.clip.vbc.ac.at";
hostname = "uc.staging.clip.vbc.ac.at"; user = "stack";
user = "stack"; };
}; "uc-stg" = {
"cbe" = { hostname = "uc.staging.clip.vbc.ac.at";
hostname = "cbe.vbc.ac.at"; user = "stack";
user = "dc_adm_schwarzaeugl"; };
}; "cbe" = {
"cbe-stg" = { hostname = "cbe.vbc.ac.at";
hostname = "cbe.staging.vbc.ac.at"; user = "dc_adm_schwarzaeugl";
user = "dc_adm_schwarzaeugl"; };
}; "cbe-stg" = {
"*.vbc.ac.at" = { hostname = "cbe.staging.vbc.ac.at";
user = "dc_adm_schwarzaeugl"; user = "dc_adm_schwarzaeugl";
};
"*.vbc.ac.at" = {
user = "dc_adm_schwarzaeugl";
};
}; };
}; };
};
programs.firefox = { firefox = {
profiles = { profiles = {
dc_adm = { dc_adm = {
id = 1; id = 1;
<<firefoxprofile>> <<firefoxprofile>>
}; };
cl_adm = { cl_adm = {
id = 2; id = 2;
<<firefoxprofile>> <<firefoxprofile>>
}; };
ws_adm = { ws_adm = {
id = 3; id = 3;
<<firefoxprofile>> <<firefoxprofile>>
};
}; };
}; };
chromium = {
enable = true;
package = pkgs.chromium;
extensions = [
# 1password
"gejiddohjgogedgjnonbofjigllpkmbf"
# dark reader
"eimadpbcbfnmbkopoojfekhnkhdbieeh"
# ublock origin
"cjpalhdlnbpafiamejdnhcphjbkeiagm"
# i still dont care about cookies
"edibdbjcniadpccecjdfdjjppcpchdlm"
# browserpass
"naepdomgkenhinolocfifgehidddafch"
];
};
}; };
xdg.desktopEntries = xdg.desktopEntries =
@ -8637,7 +8703,6 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]
}; };
}; };
programs.git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at";
} }

View file

@ -12,7 +12,6 @@
picard-tools picard-tools
audacity audacity
sox sox
google-chrome
# printing # printing
cups cups

View file

@ -80,6 +80,10 @@ in
"${modifier}+Ctrl+Shift+m" = "move container to workspace 11:M"; "${modifier}+Ctrl+Shift+m" = "move container to workspace 11:M";
"${modifier}+Ctrl+s" = "workspace 12:S"; "${modifier}+Ctrl+s" = "workspace 12:S";
"${modifier}+Ctrl+Shift+s" = "move container to workspace 12:S"; "${modifier}+Ctrl+Shift+s" = "move container to workspace 12:S";
"${modifier}+Ctrl+e" = "workspace 13:E";
"${modifier}+Ctrl+Shift+e" = "move container to workspace 13:E";
"${modifier}+Ctrl+t" = "workspace 14:T";
"${modifier}+Ctrl+Shift+t" = "move container to workspace 14:T";
"${modifier}+Left" = "focus left"; "${modifier}+Left" = "focus left";
"${modifier}+Right" = "focus right"; "${modifier}+Right" = "focus right";
"${modifier}+Down" = "focus down"; "${modifier}+Down" = "focus down";
@ -186,6 +190,12 @@ in
app_id = "firefox"; app_id = "firefox";
}; };
} }
{
command = "opacity 0.99";
criteria = {
app_id = "chromium-browser";
};
}
{ {
command = "sticky enable, shadows enable"; command = "sticky enable, shadows enable";
criteria = { criteria = {

View file

@ -45,18 +45,18 @@
on-click = "xdg-open https://github.com/notifications"; on-click = "xdg-open https://github.com/notifications";
}; };
"custom/nix-updates" = { # "custom/nix-updates" = {
exec = "update-checker"; # exec = "update-checker";
on-click = "update-checker && notify-send 'The system has been updated'"; # on-click = "update-checker && notify-send 'The system has been updated'";
interval = "once"; # interval = "once";
tooltip = true; # tooltip = true;
return-type = "json"; # return-type = "json";
format = "{} {icon}"; # format = "{} {icon}";
format-icon = { # format-icon = {
"has-updates" = ""; # "has-updates" = "";
"updated" = " "; # "updated" = " ";
}; # };
}; # };
idle_inhibitor = { idle_inhibitor = {
format = "{icon}"; format = "{icon}";

View file

@ -1,4 +1,5 @@
_: _:
{ {
services.blueman.enable = true; services.blueman.enable = true;
services.hardware.bolt.enable = true;
} }

View file

@ -34,6 +34,7 @@
./xdg-portal.nix ./xdg-portal.nix
# ./yubikey-touch-detector.nix # ./yubikey-touch-detector.nix
./safeeyes.nix ./safeeyes.nix
./lid.nix
]; ];
nix = nix =

View file

@ -15,7 +15,6 @@
keyboard.qmk.enable = true; keyboard.qmk.enable = true;
pulseaudio = { pulseaudio = {
enable = lib.mkIf (!config.services.pipewire.enable) true; enable = lib.mkIf (!config.services.pipewire.enable) true;
package = pkgs.pulseaudioFull; package = pkgs.pulseaudioFull;

View file

@ -0,0 +1,26 @@
{ config, pkgs, ... }:
{
services.logind = {
lidSwitch = "suspend";
lidSwitchDocked = "ignore";
};
services.acpid = {
enable = true;
lidEventCommands =
''
export PATH=$PATH:/run/current-system/sw/bin
export WAYLAND_DISPLAY=wayland-1
export XDG_RUNTIME_DIR=/run/user/1000
export SWAYSOCK=$(ls /run/user/1000/sway-ipc.* | head -n 1)
LID_STATE=$(cat /proc/acpi/button/lid/*/state | grep -q closed && echo "closed" || echo "open")
DOCKED=$(swaymsg -t get_outputs | grep -q 'HDMI\|DP' && echo "docked" || echo "undocked")
if [ "$LID_STATE" == "closed" ] && [ "$DOCKED" == "docked" ]; then
swaymsg output eDP-2 disable
else
swaymsg output eDP-2 enable
fi
'';
};
}

View file

@ -6,6 +6,7 @@ _: {
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
audio.enable = true; audio.enable = true;
wireplumber.enable = true;
alsa = { alsa = {
enable = true; enable = true;
support32Bit = true; support32Bit = true;

View file

@ -6,7 +6,7 @@
isNormalUser = true; isNormalUser = true;
description = "Leon S"; description = "Leon S";
hashedPasswordFile = lib.mkIf (!config.swarselsystems.initialSetup) config.sops.secrets.swarseluser.path; hashedPasswordFile = lib.mkIf (!config.swarselsystems.initialSetup) config.sops.secrets.swarseluser.path;
extraGroups = [ "networkmanager" "root" "docker" "wheel" "lp" "audio" "video" "vboxusers" "scanner" ]; extraGroups = [ "networkmanager" "docker" "wheel" "lp" "audio" "video" "vboxusers" "scanner" ];
packages = with pkgs; [ ]; packages = with pkgs; [ ];
}; };
}; };

View file

@ -3,270 +3,291 @@
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
stable.teams-for-linux stable.teams-for-linux
google-chrome
shellcheck shellcheck
dig dig
docker docker
]; ];
programs.ssh = { programs = {
matchBlocks = { git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at";
"uc" = {
hostname = "uc.clip.vbc.ac.at"; ssh = {
user = "stack"; matchBlocks = {
}; "uc" = {
"uc-stg" = { hostname = "uc.clip.vbc.ac.at";
hostname = "uc.staging.clip.vbc.ac.at"; user = "stack";
user = "stack"; };
}; "uc-stg" = {
"cbe" = { hostname = "uc.staging.clip.vbc.ac.at";
hostname = "cbe.vbc.ac.at"; user = "stack";
user = "dc_adm_schwarzaeugl"; };
}; "cbe" = {
"cbe-stg" = { hostname = "cbe.vbc.ac.at";
hostname = "cbe.staging.vbc.ac.at"; user = "dc_adm_schwarzaeugl";
user = "dc_adm_schwarzaeugl"; };
}; "cbe-stg" = {
"*.vbc.ac.at" = { hostname = "cbe.staging.vbc.ac.at";
user = "dc_adm_schwarzaeugl"; user = "dc_adm_schwarzaeugl";
};
"*.vbc.ac.at" = {
user = "dc_adm_schwarzaeugl";
};
}; };
}; };
};
programs.firefox = { firefox = {
profiles = { profiles = {
dc_adm = { dc_adm = {
id = 1; id = 1;
isDefault = false; isDefault = false;
userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css; userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css;
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ extensions = with pkgs.nur.repos.rycee.firefox-addons; [
tridactyl tridactyl
browserpass browserpass
clearurls clearurls
darkreader darkreader
enhancer-for-youtube enhancer-for-youtube
istilldontcareaboutcookies istilldontcareaboutcookies
translate-web-pages translate-web-pages
ublock-origin ublock-origin
reddit-enhancement-suite reddit-enhancement-suite
sponsorblock sponsorblock
web-archives web-archives
onepassword-password-manager onepassword-password-manager
single-file single-file
widegithub widegithub
enhanced-github enhanced-github
unpaywall unpaywall
don-t-fuck-with-paste don-t-fuck-with-paste
plasma-integration plasma-integration
]; ];
search.engines = { search.engines = {
"Nix Packages" = { "Nix Packages" = {
urls = [{ urls = [{
template = "https://search.nixos.org/packages"; template = "https://search.nixos.org/packages";
params = [ params = [
{ name = "type"; value = "packages"; } { name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; } { name = "query"; value = "{searchTerms}"; }
]; ];
}]; }];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ]; definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
}; };
search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
}; };
search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart cl_adm = {
id = 2;
}; isDefault = false;
cl_adm = { userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css;
id = 2; extensions = with pkgs.nur.repos.rycee.firefox-addons; [
tridactyl
browserpass
clearurls
darkreader
enhancer-for-youtube
istilldontcareaboutcookies
translate-web-pages
ublock-origin
reddit-enhancement-suite
sponsorblock
web-archives
onepassword-password-manager
single-file
widegithub
enhanced-github
unpaywall
don-t-fuck-with-paste
plasma-integration
];
isDefault = false; search.engines = {
userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css; "Nix Packages" = {
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ urls = [{
tridactyl template = "https://search.nixos.org/packages";
browserpass params = [
clearurls { name = "type"; value = "packages"; }
darkreader { name = "query"; value = "{searchTerms}"; }
enhancer-for-youtube ];
istilldontcareaboutcookies }];
translate-web-pages icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
ublock-origin definedAliases = [ "@np" ];
reddit-enhancement-suite };
sponsorblock
web-archives
onepassword-password-manager
single-file
widegithub
enhanced-github
unpaywall
don-t-fuck-with-paste
plasma-integration
];
search.engines = { "NixOS Wiki" = {
"Nix Packages" = { urls = [{
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}";
template = "https://search.nixos.org/packages"; }];
params = [ iconUpdateURL = "https://nixos.wiki/favicon.png";
{ name = "type"; value = "packages"; } updateInterval = 24 * 60 * 60 * 1000; # every day
{ name = "query"; value = "{searchTerms}"; } definedAliases = [ "@nw" ];
]; };
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; "NixOS Options" = {
definedAliases = [ "@np" ]; urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
}; };
search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
}; };
search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart ws_adm = {
id = 3;
}; isDefault = false;
ws_adm = { userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css;
id = 3; extensions = with pkgs.nur.repos.rycee.firefox-addons; [
tridactyl
browserpass
clearurls
darkreader
enhancer-for-youtube
istilldontcareaboutcookies
translate-web-pages
ublock-origin
reddit-enhancement-suite
sponsorblock
web-archives
onepassword-password-manager
single-file
widegithub
enhanced-github
unpaywall
don-t-fuck-with-paste
plasma-integration
];
isDefault = false; search.engines = {
userChrome = builtins.readFile ../../../programs/firefox/chrome/userChrome.css; "Nix Packages" = {
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ urls = [{
tridactyl template = "https://search.nixos.org/packages";
browserpass params = [
clearurls { name = "type"; value = "packages"; }
darkreader { name = "query"; value = "{searchTerms}"; }
enhancer-for-youtube ];
istilldontcareaboutcookies }];
translate-web-pages icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
ublock-origin definedAliases = [ "@np" ];
reddit-enhancement-suite };
sponsorblock
web-archives
onepassword-password-manager
single-file
widegithub
enhanced-github
unpaywall
don-t-fuck-with-paste
plasma-integration
];
search.engines = { "NixOS Wiki" = {
"Nix Packages" = { urls = [{
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}";
template = "https://search.nixos.org/packages"; }];
params = [ iconUpdateURL = "https://nixos.wiki/favicon.png";
{ name = "type"; value = "packages"; } updateInterval = 24 * 60 * 60 * 1000; # every day
{ name = "query"; value = "{searchTerms}"; } definedAliases = [ "@nw" ];
]; };
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; "NixOS Options" = {
definedAliases = [ "@np" ]; urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
}; };
search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
}; };
search.force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
}; };
}; };
chromium = {
enable = true;
package = pkgs.chromium;
extensions = [
# 1password
"gejiddohjgogedgjnonbofjigllpkmbf"
# dark reader
"eimadpbcbfnmbkopoojfekhnkhdbieeh"
# ublock origin
"cjpalhdlnbpafiamejdnhcphjbkeiagm"
# i still dont care about cookies
"edibdbjcniadpccecjdfdjjppcpchdlm"
# browserpass
"naepdomgkenhinolocfifgehidddafch"
];
};
}; };
xdg.desktopEntries = xdg.desktopEntries =
@ -298,6 +319,5 @@
}; };
}; };
programs.git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at";
} }

View file

@ -1,6 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
# boot.initrd.luks.yubikeySupport = true; # boot.initrd.luks.yubikeySupport = true;
programs.browserpass.enable = true;
programs._1password.enable = true; programs._1password.enable = true;
programs._1password-gui = { programs._1password-gui = {
enable = true; enable = true;