feat: add timers service

This commit is contained in:
Moritz Böhme 2023-08-14 08:46:19 +02:00
parent 4cd51917fc
commit c99fb04f29
5 changed files with 139 additions and 1 deletions

View file

@ -533,6 +533,25 @@
"type": "github" "type": "github"
} }
}, },
"naersk": {
"inputs": {
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1686572087,
"narHash": "sha256-jXTut7ZSYqLEgm/nTk7TuVL2ExahTip605bLINklAnQ=",
"owner": "nix-community",
"repo": "naersk",
"rev": "8507af04eb40c5520bd35d9ce6f9d2342cea5ad1",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "naersk",
"type": "github"
}
},
"neovim-flake": { "neovim-flake": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
@ -788,6 +807,35 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_8": {
"locked": {
"lastModified": 1685677062,
"narHash": "sha256-zoHF7+HNwNwne2XEomphbdc4Y8tdWT16EUxUTXpOKpQ=",
"path": "/nix/store/dnqwkazyg92hzya7400klxlk072g3zsk-source",
"rev": "95be94370d09f97f6af6a1df1eb9649b5260724e",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1687103638,
"narHash": "sha256-dwy/TK6Db5W7ivcgmcxUykhFwodIg0jrRzOFt7H5NUc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "91430887645a0953568da2f3e9a3a3bb0a0378ac",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nvim-treesitter-textsubjects": { "nvim-treesitter-textsubjects": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -867,7 +915,8 @@
"rofi-wayland": "rofi-wayland", "rofi-wayland": "rofi-wayland",
"smartcolumn-nvim": "smartcolumn-nvim", "smartcolumn-nvim": "smartcolumn-nvim",
"stable": "stable", "stable": "stable",
"telekasten-nvim": "telekasten-nvim" "telekasten-nvim": "telekasten-nvim",
"timers": "timers"
} }
}, },
"rust-overlay": { "rust-overlay": {
@ -972,6 +1021,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"telekasten-nvim": { "telekasten-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -988,6 +1052,44 @@
"type": "github" "type": "github"
} }
}, },
"timers": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_9",
"utils": "utils"
},
"locked": {
"lastModified": 1690749969,
"narHash": "sha256-legyKOJljfuNrY74jsgA641E3q6hle4G6qz8YD55CgI=",
"ref": "refs/heads/main",
"rev": "e3fd65e98be42b367aef019812375e418ef77448",
"revCount": 18,
"type": "git",
"url": "https://gitea.moritzboeh.me/moritz/timers.git"
},
"original": {
"type": "git",
"url": "https://gitea.moritzboeh.me/moritz/timers.git"
}
},
"utils": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1687171271,
"narHash": "sha256-BJlq+ozK2B1sJDQXS3tzJM5a+oVZmi1q0FlBK/Xqv7M=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "abfb11bd1aec8ced1c9bb9adfe68018230f4fb3c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"wlroots": { "wlroots": {
"flake": false, "flake": false,
"locked": { "locked": {

View file

@ -68,6 +68,8 @@
# Firefox user.js # Firefox user.js
arkenfox-userjs.url = "github:arkenfox/user.js"; arkenfox-userjs.url = "github:arkenfox/user.js";
arkenfox-userjs.flake = false; arkenfox-userjs.flake = false;
timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git";
}; };
/* /*

View file

@ -78,6 +78,7 @@ in
}; };
}; };
}; };
timers.enable = true;
wireguard.enable = true; wireguard.enable = true;
}; };
}; };

View file

@ -0,0 +1,32 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.services.timers;
in
{
options.my.services.timers.enable = mkEnableOption "timers";
options.my.services.timers.package = mkOption {
type = types.package;
default = pkgs.timers;
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
systemd.user.services.timers-daemon = {
after = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
Restart = "always";
RestartSec = "1s";
ExecStart = "${getExe cfg.package} daemon";
};
};
};
}

View file

@ -10,6 +10,7 @@ final: prev:
src = inputs.rofi-wayland; src = inputs.rofi-wayland;
version = lib.my.mkVersionInput inputs.rofi-wayland; version = lib.my.mkVersionInput inputs.rofi-wayland;
}); });
timers = inputs.timers.defaultPackage.${prev.system};
fzf1 = final.writeShellApplication { fzf1 = final.writeShellApplication {
name = "fzf1"; name = "fzf1";