mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat: atuin
This commit is contained in:
49
systems/zaatar/atuin.nix
Normal file
49
systems/zaatar/atuin.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{config, ...}: let
|
||||
inherit (import <niveum/lib>) tmpfilesConfig;
|
||||
unstable = import <nixos-unstable> {inherit (config.nixpkgs) config;};
|
||||
in {
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
dataDir = "/var/state/postgresql/${config.services.postgresql.package.psqlSchema}";
|
||||
ensureDatabases = ["atuin"];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "atuin";
|
||||
ensurePermissions."DATABASE atuin" = "ALL PRIVILEGES";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
(tmpfilesConfig {
|
||||
type = "d";
|
||||
path = "/var/state/postgresql";
|
||||
mode = "0700";
|
||||
user = "postgres";
|
||||
group = "postgres";
|
||||
})
|
||||
];
|
||||
|
||||
users.groups.atuin = {};
|
||||
users.users.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 = "${unstable.atuin}/bin/atuin server start";
|
||||
};
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [8888];
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
inherit (import <niveum/lib>) retiolumAddresses restic;
|
||||
in {
|
||||
imports = [
|
||||
./atuin.nix
|
||||
./backup.nix
|
||||
./gaslight.nix
|
||||
./hardware-configuration.nix
|
||||
|
||||
Reference in New Issue
Block a user