Turn monitor off when suspending or shutdown after 9pm

This commit is contained in:
Henry Hiles 2024-12-24 12:35:43 -05:00
parent 04e890ce58
commit 6e5b414ec8
4 changed files with 46 additions and 30 deletions

56
flake.lock generated
View file

@ -69,11 +69,11 @@
"firefox-gnome-theme": { "firefox-gnome-theme": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1733270341, "lastModified": 1734969791,
"narHash": "sha256-Q8W1YlsZmxhUaXLOJhPCeEzKqaqmspT9VKYZxn5Kh40=", "narHash": "sha256-A9PxLienMYJ/WUvqFie9qXrNC2MeRRYw7TG/q7DRjZg=",
"owner": "rafaelmardojai", "owner": "rafaelmardojai",
"repo": "firefox-gnome-theme", "repo": "firefox-gnome-theme",
"rev": "aa9b67045fcdec7ae045b36d7a41b36b3463b842", "rev": "92f4890bd150fc9d97b61b3583680c0524a8cafe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -175,11 +175,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1733873195, "lastModified": 1734944412,
"narHash": "sha256-dTosiZ3sZ/NKoLKQ++v8nZdEHya0eTNEsaizNp+MUPM=", "narHash": "sha256-36QfCAl8V6nMIRUCgiC79VriJPUXXkHuR8zQA1vAtSU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f26aa4b76fb7606127032d33ac73d7d507d82758", "rev": "8264bfe3a064d704c57df91e34b795b6ac7bad9e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -215,11 +215,11 @@
"umu": "umu" "umu": "umu"
}, },
"locked": { "locked": {
"lastModified": 1733821969, "lastModified": 1734831989,
"narHash": "sha256-JYAnT6hfRXdBNRCmhZa3XPFv19zbWXi8DDcY9AeNiQI=", "narHash": "sha256-YrMVnLkWxV+qmN9ZuUo00yYJFtU1r4L5ho8l3X3ScHA=",
"owner": "fufexan", "owner": "fufexan",
"repo": "nix-gaming", "repo": "nix-gaming",
"rev": "89887483a47f9e7e849d43e5992f9da54b3e8e0e", "rev": "e45e2276facb9218c119e68c45efd2f9e79d292d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -230,11 +230,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1733212471, "lastModified": 1734649271,
"narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=", "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "55d15ad12a74eb7d4646254e13638ad0c4128776", "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -258,11 +258,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1733376361, "lastModified": 1734435836,
"narHash": "sha256-aLJxoTDDSqB+/3orsulE6/qdlX6MzDLIITLZqdgMpqo=", "narHash": "sha256-kMBQ5PRiFLagltK0sH+08aiNt3zGERC2297iB6vrvlU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "929116e316068c7318c54eb4d827f7d9756d5e9c", "rev": "4989a246d7a390a859852baddb1013f825435cee",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -274,11 +274,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1733759999, "lastModified": 1734649271,
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=", "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56", "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -312,11 +312,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1733919521, "lastModified": 1734968544,
"narHash": "sha256-/UkFfezRLg/MA6q5GXCAJMGl2EWESWor+PT+xnWylnU=", "narHash": "sha256-kunOyFwo2gBEC/x4GbvOY0f34b4usonII902vxNWBo0=",
"owner": "wamserma", "owner": "wamserma",
"repo": "flake-programs-sqlite", "repo": "flake-programs-sqlite",
"rev": "0da17397073b149cca1e96e217d5952b7221c198", "rev": "5953ae011a587a6e08b340fc866e61aae2edb571",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -353,11 +353,11 @@
"tinted-tmux": "tinted-tmux" "tinted-tmux": "tinted-tmux"
}, },
"locked": { "locked": {
"lastModified": 1733858997, "lastModified": 1734885904,
"narHash": "sha256-PMZdRUZQlouWgHFCFW8ANDFL6fUjZ67KAEaqRXwRwvc=", "narHash": "sha256-NxA4JnLuXyle2/nUKDbW8vORwSd+Z20limIl7DhlZbs=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "bc25f3d69d3bb54548b772d7c2771e65cc37dc10", "rev": "4d87b96ceca38532f39c1b7efd8a9235bfcee3d6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -440,11 +440,11 @@
}, },
"locked": { "locked": {
"dir": "packaging/nix", "dir": "packaging/nix",
"lastModified": 1733509971, "lastModified": 1734207213,
"narHash": "sha256-LZIrb7HNWyLMU+dSI4fhbo2dMzJbbKKFWwYOpJwVXKE=", "narHash": "sha256-5CZPAeKm24Y1BKnN8Md3HUViCMCs7AVghRC+05Bdlkk=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "562e3900eebde0fb276dd2f425c097c8b44ccb92", "rev": "6189d0d9fd062e89a375db20aeae1d1c009e9833",
"revCount": 865, "revCount": 869,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix" "url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix"

View file

@ -1,5 +1,4 @@
{pkgs, ...}: { {pkgs, ...}: {
hardware.i2c.enable = true;
environment.systemPackages = with pkgs.gnomeExtensions; [ environment.systemPackages = with pkgs.gnomeExtensions; [
caffeine caffeine
open-bar open-bar

View file

@ -0,0 +1,17 @@
{
pkgs,
lib,
...
}: {
hardware.i2c.enable = true;
systemd.services.monitor = {
script = "if [[ $(${pkgs.coreutils}/bin/date +%H) -ge 20 ]]; then ${lib.meta.getExe pkgs.ddcutil} setvcp D6 05; fi";
wantedBy = ["suspend.target" "shutdown.target"];
before = ["suspend.target" "shutdown.target"];
serviceConfig = {
StopWhenUnneeded = true;
Type = "oneshot";
};
};
}

View file

@ -13,7 +13,6 @@
heroic heroic
aspell aspell
muzika muzika
ddcutil
fractal fractal
killall killall
ripgrep ripgrep
@ -29,6 +28,7 @@
protontricks protontricks
prismlauncher prismlauncher
android-studio android-studio
nexusmods-app-unfree
nodePackages_latest.pnpm nodePackages_latest.pnpm
hunspellDicts.en_CA-large hunspellDicts.en_CA-large
inputs.nix-gaming.packages.${system}.wine-ge inputs.nix-gaming.packages.${system}.wine-ge