Skip to content

Commit

Permalink
feat: enable libations on thor
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Dec 8, 2023
1 parent 6f555a0 commit 4f1858a
Show file tree
Hide file tree
Showing 11 changed files with 145 additions and 20 deletions.
57 changes: 56 additions & 1 deletion flake.lock

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

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
crafts.inputs.nixpkgs.follows = "unstable";
embr.url = "github:jnsgruk/firecracker-ubuntu";
embr.inputs.nixpkgs.follows = "unstable";
libations.url = "github:jnsgruk/libations";
libations.inputs.nixpkgs.follows = "unstable";
};

outputs =
Expand Down
57 changes: 57 additions & 0 deletions host/common/services/libations.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{ config, pkgs, ... }:
let
# Fetch the libations recipes from a private repository. Note that there must be a
# valid SSH key either in the agent of the user executing the `nix` command, or in
# `/root/.ssh` or this will fail.
recipes = builtins.fetchGit {
url = "[email protected]:jnsgruk/libations-recipes";
rev = "9bd7e4ebe23f9421c3ccec5db20b4bdae2344ace";
};

libations = pkgs.buildGoModule {
pname = "libations";
version = "unstable-2023-12-08";
src = pkgs.fetchFromGitHub {
rev = "c1d968fdd87e6214ac5c9d50019749d5c05aa939";
owner = "jnsgruk";
repo = "libations";
hash = "sha256-Eu0LLQZ4ZB2fdedmpFjlRbJIzoA7ow1LGQtVdoyP2xM=";
};
vendorHash = "sha256-Ep3nBl9WZm7skk1cmMS9KI019ZSRSxofbLs2Nrj6HM8=";
nativeBuildInputs = with pkgs; [ hugo ];
postConfigure = ''
# Patch the recipes that were fetched above into the app before building
cp ${recipes}/recipes.json ./webui/data/drinks.json
# Generate the Hugo site that's embedded in the app
go generate
'';
};
in
{
age.secrets = {
libations-auth-key = {
file = ../../../secrets/thor-libations-tskey.age;
owner = "root";
group = "root";
mode = "400";
};
};

systemd.services.libations = {
description = "Libations cocktail recipe viewer";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
environment = {
"XDG_CONFIG_HOME" = "/var/lib/libations/";
};
serviceConfig = {
DynamicUser = true;
ExecStart = "${libations}/bin/libations";
Restart = "always";
EnvironmentFile = config.age.secrets.libations-auth-key.path;
StateDirectory = "libations";
StateDirectoryMode = "0750";
};
};
}

3 changes: 2 additions & 1 deletion host/thor/extra.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
imports = [
../common/services/files.nix
../common/services/homepage.nix
../common/services/libations.nix
../common/services/servarr.nix
../common/services/traefik
];

environment.systemPackages = with pkgs; [ icloudpd ];
environment.systemPackages = with pkgs; [ icloudpd libations ];

