mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-30 16:10:36 +00:00
nixos/dux-calendar: add module
This commit is contained in:
@@ -210,6 +210,7 @@
|
||||
./programs/dmrconfig.nix
|
||||
./programs/droidcam.nix
|
||||
./programs/dublin-traceroute.nix
|
||||
./programs/dux-calendar.nix
|
||||
./programs/dux-search.nix
|
||||
./programs/ente-auth.nix
|
||||
./programs/environment.nix
|
||||
|
||||
54
nixos/modules/programs/dux-calendar.nix
Normal file
54
nixos/modules/programs/dux-calendar.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.dux-calendar;
|
||||
in
|
||||
{
|
||||
options.programs.dux-calendar = {
|
||||
enable = lib.mkEnableOption "Dux Calendar, a standalone calendar application";
|
||||
|
||||
package = lib.mkPackageOption pkgs "dux-calendar" { };
|
||||
|
||||
quickshell.package = lib.mkPackageOption pkgs "quickshell" {
|
||||
extraDescription = "The Quickshell package used to run the calendar interface.";
|
||||
};
|
||||
|
||||
systemd = {
|
||||
enable = lib.mkEnableOption "starting Dux Calendar with the graphical session";
|
||||
|
||||
target = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "graphical-session.target";
|
||||
example = "wayland-session.target";
|
||||
description = "The systemd user target that starts Dux Calendar.";
|
||||
};
|
||||
|
||||
restartIfChanged = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to restart the Dux Calendar user service when its package or configuration changes.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
cfg.package
|
||||
cfg.quickshell.package
|
||||
];
|
||||
|
||||
systemd.packages = lib.mkIf cfg.systemd.enable [ cfg.package ];
|
||||
systemd.user.services.dcal = lib.mkIf cfg.systemd.enable {
|
||||
wantedBy = [ cfg.systemd.target ];
|
||||
restartIfChanged = cfg.systemd.restartIfChanged;
|
||||
path = [ cfg.quickshell.package ];
|
||||
};
|
||||
};
|
||||
|
||||
meta.teams = [ lib.teams.duxlabs ];
|
||||
}
|
||||
Reference in New Issue
Block a user