diff --git a/systems/x86_64-linux/sgx-nixos/atticd.nix b/systems/x86_64-linux/sgx-nixos/atticd.nix index 3650085..3ac5c27 100644 --- a/systems/x86_64-linux/sgx-nixos/atticd.nix +++ b/systems/x86_64-linux/sgx-nixos/atticd.nix @@ -1,5 +1,15 @@ { pkgs, lib, config, ... }: { + services.postgresql = { + enable = true; + ensureDatabases = [ "attic" ]; + ensureUsers = [{ name = "atticd"; }]; + }; + + systemd.services.postgresql.postStart = lib.mkAfter '' + $PSQL -tAc 'ALTER DATABASE "attic" OWNER TO "atticd"' + ''; + environment.systemPackages = with pkgs; [ attic-client ]; @@ -10,6 +20,8 @@ credentialsFile = "/etc/atticd.env"; settings = { + database.url = "postgresql:///attic?host=/run/postgresql"; + listen = "[::]:8080"; # Data chunking