summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/share
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2022-03-01 23:26:31 +0100
committermakefu <github@syntax-fehler.de>2022-03-01 23:26:31 +0100
commit94b29daa137e704d9db1979169ba82f9150515c6 (patch)
tree86e2b9c74c6b1557ba4e4360196043395fbfc844 /makefu/2configs/share
parent4904dcf2291d61d41a22f5429327e95e8a7e61ae (diff)
ma share: set file-mode to 0770 for hetzner
Diffstat (limited to 'makefu/2configs/share')
-rw-r--r--makefu/2configs/share/default.nix29
-rw-r--r--makefu/2configs/share/hetzner-client.nix12
-rw-r--r--makefu/2configs/share/omo.nix6
3 files changed, 42 insertions, 5 deletions
diff --git a/makefu/2configs/share/default.nix b/makefu/2configs/share/default.nix
new file mode 100644
index 000000000..a1ad349b9
--- /dev/null
+++ b/makefu/2configs/share/default.nix
@@ -0,0 +1,29 @@
+{ config, lib, ... }:
+with import <stockholm/lib>;
+let
+ base-dir = config.services.rtorrent.downloadDir;
+in {
+ users.users = {
+ download = {
+ name = "download";
+ home = base-dir;
+ isNormalUser = true;
+ uid = mkDefault (genid "download");
+ createHome = false;
+ useDefaultShell = true;
+ group = "download";
+ openssh.authorizedKeys.keys = [ ];
+ };
+ };
+
+ users.groups = {
+ download = {
+ gid = lib.mkDefault (genid "download");
+ members = [
+ config.krebs.build.user.name
+ "download"
+ ];
+ };
+ };
+
+}
diff --git a/makefu/2configs/share/hetzner-client.nix b/makefu/2configs/share/hetzner-client.nix
index e59698063..90bc32deb 100644
--- a/makefu/2configs/share/hetzner-client.nix
+++ b/makefu/2configs/share/hetzner-client.nix
@@ -1,5 +1,6 @@
{ config, lib, pkgs, ... }:
+with <stockholm/lib>;
let
automount_opts =
[ "x-systemd.automount"
@@ -10,14 +11,16 @@ let
host = "u288834.your-storagebox.de";
in {
boot.kernel.sysctl."net.ipv6.route.max_size" = 2147483647;
+
fileSystems."/media/cloud" = {
device = "//${host}/backup";
fsType = "cifs";
options = automount_opts ++
- [ "credentials=/var/src/secrets/hetzner.smb"
- "file_mode=0775"
- "dir_mode=0775"
- "uid=9001"
+ [ "credentials=${toString <secrets/hetzner.smb>}"
+ "file_mode=0770"
+ "dir_mode=0770"
+ "uid=${toString config.users.users.download.uid}"
+ "gid=${toString config.users.groups.download.gid}"
#"vers=3"
"vers=2.1"
"rsize=65536"
@@ -25,5 +28,4 @@ in {
"iocharset=utf8"
];
};
-
}
diff --git a/makefu/2configs/share/omo.nix b/makefu/2configs/share/omo.nix
index 93536b63d..e53158b8f 100644
--- a/makefu/2configs/share/omo.nix
+++ b/makefu/2configs/share/omo.nix
@@ -32,6 +32,12 @@ in {
browseable = "yes";
"guest ok" = "yes";
};
+ movies = {
+ path = "/media/cryptX/movies";
+ "read only" = "yes";
+ browseable = "yes";
+ "guest ok" = "yes";
+ };
audiobook = {
path = "/media/crypt1/audiobooks";
"read only" = "yes";