feat(nix/home-manager): add radicale module with decsync storage
This commit is contained in:
parent
82ccb8fb24
commit
1bf8337e49
4 changed files with 57 additions and 0 deletions
55
nix/home-manager/programs/radicale.nix
Normal file
55
nix/home-manager/programs/radicale.nix
Normal file
|
@ -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" ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue