This commit is contained in:
Stuce 2025-11-16 14:07:06 +01:00
parent 3efe1dad0c
commit 1b35e333c2

View file

@ -8,7 +8,7 @@
}; };
outputs = { self, nixpkgs, ... }: { outputs = { self, nixpkgs, ... }: {
packages.x86_64-linux.default = packages.x86_64-linux.calDavToCsv =
nixpkgs.python3.pkgs.buildPythonApplication rec { nixpkgs.python3.pkgs.buildPythonApplication rec {
pname = "calDAVtoCSV"; pname = "calDAVtoCSV";
version = "0.1.0"; version = "0.1.0";
@ -30,19 +30,19 @@
maintainers = with nixpkgs.lib.maintainers; [ stuce-bot ]; maintainers = with nixpkgs.lib.maintainers; [ stuce-bot ];
}; };
}; };
nixosModules.default = { config, lib, pkgs, ... }: nixosModules.calDavToCsv = { config, lib, pkgs, ... }:
let cfg = config.services.deafault; let cfg = config.services.deafault;
in { in {
options.default = { options.calDavToCsv = {
enable = lib.mkOption { enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; calDavToCsv = false;
description = "Enable myService"; description = "Enable myService";
}; };
config = lib.mkOption { config = lib.mkOption {
type = lib.types.attrs; type = lib.types.attrs;
default = { calDavToCsv = {
calDAV = { calDAV = {
address = "localhost:5232"; address = "localhost:5232";
username = "username"; username = "username";
@ -58,7 +58,7 @@
# enable = lib.mkEnableOption "Enable calDAVtoCSV service"; # enable = lib.mkEnableOption "Enable calDAVtoCSV service";
# port = lib.mkOption { # port = lib.mkOption {
# type = lib.types.int; # type = lib.types.int;
# default = 8000; # calDavToCsv = 8000;
# description = "Port on which calDAVtoCSV will listen"; # description = "Port on which calDAVtoCSV will listen";
# }; # };
# url = lib.mkOption { # url = lib.mkOption {
@ -80,11 +80,11 @@
# "file where we need to look for password to connect, needs to be readeable by the service user"; # "file where we need to look for password to connect, needs to be readeable by the service user";
# }; # };
# }; # };
config = lib.mkIf config.default.enable { config = lib.mkIf config.calDavToCsv.enable {
environment.etc."config.ini".text = '' environment.etc."config.ini".text = ''
${lib.toIni config.default.config} ${lib.toIni config.calDavToCsv.config}
''; '';
systemd.services.default = { systemd.services.calDavToCsv = {
description = "calDAV to CSV Service"; description = "calDAV to CSV Service";
after = [ "network.target" ]; after = [ "network.target" ];
serviceConfig = { serviceConfig = {