diff --git a/nix/home-manager/configuration/graphical-fullblown.nix b/nix/home-manager/configuration/graphical-fullblown.nix index 71a808e..82f9728 100644 --- a/nix/home-manager/configuration/graphical-fullblown.nix +++ b/nix/home-manager/configuration/graphical-fullblown.nix @@ -26,6 +26,7 @@ in { ../programs/podman.nix ../programs/vscode ../programs/holochain-launcher.nix + ../programs/radicale.nix ]; nixpkgs.config = { diff --git a/nix/home-manager/programs/radicale.nix b/nix/home-manager/programs/radicale.nix new file mode 100644 index 0000000..b9b026f --- /dev/null +++ b/nix/home-manager/programs/radicale.nix @@ -0,0 +1,55 @@ +{ config, pkgs, lib, ... }: + +let + passwords = import ../../variables/passwords.crypt.nix; + + libdecsync = pkgs.python3Packages.buildPythonPackage rec { + pname = "libdecsync"; + version = "2.2.1"; + + src = pkgs.python3Packages.fetchPypi { + inherit pname version; + hash = "sha256-Mukjzjumv9VL+A0maU0K/SliWrgeRjAeiEdN5a83G0I="; + }; + }; + radicale-storage-decsync = pkgs.python3Packages.buildPythonPackage rec { + pname = "radicale_storage_decsync"; + version = "2.1.0"; + + src = pkgs.python3Packages.fetchPypi { + inherit pname version; + hash = "sha256-X+0MT5o2PjsKxca5EDI+rYyQDmUtbRoELDr6e4YXKCg="; + }; + + buildInputs = [ pkgs.radicale ]; + propagatedBuildInputs = [ libdecsync pkgs.python3Packages.setuptools ]; + }; + radicale-decsync = pkgs.radicale.overrideAttrs (old: { + propagatedBuildInputs = old.propagatedBuildInputs + ++ [ radicale-storage-decsync ]; + }); + radicale-config = pkgs.writeText "radicale-config" '' + [auth] + type = htpasswd + htpasswd_filename = ${ + pkgs.writeText "radicale" '' + radicale:${passwords.users.radicale} + '' + } + htpasswd_encryption = bcrypt + + [storage] + type = radicale_storage_decsync + filesystem_folder = ${config.xdg.dataHome}/radicale + decsync_dir = ${config.xdg.dataHome}/decsync + ''; +in { + systemd.user.services.radicale = { + Unit.Description = "Radicale with DecSync"; + Service = { + ExecStart = "${radicale-decsync}/bin/radicale -C ${radicale-config}"; + Restart = "on-failure"; + }; + Install.WantedBy = [ "default.target" ]; + }; +} diff --git a/nix/variables/passwords.crypt.nix b/nix/variables/passwords.crypt.nix index b18c6e4..4e27704 100644 Binary files a/nix/variables/passwords.crypt.nix and b/nix/variables/passwords.crypt.nix differ diff --git a/shell.nix b/shell.nix index a0bfe3b..e049b4f 100644 --- a/shell.nix +++ b/shell.nix @@ -24,6 +24,7 @@ in pkgs.stdenv.mkDerivation { nixUnstable niv nixos-install-tools + apacheHttpd vncdo tesseract