From c683a6d4c28c4d09de1beb58e59aacce079d9f1a Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sun, 3 Dec 2023 04:18:09 +0100 Subject: [PATCH] bikkje: mount home directories --- hosts/buskerud/bikkje.nix | 13 +++++++++---- modules/home-areas.nix | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 modules/home-areas.nix diff --git a/hosts/buskerud/bikkje.nix b/hosts/buskerud/bikkje.nix index ea1dcec..9fd8d20 100644 --- a/hosts/buskerud/bikkje.nix +++ b/hosts/buskerud/bikkje.nix @@ -2,9 +2,13 @@ { containers.bikkje = { autoStart = true; - interfaces = [ "enp14s0f1" ]; + interfaces = [ "enp4s0f0" ]; config = { config, pkgs, ... }: { + imports = [ + ../../modules/home-areas.nix + ]; + environment.systemPackages = with pkgs; [ zsh bash @@ -87,8 +91,10 @@ useHostResolvConf = lib.mkForce false; hostName = "bikkje"; }; - systemd.network.networks."30-enp14s0f1" = values.defaultNetworkConfig // { - matchConfig.Name = "enp14s0f1"; + + systemd.network.enable = true; + systemd.network.networks."30-enp4s0f0" = values.defaultNetworkConfig // { + matchConfig.Name = "enp4s0f0"; address = with values.hosts.bikkje; [ (ipv4 + "/25") (ipv6 + "/64") ]; }; @@ -99,6 +105,5 @@ # TODO # - Kerberos Authentication - # - Home directory mounts # - Mail Transfer Agent } diff --git a/modules/home-areas.nix b/modules/home-areas.nix new file mode 100644 index 0000000..bba12f1 --- /dev/null +++ b/modules/home-areas.nix @@ -0,0 +1,20 @@ +{ pkgs, lib, ... }: +{ + fileSystems = let + # See microbel:/etc/exports + homeMounts = (lib.listToAttrs (map + (l: lib.nameValuePair "/home/pvv/${l}" "homepvv${l}.pvv.ntnu.no:/export/home/pvv/${l}") + [ "a" "b" "c" "d" "h" "i" "j" "k" "l" "m" "z" ])); + in { } + // + (lib.mapAttrs (_: device: { + inherit device; + fsType = "nfs"; + options = [ + "nfsvers=3" + "proto=tcp" + "nofail" + "_netdev" + ]; + }) homeMounts); +}