l atuin: use upstream service

This commit is contained in:
lassulus 2023-07-23 23:14:21 +02:00
parent 14c0eedc2b
commit 5eb006b52d

View File

@ -1,38 +1,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
services.postgresql = { services.atuin = {
enable = true; enable = true;
dataDir = "/var/state/postgresql/${config.services.postgresql.package.psqlSchema}"; host = "0.0.0.0";
ensureDatabases = [ "atuin" ]; maxHistoryLength = 1000000;
ensureUsers = [{ openFirewall = true;
name = "atuin";
ensurePermissions."DATABASE atuin" = "ALL PRIVILEGES";
}];
};
systemd.tmpfiles.rules = [
"d /var/state/postgresql 0700 postgres postgres -"
];
users.groups.atuin = {};
users.users.atuin = {
uid = pkgs.stockholm.lib.genid_uint31 "atuin";
isSystemUser = true;
group = "atuin";
home = "/run/atuin";
createHome = true;
}; };
systemd.services.atuin = {
wantedBy = [ "multi-user.target" ];
environment = {
ATUIN_HOST = "0.0.0.0";
ATUIN_PORT = "8888";
ATUIN_OPEN_REGISTRATION = "true";
ATUIN_DB_URI = "postgres:///atuin";
};
serviceConfig = {
User = "atuin";
ExecStart = "${pkgs.atuin}/bin/atuin server start";
};
};
networking.firewall.allowedTCPPorts = [ 8888 ];
} }