fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6cfg = config . services . pantalaimon ; 7 8iniFmt = pkgs . formats . ini { }; 9in { 10meta . maintainers = [ maintainers . jojosch ]; 11 12options = { 13services . pantalaimon = { 14enable = mkEnableOption 15"Pantalaimon, an E2EE aware proxy daemon for matrix clients" ; 16 17package = mkOption { 18type = types . package ; 19default = pkgs . pantalaimon ; 20defaultText = literalExpression "pkgs.pantalaimon" ; 21description = 22"Package providing the {command}`pantalaimon` executable to use." ; 23}; 24 25settings = mkOption { 26type = iniFmt . type ; 27default = { }; 28defaultText = literalExpression "{ }" ; 29example = literalExpression '' 30{ 31Default = { 32LogLevel = "Debug"; 33SSL = true; 34}; 35local-matrix = { 36Homeserver = "https://matrix.org"; 37ListenAddress = "127.0.0.1"; 38ListenPort = 8008; 39}; 40} 41'' ; 42description = '' 43Configuration written to 44{file}`$XDG_CONFIG_HOME/pantalaimon/pantalaimon.conf`. 45 46See <https://github.com/matrix-org/pantalaimon/blob/master/docs/manpantalaimon.5.md> or 47{manpage}`pantalaimon(5)` 48for options. 49'' ; 50}; 51}; 52}; 53 54config = mkIf cfg . enable { 55assertions = [ 56( lib . hm . assertions . assertPlatform "services.pantalaimon" pkgs 57lib . platforms . linux ) 58]; 59 60home . packages = [ cfg . package ]; 61 62systemd . user . services = { 63pantalaimon = { 64Unit = { 65Description = 66"Pantalaimon - E2EE aware proxy daemon for matrix clients" ; 67After = [ "network-online.target" ]; 68}; 69 70Service = { 71ExecStart = " ${ cfg . package } /bin/pantalaimon -c ${ 72iniFmt . generate "pantalaimon.conf" cfg . settings 73} " ; 74Restart = "on-failure" ; 75}; 76 77Install . WantedBy = [ "default.target" ]; 78}; 79}; 80}; 81}