mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-02-20 17:07:51 +01:00
Compare commits
1 Commits
PVVtheme20
...
f85907ffc8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f85907ffc8 |
@@ -1,21 +1,51 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
let
|
||||||
fileSystems = let
|
|
||||||
# See microbel:/etc/exports
|
# See microbel:/etc/exports
|
||||||
shorthandAreas = lib.listToAttrs (map
|
letters = [ "a" "b" "c" "d" "h" "i" "j" "k" "l" "m" "z" ];
|
||||||
(l: lib.nameValuePair "/run/pvv-home-mounts/${l}" "homepvv${l}.pvv.ntnu.no:/export/home/pvv/${l}")
|
in
|
||||||
[ "a" "b" "c" "d" "h" "i" "j" "k" "l" "m" "z" ]);
|
{
|
||||||
in { }
|
systemd.mounts = map (l: {
|
||||||
//
|
description = "PVV Homedirs Partition ${l}";
|
||||||
(lib.mapAttrs (_: device: {
|
|
||||||
inherit device;
|
before = [ "remote-fs.target" ];
|
||||||
fsType = "nfs";
|
wantedBy = [ "multi-user.target" ];
|
||||||
options = [
|
|
||||||
|
type = "nfs";
|
||||||
|
what = "homepvv${l}.pvv.ntnu.no:/export/home/pvv/${l}";
|
||||||
|
where = "/run/pvv-home-mounts/${l}";
|
||||||
|
|
||||||
|
options = lib.concatStringsSep "," [
|
||||||
"nfsvers=3"
|
"nfsvers=3"
|
||||||
"noauto"
|
|
||||||
"proto=tcp"
|
"proto=tcp"
|
||||||
"x-systemd.automount"
|
"auto"
|
||||||
"x-systemd.idle-timeout=300"
|
"async"
|
||||||
|
|
||||||
|
# We don't want to update access time constantly
|
||||||
|
"noatime"
|
||||||
|
|
||||||
|
# No SUID/SGID, no special devices
|
||||||
|
"nosuid"
|
||||||
|
"nodev"
|
||||||
|
|
||||||
|
# TODO: are there cgi scripts that modify stuff in peoples homedirs?
|
||||||
|
# "ro"
|
||||||
|
"rw"
|
||||||
|
|
||||||
|
# TODO: can we enable this and still run cgi stuff?
|
||||||
|
# "noexec"
|
||||||
];
|
];
|
||||||
}) shorthandAreas);
|
}) letters;
|
||||||
|
|
||||||
|
systemd.automounts = map (l: {
|
||||||
|
description = "PVV Homedirs Partition ${l}";
|
||||||
|
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
where = "/run/pvv-home-mounts/${l}";
|
||||||
|
|
||||||
|
automountConfig = {
|
||||||
|
# Unmount if not accessed in 5 mins
|
||||||
|
TimeoutIdleSec = "5min";
|
||||||
|
};
|
||||||
|
}) letters;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user