mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 17:17:22 +01:00
feat: work QOL features (lid turn off etc.)
This commit is contained in:
parent
23e1f73ce9
commit
74eabad262
12 changed files with 667 additions and 544 deletions
|
|
@ -1,4 +1,5 @@
|
|||
_:
|
||||
{
|
||||
services.blueman.enable = true;
|
||||
services.hardware.bolt.enable = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
./xdg-portal.nix
|
||||
# ./yubikey-touch-detector.nix
|
||||
./safeeyes.nix
|
||||
./lid.nix
|
||||
];
|
||||
|
||||
nix =
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
keyboard.qmk.enable = true;
|
||||
|
||||
|
||||
|
||||
pulseaudio = {
|
||||
enable = lib.mkIf (!config.services.pipewire.enable) true;
|
||||
package = pkgs.pulseaudioFull;
|
||||
|
|
|
|||
26
profiles/common/nixos/lid.nix
Normal file
26
profiles/common/nixos/lid.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ _: {
|
|||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
audio.enable = true;
|
||||
wireplumber.enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
isNormalUser = true;
|
||||
description = "Leon S";
|
||||
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; [ ];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue