feat(sleep-or-die): fix my sleep schedule

This commit is contained in:
Artur Manuel 2025-02-24 02:50:37 +00:00
commit 6d555ec898
Signed by: amadaluzia
SSH key fingerprint: SHA256:Zwg7gBuZyaG48ucAZneJwltiXu0+tJb7c3lYt9AYlLg
9 changed files with 141 additions and 5 deletions

View file

@ -29,13 +29,26 @@
enable = true;
package = pkgs.amadaluzian-waybar;
};
sleep-or-die = {
enable = true;
title = "It's bed time, lil bro.";
message = "Go to bed now vro... you don't want to see a nice guy lose his temper... You have one hour.";
image = ../../media/king_von.png;
sound = ../../media/majoras_mask_bell.wav;
};
direnv.enable = true;
git.enable = true;
openssh.enable = true;
};
shells.xonsh = {
enable = true;
package = pkgs.amadaluzian-xonsh;
shells = {
nushell = {
enable = true;
package = pkgs.amadaluzian-nu;
};
xonsh = {
enable = true;
package = pkgs.amadaluzian-xonsh;
};
};
system.pipewire.enable = true;
wms.niri.enable = true;

View file

@ -508,6 +508,6 @@ binds {
}
cursor {
xcursor-theme "Simp1e-Nord-Dark"
xcursor-theme "Simp1e-Gruvbox-Dark"
xcursor-size 24
}

View file

@ -1,10 +1,11 @@
{
inputs,
pkgs,
config,
...
}: {
alqueva.users.artur = {
shell = pkgs.amadaluzian-nu;
shell = config.alqueva.shells.nushell.package;
tmpfiles = {
".config/qutebrowser/config.py" = ./configs/qutebrowser/config.py;
".config/qutebrowser/theme" = ./configs/qutebrowser/theme;
@ -42,6 +43,7 @@
dino
;
inherit (inputs.hetch.packages.${pkgs.system}) hetch;
inherit (inputs.gimp-nixpkgs.legacyPackages.${pkgs.system}) gimp;
};
groups = [
"wheel"

View file

@ -0,0 +1,75 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.alqueva.programs.sleep-or-die;
inherit (lib) mkOption mkEnableOption types mkIf;
sleep-or-die = let
image =
if cfg.image == null
then ""
else "-i ${cfg.image}";
sound =
if cfg.sound == null
then ""
else "ffplay -nodisp -autoexit ${cfg.sound}";
in
pkgs.writeShellApplication {
name = "sod";
runtimeInputs = [
pkgs.libnotify
pkgs.ffmpeg
];
text = ''
notify-send -u critical "${cfg.title}" "${cfg.message}" ${image}
${sound}
shutdown +60 "This was automatically invoked by 'sleep-or-die'"
'';
};
in {
options.alqueva.programs.sleep-or-die = {
enable = mkEnableOption "sleep-or-die";
title = mkOption {
type = types.str;
description = "The title of the notification";
default = "Go to sleep!";
};
message = mkOption {
type = types.str;
description = "The message of the notification";
default = "You are missing on sleep! You have one hour to use your PC before it shuts off.";
};
image = mkOption {
type = types.nullOr types.path;
description = "The image to display on the notification.";
default = null;
};
sound = mkOption {
type = types.nullOr types.path;
description = "The sound to play on notification.";
default = null;
};
startAt = mkOption {
type = types.str;
default = "20:00:00";
description = "The time to start the daemon.";
};
};
config = mkIf cfg.enable {
systemd.user.services.sleep-or-die = {
inherit (cfg) startAt;
serviceConfig = {
RestartSec = 5;
ExecStart = "${lib.getExe' sleep-or-die "sod"}";
};
};
};
}

23
hosts/shared/nushell.nix Normal file
View file

@ -0,0 +1,23 @@
{
lib,
pkgs,
config,
...
}: let
cfg = config.alqueva.shells.nushell;
in {
options.alqueva.shells.nushell = {
enable = lib.mkEnableOption "Nushell";
package = lib.mkPackageOption pkgs "nushell" {};
};
config = lib.mkIf cfg.enable {
environment = {
systemPackages = [cfg.package];
shells = [
(lib.getExe' cfg.package "nu")
"/run/current-system/sw/bin/nu"
];
};
};
}