feat(sleep-or-die): fix my sleep schedule
This commit is contained in:
parent
85701e0e29
commit
6d555ec898
9 changed files with 141 additions and 5 deletions
17
flake.lock
generated
17
flake.lock
generated
|
@ -235,6 +235,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gimp-nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1735507908,
|
||||
"narHash": "sha256-VA+khC0S0di6w5Yv1kBNRpAihnt2prT/ehQzsKMhEoA=",
|
||||
"owner": "jtojnar",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "771cf18187fefcfaababd35834917c621447fee8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "jtojnar",
|
||||
"ref": "gimp-meson",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks-nix": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
|
@ -610,6 +626,7 @@
|
|||
"chaotic": "chaotic",
|
||||
"disko": "disko",
|
||||
"flake-parts": "flake-parts",
|
||||
"gimp-nixpkgs": "gimp-nixpkgs",
|
||||
"git-hooks-nix": "git-hooks-nix",
|
||||
"hetch": "hetch",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
|
|
|
@ -65,6 +65,12 @@
|
|||
url = "https://codeberg.org/amadaluzia/alqages.git";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
gimp-nixpkgs = {
|
||||
type = "github";
|
||||
owner = "jtojnar";
|
||||
repo = "nixpkgs";
|
||||
ref = "gimp-meson";
|
||||
};
|
||||
};
|
||||
outputs = inputs @ {flake-parts, ...}:
|
||||
flake-parts.lib.mkFlake {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -508,6 +508,6 @@ binds {
|
|||
}
|
||||
|
||||
cursor {
|
||||
xcursor-theme "Simp1e-Nord-Dark"
|
||||
xcursor-theme "Simp1e-Gruvbox-Dark"
|
||||
xcursor-size 24
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
75
hosts/shared/alarm-clock.nix
Normal file
75
hosts/shared/alarm-clock.nix
Normal 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
23
hosts/shared/nushell.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
BIN
media/king_von.png
Normal file
BIN
media/king_von.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
BIN
media/majoras_mask_bell.wav
Normal file
BIN
media/majoras_mask_bell.wav
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue