-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hosts] Add stopgap for ghost host to suspend instead of suspend-then…
…-hibernate
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ inputs, vars, ... }: | ||
let | ||
self = inputs.self; | ||
homeManagerConfiguration = inputs.home-manager.lib.homeManagerConfiguration; | ||
user = vars.users.aeolyus; | ||
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; | ||
in | ||
homeManagerConfiguration { | ||
inherit pkgs; | ||
extraSpecialArgs = { inherit self inputs user; }; | ||
modules = [ | ||
../../../common/nix.nix | ||
../../../home/linux/gui | ||
../../../overlays | ||
./disable-sleep.nix | ||
{ | ||
targets.genericLinux.enable = true; | ||
xdg.mime.enable = true; | ||
} | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This module makes it so that we use suspend instead of suspend-then-hibernate | ||
# | ||
# My Arch Linux installation on this host has an issue with | ||
# suspend-then-hibernate where during the transition from suspended state to | ||
# hibernation, the computer hangs indefinitely. Separately, suspend and | ||
# hibernate function as intended... | ||
# | ||
# This is a stopgap until this host is migrated to NixOS where hopefully the | ||
# issue does not persist | ||
{ pkgs, config, lib, ... }: | ||
let | ||
cfg = config.services.screen-locker; | ||
in | ||
{ | ||
systemd.user.services.xautolock-session = lib.mkForce { | ||
Service = lib.mkForce { | ||
ExecStart = lib.concatStringsSep " " ([ | ||
"${cfg.xautolock.package}/bin/xautolock" | ||
"-time 30" # minutes | ||
"-locker '${pkgs.systemd}/bin/systemctl suspend'" | ||
] ++ lib.optional cfg.xautolock.detectSleep "-detectsleep" | ||
++ cfg.xautolock.extraOptions); | ||
}; | ||
}; | ||
} |