lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nixos/hatsu: init module (#345102)

authored by

Nick Cao and committed by
GitHub
5aa30978 eea10aa8

+123
+2
nixos/doc/manual/release-notes/rl-2411.section.md
··· 84 84 alos create normal users and change passwords. Available as 85 85 [services.userborn](#opt-services.userborn.enable) 86 86 87 + - [Hatsu](https://github.com/importantimport/hatsu), a self-hosted bridge that interacts with Fediverse on behalf of your static site. Available as [services.hatsu](options.html#opt-services.hatsu). 88 + 87 89 - [Flood](https://flood.js.org/), a beautiful WebUI for various torrent clients. Available as [services.flood](options.html#opt-services.flood). 88 90 89 91 - [Firefly-iii Data Importer](https://github.com/firefly-iii/data-importer), a data importer for Firefly-III. Available as [services.firefly-iii-data-importer](options.html#opt-services.firefly-iii-data-importer)
+1
nixos/modules/module-list.nix
··· 1427 1427 ./services/web-apps/goatcounter.nix 1428 1428 ./services/web-apps/guacamole-client.nix 1429 1429 ./services/web-apps/guacamole-server.nix 1430 + ./services/web-apps/hatsu.nix 1430 1431 ./services/web-apps/healthchecks.nix 1431 1432 ./services/web-apps/hedgedoc.nix 1432 1433 ./services/web-apps/hledger-web.nix
+23
nixos/modules/services/web-apps/hatsu.md
··· 1 + # Hatsu {#module-services-hatsu} 2 + 3 + [Hatsu](https://github.com/importantimport/hatsu) is an fully-automated ActivityPub bridge for static sites. 4 + 5 + ## Quickstart {#module-services-hatsu-quickstart} 6 + 7 + the minimum configuration to start hatsu server would look like this: 8 + 9 + ```nix 10 + { 11 + services.hatsu = { 12 + enable = true; 13 + settings = { 14 + HATSU_DOMAIN = "hatsu.local"; 15 + HATSU_PRIMARY_ACCOUNT = "example.com"; 16 + }; 17 + }; 18 + } 19 + ``` 20 + 21 + this will start the hatsu server on port 3939 and save the database in `/var/lib/hatsu/hatsu.sqlite3`. 22 + 23 + Please refer to the [Hatsu Documentation](https://hatsu.cli.rs) for additional configuration options.
+97
nixos/modules/services/web-apps/hatsu.nix
··· 1 + { 2 + lib, 3 + pkgs, 4 + config, 5 + ... 6 + }: 7 + let 8 + cfg = config.services.hatsu; 9 + in 10 + { 11 + meta.doc = ./hatsu.md; 12 + meta.maintainers = with lib.maintainers; [ kwaa ]; 13 + 14 + options.services.hatsu = { 15 + enable = lib.mkEnableOption "Self-hosted and fully-automated ActivityPub bridge for static sites"; 16 + 17 + package = lib.mkPackageOption pkgs "hatsu" { }; 18 + 19 + settings = lib.mkOption { 20 + type = lib.types.submodule { 21 + freeformType = 22 + with lib.types; 23 + attrsOf ( 24 + nullOr (oneOf [ 25 + bool 26 + int 27 + port 28 + str 29 + ]) 30 + ); 31 + 32 + options = { 33 + HATSU_DATABASE_URL = lib.mkOption { 34 + type = lib.types.str; 35 + default = "sqlite:///var/lib/hatsu/hatsu.sqlite?mode=rwc"; 36 + example = "postgres://username:password@host/database"; 37 + description = "Database URL."; 38 + }; 39 + 40 + HATSU_DOMAIN = lib.mkOption { 41 + type = lib.types.str; 42 + description = "The domain name of your instance (eg 'hatsu.local')."; 43 + }; 44 + 45 + HATSU_LISTEN_HOST = lib.mkOption { 46 + type = lib.types.str; 47 + default = "127.0.0.1"; 48 + description = "Host where hatsu should listen for incoming requests."; 49 + }; 50 + 51 + HATSU_LISTEN_PORT = lib.mkOption { 52 + type = lib.types.port; 53 + apply = toString; 54 + default = 3939; 55 + description = "Port where hatsu should listen for incoming requests."; 56 + }; 57 + 58 + HATSU_PRIMARY_ACCOUNT = lib.mkOption { 59 + type = lib.types.str; 60 + description = "The primary account of your instance (eg 'example.com')."; 61 + }; 62 + }; 63 + }; 64 + 65 + default = { }; 66 + 67 + description = '' 68 + Configuration for Hatsu, see 69 + <link xlink:href="https://hatsu.cli.rs/admins/environments.html"/> 70 + for supported values. 71 + ''; 72 + }; 73 + }; 74 + 75 + config = lib.mkIf cfg.enable { 76 + systemd.services.hatsu = { 77 + environment = cfg.settings; 78 + 79 + description = "Hatsu server"; 80 + documentation = [ "https://hatsu.cli.rs/" ]; 81 + 82 + after = [ "network-online.target" ]; 83 + wants = [ "network-online.target" ]; 84 + 85 + wantedBy = [ "multi-user.target" ]; 86 + 87 + serviceConfig = { 88 + DynamicUser = true; 89 + ExecStart = "${lib.getExe cfg.package}"; 90 + Restart = "on-failure"; 91 + StateDirectory = "hatsu"; 92 + Type = "simple"; 93 + WorkingDirectory = "%S/hatsu"; 94 + }; 95 + }; 96 + }; 97 + }