Compare commits
No commits in common. "f92b66ae1e7ed3b25f0b6c0e799d9d35372275fa" and "e0006a5ff4798ec504f94fea5da601546e5ca5e9" have entirely different histories.
f92b66ae1e
...
e0006a5ff4
@ -10,7 +10,6 @@
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./suspend-and-hibernate.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
|
||||
@ -95,9 +94,6 @@
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
home-manager = {
|
||||
extraSpecialArgs = {inherit inputs;};
|
||||
users = {
|
||||
@ -105,6 +101,9 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
@ -123,7 +122,6 @@
|
||||
clang-tools
|
||||
alejandra
|
||||
libnotify
|
||||
gnomeExtensions.hibernate-status-button
|
||||
];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
|
21
home.nix
21
home.nix
@ -8,8 +8,6 @@
|
||||
home.username = "max";
|
||||
home.homeDirectory = "/home/max";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# This value determines the Home Manager release that your configuration is
|
||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||
# introduces backwards incompatible changes.
|
||||
@ -37,18 +35,6 @@
|
||||
firefox
|
||||
thunderbird
|
||||
xournalpp
|
||||
kicad
|
||||
prismlauncher
|
||||
steam
|
||||
blender
|
||||
mpd
|
||||
mpdris2
|
||||
mpc-cli
|
||||
ymuse
|
||||
flip-link
|
||||
bacon
|
||||
probe-rs
|
||||
betaflight-configurator
|
||||
];
|
||||
|
||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||
@ -148,13 +134,6 @@
|
||||
|
||||
services.nextcloud-client.enable = true;
|
||||
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
musicDirectory = "/home/max/Music/";
|
||||
};
|
||||
|
||||
services.mpdris2.enable = true;
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
|
@ -1,41 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
hibernateEnvironment = {
|
||||
HIBERNATE_SECONDS = "300";
|
||||
HIBERNATE_LOCK = "/var/run/autohibernate.lock";
|
||||
};
|
||||
in {
|
||||
systemd.services."awake-after-suspend-for-a-time" = {
|
||||
description = "Sets up the suspend so that it'll wake for hibernation";
|
||||
wantedBy = ["suspend.target"];
|
||||
before = ["systemd-suspend.service"];
|
||||
environment = hibernateEnvironment;
|
||||
script = ''
|
||||
curtime=$(date +%s)
|
||||
echo "$curtime $1" >> /tmp/autohibernate.log
|
||||
echo "$curtime" > $HIBERNATE_LOCK
|
||||
${pkgs.utillinux}/bin/rtcwake -m no -s $HIBERNATE_SECONDS
|
||||
'';
|
||||
serviceConfig.Type = "simple";
|
||||
};
|
||||
systemd.services."hibernate-after-recovery" = {
|
||||
description = "Hibernates after a suspend recovery due to timeout";
|
||||
wantedBy = ["suspend.target"];
|
||||
after = ["systemd-suspend.service"];
|
||||
environment = hibernateEnvironment;
|
||||
script = ''
|
||||
curtime=$(date +%s)
|
||||
sustime=$(cat $HIBERNATE_LOCK)
|
||||
rm $HIBERNATE_LOCK
|
||||
if [ $(($curtime - $sustime)) -ge $HIBERNATE_SECONDS ] ; then
|
||||
systemctl hibernate
|
||||
else
|
||||
${pkgs.utillinux}/bin/rtcwake -m no -s 1
|
||||
fi
|
||||
'';
|
||||
serviceConfig.Type = "simple";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user