add basic nixosModule for tasklist
This commit is contained in:
53
flake.nix
53
flake.nix
@@ -3,9 +3,58 @@
|
||||
|
||||
outputs = { self, nixpkgs }: {
|
||||
|
||||
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
|
||||
packages.x86_64-linux.tasklist = nixpkgs.legacyPackages.x86_64-linux.buildGoModule rec {
|
||||
pname = "tasklist";
|
||||
version = "1.0";
|
||||
vendorHash = "sha256-olHQNClxU4sykBlhlbvTL6wCUYkMxnaQdLnRwvuJffw=";
|
||||
src = ./.;
|
||||
};
|
||||
|
||||
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
|
||||
nixosModules.malobeo-tasklist = { config, ... }:
|
||||
let
|
||||
cfg = config.services.malobeo-tasklist;
|
||||
tasklist-pkg = self.packages.x86_64-linux.tasklist;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
services.malobeo-tasklist = {
|
||||
enable = nixpkgs.lib.mkOption {
|
||||
default = false;
|
||||
type = nixpkgs.types.bool;
|
||||
description = nixpkgs.lib.mdDoc ''
|
||||
Enables tasklist
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = nixpkgs.lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ tasklist-pkg];
|
||||
|
||||
users.users = {
|
||||
malobeo-tasklist = {
|
||||
description = "malobeo tasklist user";
|
||||
group = "malobeo-tasklist";
|
||||
isNormalUser = true;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.malobeo-tasklist = {
|
||||
description = "malobeo tasklist daemon";
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${tasklist-pkg}/bin/tasklist -d /var/lib/malobeo-tasklist/tasklist.db";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
|
||||
wantedBy = [ "default.target" ];
|
||||
|
||||
environment = {
|
||||
USER = "malobeo-tasklist";
|
||||
HOME = /var/lib/malobeo-tasklist;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user