Skip to content

Commit

Permalink
feat(system/services): add atuin module (#147)
Browse files Browse the repository at this point in the history
* refactor: demise docker-compose module

* feat(home/pkgs): add atuin

* feat(profile/felix): enable atuin service

* chore(flake): update inputs.secrets

* feat(system/services): add atuin module
  • Loading branch information
piyoki authored Mar 15, 2024
1 parent a0b17a7 commit b69e81c
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 58 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions home/packages/windowmanager/hyprland/terminal/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
vivid
zoxide
tailspin # A log file highlighter
atuin # Replacement for a shell history which records additional commands context with optional encrypted synchronization between machines
];
}
1 change: 1 addition & 0 deletions profiles/server/felix/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
imports = (map sharedLib.relativeToRoot [
# host specific modules
"system/services/docker.nix"
"system/services/atuin"

# shared modules
"shared/server/system/base.nix"
Expand Down
2 changes: 1 addition & 1 deletion secrets
54 changes: 0 additions & 54 deletions shared/modules/containerisation/docker-compose.nix

This file was deleted.

27 changes: 27 additions & 0 deletions system/services/atuin/conf/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
version: '3.5'
services:
atuin:
restart: always
image: ghcr.io/atuinsh/atuin:latest
command: server start
volumes:
- "./config:/config"
links:
- postgresql:db
ports:
- 8888:8888
environment:
ATUIN_HOST: "0.0.0.0"
ATUIN_OPEN_REGISTRATION: "true"
ATUIN_DB_URI: postgres://$ATUIN_DB_USERNAME:$ATUIN_DB_PASSWORD@db/atuin
RUST_LOG: info,atuin_server=debug
postgresql:
image: postgres:14
restart: unless-stopped
volumes: # Don't remove permanent storage for index database files!
- "./database:/var/lib/postgresql/data/"
environment:
POSTGRES_USER: ${ATUIN_DB_USERNAME}
POSTGRES_PASSWORD: ${ATUIN_DB_PASSWORD}
POSTGRES_DB: ${ATUIN_DB_NAME}
22 changes: 22 additions & 0 deletions system/services/atuin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ pkgs, ... }:

# References:
# https://docs.atuin.sh/self-hosting/server-setup/
{
# install package
environment.systemPackages = with pkgs; [ atuin ];

# persist configuration
environment.etc = {
"atuin/docker-compose.yml" = {
mode = "0400";
source = ./conf/docker-compose.yml;
};
};

# open ports in firewall
networking.firewall = {
enable = true;
allowedTCPPorts = [ 8888 ];
};
}

0 comments on commit b69e81c

Please sign in to comment.