age.secrets = {
borgbase-ssh = {
Expand Down
18 changes: 8 additions & 10 deletions secrets/kara-borgbase-passphrase.age
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
age-encryption.org/v1
-> ssh-ed25519 ASg3Sg CO2tcSK64VFwK1vMOZL+7iOe6FaZWkSaiqF0OqMR4io
WSFzYxoW4ng0QcXAr5/jPBTeLO/Y4k16ubVL+h09nTE
-> ssh-ed25519 6up9ZQ 7cIIIsfocgAU8zzUPhp1WCjjY8rasUUrFeH9j/gKExc
7a7sgE8NdKyvWb68RgVNppAfUShrTrsqa/cxvs83g9M
-> W~_#-grease e0Jt_% 9c=-ZICy ^A27 _X%DC
ZzXuwWsQTw0mvi1iXdZH0Hd8V8aJT86mqa6ehpbQ6nzsJOMZRPdGe4P9BF18E5mX
ODT59MAJ/W37y/JxXNNY+0QN6erT
--- GztYtmM4sxrUxwzazX/RI3p8OGC7kelqgvnBpHycM/Y
�}���%�p�S���B���)�%poz�,i����ϛ�5�d���86��D]TjY胲��
�Z�r�i��� V���p���+�a�$�]�61��
-> ssh-ed25519 ASg3Sg +pewBTfRJ8UR497QKTusEkqhHphK94AQW4tHD30Crwo
4CctckWgtukTL1yrX/9R+fOXz/w+lco8wcbp8d6h2PU
-> ssh-ed25519 6up9ZQ TNDeFCu/3FzVPX9u0GvzhG3Y37z0I0v8BnuQ7RTHTnU
XGbf/hNhHIEZsoGUjVfbc6NmoZr05q5fnI6juN/d52o
-> srSd-grease "U *&"yT JS+MW kl)A
4JBYxJdv6JIxPCZ3NScvhgF7DuCLEVXlQuFNFey3qsPxvcKTNNq9Ag
--- ivkPurGWx/wV+7P1o3lJKu0o+jVvbLNBQ8e4udH6PeM
4T�l.]��o��Dr�Q���򺛸A������`�3�k�Vq,������/>���}���u���=���a)�HZ����wN�>6^�A�~9��
Expand Down
Binary file modified secrets/kara-borgbase-ssh.age
Binary file not shown.
1 change: 1 addition & 0 deletions secrets/secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ in
"thor-digitalocean.age".publicKeys = users ++ [ thor ];
"thor-borgbase-ssh.age".publicKeys = users ++ [ thor ];
"thor-borgbase-passphrase.age".publicKeys = users ++ [ thor ];
"thor-libations-tskey.age".publicKeys = users ++ [ thor ];
}
Binary file modified secrets/thor-borgbase-passphrase.age
Binary file not shown.
Binary file modified secrets/thor-borgbase-ssh.age
Binary file not shown.
17 changes: 9 additions & 8 deletions secrets/thor-digitalocean.age
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
age-encryption.org/v1
-> ssh-ed25519 ASg3Sg GUU7pEN/08zLJEZcZ2KNLXlO3j4V+zH3yvCZKgmuaV0
scttI3tiRqjqTrQOt95NMD+0CNqj2WSCCyV0hJ9IpgQ
-> ssh-ed25519 HTYk+g IpBlhhEL6rIFl5gFMCP7icaOjt5VYjl+2w5icKhOEEM
ofZM6NXDJg1SBmoTkln8E1Zi5wzNjCuO38pXl4ZX5Y8
-> h-grease g8IhTVps 2+>Y@^;2 ,NyPdN Q[.F|9X*
zSwCpOrQ89FL
--- RIurRnXPMXrmFaxQR91pTQbQL6jlPt3bmnxAHCQmSkU
�6��B�� ��'qP�����/_���(�ο3IX�L�6p_p�wg9�ހ����ر��JA1��K���dq#��J��.J���Jg�wQ;
-> ssh-ed25519 ASg3Sg fdfEEB6h2PjTUtQHeOYDOM9YdwF+Y5FEHHJokfXOjxE
b59xNlXGYPlA3bK1QQfJUPdIlXyOfHgQL9KHqFRCnmM
-> ssh-ed25519 HTYk+g whfs99yVZW4up2KKLxr+5C6X8KCX3EXr1nXtWB3qm1Y
fzm34J5FM3DbZXmi3J9nU/J0jtFODOcL3143bjWmk0M
-> =`X-grease
mLWLA+xSfPIk11wV
--- +qq22jL9+Mbqxvb5jnocqRpXi4nTbvZOay9fe1qVZ7c
B�Q�NݻN��*v�5Q�]�Ө6�3�~�g�K�O��/E�H߱�c���nf�e�qK����;�*�RV��K���44����!�
�I�<
10 changes: 10 additions & 0 deletions secrets/thor-libations-tskey.age
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
age-encryption.org/v1
-> ssh-ed25519 ASg3Sg bReKHI4P9ExPaNVwFf9bj2J0mibldAVXXxx1XgAYRTg
OXuT3+puMZ86Zetd2oFLbPG01OoXNw49THoaOYz8v/w
-> ssh-ed25519 HTYk+g QHATIVHm5m9b+h1OuwX7T8yrTdl2l4Ql72UqlhXHdSE
b2nhm96JVs1n3aPsGYsbwS2d32ew/l2FTco+1RrhWMY
-> MHcgU7A-grease 9ciM^Qo P !|/ ^u3cjI)s
B4QLsVaiadaDq1BQ3F6F/E8u2Q5pnbzfZI3+TZh4Lb8XLD1eyFXd1gVASas2zcbu
ObCUE6rDuja0Iv/5mSHGeEIT9QRNGRRn8yPh8mQ
--- egNnJzgr/dfEa04oSc+/YvigU8h8GRzD+ZenEhf+CbA
^�H�Y�ª7�^�aY~��8�g��R�a����)��{e�d> �lViƻW���m���X�L�f��st�?s�p,< �P��,�~�g�Q�D��ЯrY�

0 comments on commit 4f1858a

Please sign in to comment.