From 23b41ac1733970b440f0d0c9e3e8c9ee9dc072cd Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Sat, 29 Jul 2023 17:34:24 +0200 Subject: [PATCH] Remove old configurations --- instances/freya/configuration.nix | 13 ------------- instances/loki/configuration.nix | 13 ------------- instances/odin/common_configuration.nix | 17 ++++------------- instances/odin/hm.nix | 19 ++++++++++++++++++- secrets/garage_bertof_odin_key.age | Bin 0 -> 605 bytes secrets/secrets.nix | 1 + 6 files changed, 23 insertions(+), 40 deletions(-) create mode 100644 secrets/garage_bertof_odin_key.age 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 0000000000000000000000000000000000000000..33429cec688d09ee7ae3fe174afda3f8e0d39874 GIT binary patch literal 605 zcmYdHPt{G$OD?J`D9Oyv)5|YP*Do{V(zR14F3!+RO))YxHMCSPG|nu~3REb}3(N`1 z&Pn(3HE~SOiE_*K^f0RkEO&A(HcJi9O$(|DDNhb7EAq=RDCcr3PxdkPEwl8|E{V)Z zH_mkQF^h;Qk1BFXaWBfM@U!$Pb}7lq4{)k7_e8hN+}Fv-z)>OCxI8#KyP_h(%gHx6 zGSAd0C^5&`+|4C2Fe%u?#4$TeKf=f)E!o>8ET5~QIL9)@KPjvz+ezCkswy?#u`tWn ztgO7$*}~J*Gc>HCq%6cKs@ToV#1-8(&$7zM(sTu{;&h{oq;NBf{D_F8piHws_w2A7 zH}goRY~SEuOB2iBvVtgY{oEkWkWj90r=sB0>o0yzjBlERKvs)Q*EE(+(O4> zW4}yyi}Ye=_u|}ufO3#+nN@MR=|!oD#iBx&LL4| z8766AMgcB{iJs}cW)?=tnW-iLMWq%_xxrO|QN{rtUV$d5?#@nGj)7ddy1EK}W{K{G z{zj(3K8{5>rQW5!l@?h6#paH#c@-g%Wm#rEsX3*F`Hop-UItv|>z3-?EuG$Uam#aQ z`*rUptIuCvDHQie$vdp1_mXhu_WkPfnj8S=-;ledNz+`HBD5Ww$+Nox&k|)Jg2y Su^;s(9!jN5`<&)(`~(0+ciImC literal 0 HcmV?d00001 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;