This commit is contained in:
2025-11-03 02:08:47 +09:00
parent bc8a6a8f3f
commit c24198b171
4 changed files with 38 additions and 2 deletions
+9
View File
@@ -16,6 +16,15 @@
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
}; };
logind = {
lidSwitch = "lock"; # Lock when lid is closed
lidSwitchDocked = "ignore"; # Ignore when docked
extraConfig = ''
HandleLidSwitchExternalPower=lock
LidSwitchIgnoreInhibited=no
'';
}
}; };
} }
+26
View File
@@ -0,0 +1,26 @@
{ pkgs, lib, ... }:
let
noctaliaLock = "qs -c noctalia-shell ipc call sessionMenu lockAndSuspend";
dpmsOff = "${pkgs.niri}/bin/niri msg action power-off-monitors";
dpmsOn = "${pkgs.niri}/bin/niri msg action power-on-monitors";
in
{
services.swayidle = {
enable = true;
systemdTarget = "graphical-session.target";
timeouts = [
{ timeout = 300; command = noctaliaLock; }
{ timeout = 306; command = dpmsOff; resumeCommand = dpmsOn; }
];
events = [
{ event = "lock"; command = noctaliaLock; }
{ event = "before-sleep"; command = noctaliaLock; }
{ event = "after-resume"; command = dpmsOn; }
];
};
}
+2 -2
View File
@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, host, ... }:
{ {
home.packages = [ pkgs.openssh ]; home.packages = [ pkgs.openssh ];
@@ -18,7 +18,7 @@
umask 077 umask 077
mkdir -p "$HOME/.ssh" mkdir -p "$HOME/.ssh"
${pkgs.openssh}/bin/ssh-keygen -t ed25519 -N "" -f "$key" \ ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -N "" -f "$key" \
-C "moons@$(hostnamectl --static 2>/dev/null || echo host)" -C "moons@$(${host} || echo host)"
echo "Generated SSH key at $key" echo "Generated SSH key at $key"
fi fi
''; '';
+1
View File
@@ -18,5 +18,6 @@
./../modules/home/avatar.nix ./../modules/home/avatar.nix
./../modules/home/ghostty ./../modules/home/ghostty
./../modules/home/wallpaper.nix ./../modules/home/wallpaper.nix
./../modules/home/lock.nix
]; ];
} }