diff --git a/instances/freya/configuration.nix b/instances/freya/configuration.nix index 5b1f39f..85827e9 100644 --- a/instances/freya/configuration.nix +++ b/instances/freya/configuration.nix @@ -99,18 +99,5 @@ }; }; - systemd.services.bertof-garage = { - description = "Mount S3 bucket in bertof's home"; - wantedBy = [ "default.target" ]; - wants = [ "network.target" "network-online.target" ]; - after = [ "network.target" "network-online.target" "local-fs.target" ]; - serviceConfig = { - AssertPathIsDirectory = "/home/bertof/s3"; - ExecStart = "${pkgs.s3fs}/bin/s3fs -f -d bertof /home/bertof/s3 -o passwd_file=/home/bertof/s3_secret,use_path_request_style,url=http://localhost:3900"; - Type = "exec"; - User = "bertof"; - }; - }; - system.stateVersion = "22.11"; } diff --git a/instances/loki/configuration.nix b/instances/loki/configuration.nix index 3d309a2..ea66196 100644 --- a/instances/loki/configuration.nix +++ b/instances/loki/configuration.nix @@ -527,18 +527,5 @@ with lib; { Defaults pwfeedback ''; - systemd.services.bertof-garage = { - description = "Mount S3 bucket in bertof's home"; - wantedBy = [ "default.target" ]; - wants = [ "network.target" "network-online.target" ]; - after = [ "network.target" "network-online.target" "local-fs.target" ]; - serviceConfig = { - AssertPathIsDirectory = "/home/bertof/s3"; - ExecStart = "${pkgs.s3fs}/bin/s3fs -f -d bertof /home/bertof/s3 -o passwd_file=/home/bertof/s3_secret,use_path_request_style,url=http://localhost:3900"; - Type = "exec"; - User = "bertof"; - }; - }; - system.stateVersion = "22.11"; } diff --git a/instances/odin/common_configuration.nix b/instances/odin/common_configuration.nix index 9a7c931..0328fbf 100644 --- a/instances/odin/common_configuration.nix +++ b/instances/odin/common_configuration.nix @@ -1,6 +1,10 @@ { config, pkgs, lib, ... }: with lib; { + age.secrets = { + garage_bertof_odin_key = { file = ../../secrets/garage_bertof_odin_key.age; owner = "bertof"; }; + }; + # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -93,19 +97,6 @@ with lib; { keyMap = "it"; }; - systemd.services.bertof-garage = { - description = "Mount S3 bucket in bertof's home"; - wantedBy = [ "default.target" ]; - wants = [ "network.target" "network-online.target" ]; - after = [ "network.target" "network-online.target" "local-fs.target" ]; - serviceConfig = { - AssertPathIsDirectory = "/home/bertof/s3"; - ExecStart = "${pkgs.s3fs}/bin/s3fs -f -d bertof /home/bertof/s3 -o passwd_file=/home/bertof/s3_secret,use_path_request_style,url=http://localhost:3900"; - Type = "exec"; - User = "bertof"; - }; - }; - # X11 windowing system. services.xserver = { enable = true; diff --git a/instances/odin/hm.nix b/instances/odin/hm.nix index 47bfafb..2e6e164 100644 --- a/instances/odin/hm.nix +++ b/instances/odin/hm.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, nixosConfig, ... }: { home = { language.base = "it_IT.UTF-8"; keyboard = { @@ -42,6 +42,23 @@ ''; }; + 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"; + 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_odin_key.path},use_path_request_style,url=http://localhost:3900"; + Type = "exec"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }; + imports = [ ../../modules/hm/__basic.nix diff --git a/secrets/garage_bertof_odin_key.age b/secrets/garage_bertof_odin_key.age new file mode 100644 index 0000000..33429ce Binary files /dev/null and b/secrets/garage_bertof_odin_key.age differ diff --git a/secrets/secrets.nix b/secrets/secrets.nix index be2cc96..ed7e3b2 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -19,6 +19,7 @@ in "garage_bertof_baldur_key.age".publicKeys = devUsers ++ [ baldur ]; "garage_bertof_freya_key.age".publicKeys = devUsers ++ [ freya ]; "garage_bertof_loki_key.age".publicKeys = devUsers ++ [ loki ]; + "garage_bertof_odin_key.age".publicKeys = devUsers ++ [ odin ]; "garage_tiziano_baldur_key.age".publicKeys = devUsers ++ [ baldur ]; "garage_tiziano_loki_key.age".publicKeys = devUsers ++ [ loki ]; "baldur_wg_priv.age".publicKeys = devUsers ++ systems;