Merge remote-tracking branch 'origin/nixos' into nixos

This commit is contained in:
Moritz Böhme 2023-05-08 13:05:17 +02:00
commit 13883e7178
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
19 changed files with 553 additions and 199 deletions

View file

@ -30,9 +30,12 @@ in
config = mkIf cfg.enable {
my = {
programs = {
wallpaper.enable = true;
kitty.enable = true;
rofi.enable = true;
};
wallpapers.enable = true;
services.dunst.enable = true;
};
@ -95,17 +98,32 @@ in
command = "${getExe pkgs.swaylock} -fF";
}
];
timeouts = [
{
timeout = 300;
command = "${hyprland}/bin/hyprctl dispatch dpms off";
resumeCommand = "${hyprland}/bin/hyprctl dispatch dpms on";
}
{
timeout = 310;
command = "${pkgs.systemd}/bin/loginctl lock-session";
}
];
timeouts =
let
lockTimeout = 10;
in
[
{
timeout = lockTimeout * 60 - 10;
command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'";
}
{
timeout = lockTimeout * 60;
command = "${hyprland}/bin/hyprctl dispatch dpms off";
resumeCommand = "${hyprland}/bin/hyprctl dispatch dpms on";
}
{
timeout = lockTimeout * 60 + 10;
command = "${pkgs.systemd}/bin/loginctl lock-session";
}
] ++ optional
(!cfg.nvidiaSupport) # TODO https://github.com/hyprwm/Hyprland/issues/1728
[
{
timeout = 30 * 60;
command = "${pkgs.systemd}/bin/systemctl suspend-then-hibernate";
}
];
systemdTarget = "hyprland-session.target";
};
};
@ -127,33 +145,41 @@ in
};
in
{
enable = true;
partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
ExecStartPre = "${pkgs.coreutils}/bin/sleep 0.5";
ExecStart = "${getExe pkgs.hyprpaper} -c ${config}";
RestartSec = "1s";
RestartSec = "500ms";
Restart = "on-failure";
};
};
systemd.user.services.random-wallpaper = {
wantedBy = [ "graphical-session.target" ];
requires = [ "hyprpaper.service" ];
serviceConfig = {
ExecStartPre = "${pkgs.coreutils}/bin/sleep 0.5";
ExecStart = "${getExe config.my.programs.wallpaper.package} -r";
RestartSec = "500ms";
Restart = "on-failure";
};
};
# only consider graphical-session.target started when hyprland-sesstion.target is reached
systemd.user.targets.hyprland-session = {
partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
before = [ "graphical-session.target" ];
};
systemd.user.services.xdg-desktop-portal-hyprland = {
after = [ "hyprland-session.target" ];
wantedBy = [ "hyprland-session.target" ];
after = [ "hyrpland-session.target" ];
requiredBy = [ "xdg-desktop-portal.service" ];
};
home-manager.users.moritz.systemd.user.services.nextcloud-client = {
Service = {
RestartSec = "1s";
Restart = "on-failure";
};
home-manager.users.moritz.systemd.user.services.nextcloud-client.Service = {
RestartSec = "500ms";
Restart = "on-failure";
};
# add user packages for wayland and hyprland in particular
@ -214,7 +240,7 @@ in
security.rtkit.enable = true;
# dekstop portal (for screensharing)
# desktop portal (for screensharing)
xdg.portal = {
enable = true;
wlr.enable = mkForce false;