S3 mount in thor

This commit is contained in:
Filippo Berto 2023-07-31 23:37:28 +02:00
parent af8390dc1c
commit 33b3defff9
Signed by: bertof
GPG key ID: 9DBF7E6A1D2CE9ED
5 changed files with 40 additions and 1 deletions

View file

@ -1,5 +1,10 @@
{ lib, config, pkgs, ... }:
with lib; {
age.secrets = {
garage_bertof_thor_key = { file = ../../secrets/garage_bertof_thor_key.age; owner = "bertof"; };
};
boot = {
binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
# kernelPackages = pkgs.linuxPackages_latest;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{ pkgs, nixosConfig, ... }: {
home = {
language.base = "it_IT.UTF-8";
keyboard = {
@ -31,6 +31,27 @@
};
};
systemd.user.services.garage-home-s3 = {
Unit = {
After = [ "network.target" "network-online.target" "local-fs.target" ];
AssertPathIsDirectory = "/home/bertof/s3";
AssertPathIsReadWrite = "/home/bertof/s3";
Description = "Mount S3 bucket in bertof's home";
StartLimitBurst = 5;
StartLimitInterval = 200;
Wants = [ "network.target" "network-online.target" ];
};
Service = {
ExecStart = "${pkgs.s3fs}/bin/s3fs -f -d bertof /home/bertof/s3 -o passwd_file=${nixosConfig.age.secrets.garage_bertof_thor_key.path},use_path_request_style,url=http://localhost:3900";
Restart = "always";
RestartSec = 30;
Type = "exec";
};
Install = {
WantedBy = [ "default.target" ];
};
};
services = { gnome-keyring.enable = true; };
imports = [