mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 23:29:08 +01:00
atuin: Use sqlite instead of postgres
This commit is contained in:
parent
8c42b5ea1a
commit
61869b5575
1 changed files with 27 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.custom.services.atuin;
|
cfg = config.custom.services.atuin;
|
||||||
|
dataDir = "/var/lib/atuin";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.custom.services.atuin = {
|
options.custom.services.atuin = {
|
||||||
|
|
@ -18,10 +19,34 @@ in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.atuin = {
|
services.atuin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
openRegistration = true;
|
|
||||||
inherit (cfg) port;
|
inherit (cfg) port;
|
||||||
|
openRegistration = true;
|
||||||
|
database = {
|
||||||
|
createLocally = false;
|
||||||
|
uri = "sqlite://${dataDir}/atuin.db";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
users = {
|
||||||
|
users.atuin = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = config.users.groups.atuin.name;
|
||||||
|
};
|
||||||
|
groups.atuin = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.atuin.serviceConfig = {
|
||||||
|
DynamicUser = lib.mkForce false;
|
||||||
|
User = config.users.users.atuin.name;
|
||||||
|
Group = config.users.groups.atuin.name;
|
||||||
|
StateDirectory = "atuin";
|
||||||
|
StateDirectoryMode = "0700";
|
||||||
|
};
|
||||||
|
|
||||||
|
custom = {
|
||||||
|
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||||
|
|
||||||
|
persistence.directories = [ dataDir ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue