2021-02-25 12:45:50 -08:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2022-03-16 09:49:35 -07:00
|
|
|
with lib;
|
2021-06-08 14:22:37 -07:00
|
|
|
let local-domain = "sea.fudo.org";
|
2021-04-02 14:08:01 -07:00
|
|
|
in {
|
|
|
|
fileSystems = {
|
2021-11-05 07:06:08 -07:00
|
|
|
# "/mnt/documents" = {
|
|
|
|
# device = "whitedwarf.${local-domain}:/volume1/Documents";
|
|
|
|
# fsType = "nfs4";
|
|
|
|
# options = [ "comment=systemd.automount" ];
|
|
|
|
# };
|
|
|
|
# "/mnt/downloads" = {
|
|
|
|
# device = "whitedwarf.${local-domain}:/volume1/Downloads";
|
|
|
|
# fsType = "nfs4";
|
|
|
|
# options = [ "comment=systemd.automount" ];
|
|
|
|
# };
|
2021-04-02 14:08:01 -07:00
|
|
|
"/mnt/music" = {
|
|
|
|
device = "doraemon.${local-domain}:/volume1/Music";
|
2022-03-16 09:49:35 -07:00
|
|
|
fsType = "nfs";
|
2021-07-26 12:09:47 -07:00
|
|
|
options = [ "comment=systemd.automount" ];
|
2021-04-02 14:08:01 -07:00
|
|
|
};
|
|
|
|
"/mnt/video" = {
|
|
|
|
device = "doraemon.${local-domain}:/volume1/Video";
|
2022-03-16 09:49:35 -07:00
|
|
|
fsType = "nfs";
|
2021-07-26 12:09:47 -07:00
|
|
|
options = [ "comment=systemd.automount" ];
|
2021-04-02 14:08:01 -07:00
|
|
|
};
|
|
|
|
# fileSystems."/mnt/security" = {
|
|
|
|
# device = "panopticon.${local-domain}:/srv/kerberos/data";
|
|
|
|
# fsType = "nfs4";
|
|
|
|
# };
|
|
|
|
"/mnt/cargo_video" = {
|
|
|
|
device = "cargo.${local-domain}:/volume1/video";
|
2022-04-08 14:21:56 -07:00
|
|
|
fsType = "nfs4";
|
|
|
|
options = [ "sec=krb5i" "x-systemd.automount" ];
|
2021-04-02 14:08:01 -07:00
|
|
|
};
|
|
|
|
"/mnt/photo" = {
|
|
|
|
device = "cargo.${local-domain}:/volume1/pictures";
|
2022-04-08 14:21:56 -07:00
|
|
|
fsType = "nfs4";
|
|
|
|
options = [ "sec=krb5i" "x-systemd.automount" ];
|
2021-04-02 14:08:01 -07:00
|
|
|
};
|
2021-10-28 09:32:35 -07:00
|
|
|
|
2021-11-13 10:30:58 -08:00
|
|
|
# "proto=tcp"
|
|
|
|
|
2022-03-16 09:49:35 -07:00
|
|
|
# # NOTE: these are pointing directly to nostromo so the krb lookup works
|
2021-10-19 10:04:35 -07:00
|
|
|
"/net/documents" = {
|
2022-04-08 14:21:56 -07:00
|
|
|
device = "nostromo.${local-domain}:/export/documents";
|
2021-10-28 09:32:35 -07:00
|
|
|
fsType = "nfs4";
|
2022-03-16 09:49:35 -07:00
|
|
|
options = [
|
|
|
|
"sec=krb5p"
|
|
|
|
"x-systemd.automount"
|
|
|
|
# "vers=4"
|
|
|
|
# "minorversion=2"
|
|
|
|
# "proto=tcp"
|
|
|
|
];
|
2021-10-18 21:55:24 -07:00
|
|
|
};
|
2021-10-19 10:04:35 -07:00
|
|
|
"/net/downloads" = {
|
2022-04-08 14:21:56 -07:00
|
|
|
device = "nostromo.${local-domain}:/export/downloads";
|
2021-10-28 09:32:35 -07:00
|
|
|
fsType = "nfs4";
|
2022-03-16 09:49:35 -07:00
|
|
|
options = [
|
|
|
|
"sec=krb5i"
|
|
|
|
"x-systemd.automount"
|
|
|
|
# "vers=4"
|
|
|
|
# "minorversion=2"
|
|
|
|
# "proto=tcp"
|
|
|
|
];
|
2021-10-28 09:32:35 -07:00
|
|
|
};
|
|
|
|
"/net/projects" = {
|
2022-04-08 14:21:56 -07:00
|
|
|
device = "nostromo.${local-domain}:/export/projects";
|
2021-10-28 09:32:35 -07:00
|
|
|
fsType = "nfs4";
|
2022-03-16 09:49:35 -07:00
|
|
|
options = [
|
|
|
|
"sec=krb5p"
|
|
|
|
"x-systemd.automount"
|
|
|
|
# "vers=4"
|
|
|
|
# "minorversion=2"
|
|
|
|
# "proto=tcp"
|
|
|
|
];
|
2021-10-18 21:55:24 -07:00
|
|
|
};
|
2021-04-02 14:08:01 -07:00
|
|
|
};
|
|
|
|
|
2022-06-01 13:57:58 -07:00
|
|
|
systemd.services = {
|
|
|
|
host-keytab-watcher = {
|
|
|
|
wantedBy = [
|
|
|
|
"rpc-gssd-override.service"
|
|
|
|
"rpc-svcgssd-override.service"
|
|
|
|
"auth-rpcgss-module.service"
|
|
|
|
];
|
|
|
|
before = [
|
|
|
|
"rpc-gssd-override.service"
|
|
|
|
"rpc-svcgssd-override.service"
|
|
|
|
"auth-rpcgss-module.service"
|
|
|
|
];
|
|
|
|
after = [ config.fudo.secrets.secret-target ];
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStartPre = "${pkgs.coreutils}/bin/test -f /etc/krb5.keytab";
|
|
|
|
ExecStart = "${pkgs.coreutils}/bin/true";
|
|
|
|
TimeoutStartSec = "360";
|
|
|
|
RemainAfterExit = true;
|
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = "2";
|
|
|
|
};
|
|
|
|
};
|
2022-03-16 09:49:35 -07:00
|
|
|
|
2022-06-01 13:57:58 -07:00
|
|
|
auth-rpcgss-module.enable = false;
|
|
|
|
rpc-gssd.enable = false;
|
|
|
|
rpc-svcgssd.enable = false;
|
2022-04-08 14:21:56 -07:00
|
|
|
|
2022-06-01 13:57:58 -07:00
|
|
|
auth-rpcgss-module-override = {
|
|
|
|
description = "Kernel Module supporting RPCSEC_GSS";
|
|
|
|
before = [
|
|
|
|
"gssproxy.service"
|
|
|
|
"rpc-svcgssd-override.service"
|
|
|
|
"rpc-gssd-override.service"
|
|
|
|
];
|
|
|
|
wantedBy = [ "nfs-client.target" "nfs-server.target" ];
|
|
|
|
wants = [
|
|
|
|
"gssproxy.service"
|
|
|
|
"rpc-svcgssd-override.service"
|
|
|
|
"rpc-gssd-override.service"
|
|
|
|
"host-keytab-watcher.service"
|
|
|
|
];
|
|
|
|
after = [ "host-keytab-watcher.service" ];
|
|
|
|
partOf = [ "nfs-utils.service" "nfs-server.service" ];
|
|
|
|
unitConfig = {
|
|
|
|
DefaultDependencies = false;
|
|
|
|
ConditionPathExists =
|
|
|
|
[ "|!/run/gssproxy.pid" "|!/proc/net/rpc/use-gss-proxy" ];
|
2022-04-08 14:21:56 -07:00
|
|
|
};
|
2022-06-01 13:57:58 -07:00
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = "${pkgs.kmod}/bin/modprobe -q auth_rpcgss";
|
|
|
|
RemainAfterExit = true;
|
2022-03-16 09:49:35 -07:00
|
|
|
};
|
|
|
|
};
|
2021-10-19 10:04:35 -07:00
|
|
|
|
2022-06-01 13:57:58 -07:00
|
|
|
rpc-gssd-override = {
|
|
|
|
description = "RPC security service for NFS client and server";
|
|
|
|
wantedBy = [ "auth-rpcgss-module.service" ];
|
|
|
|
conflicts = [ "umount.target" ];
|
|
|
|
after = [ "host-keytab-watcher.service" "rpc_pipefs.target" ];
|
|
|
|
wants = [ "host-keytab-watcher.service" ];
|
|
|
|
requires = [ "rpc_pipefs.target" ];
|
|
|
|
partOf = [ "nfs-utils.service" ];
|
|
|
|
unitConfig.DefaultDependencies = false;
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "forking";
|
|
|
|
ExecStart = "${pkgs.nfs-utils}/bin/rpc.gssd";
|
|
|
|
};
|
|
|
|
};
|
2022-03-16 09:49:35 -07:00
|
|
|
|
2022-06-01 13:57:58 -07:00
|
|
|
rpc-svcgssd-override = {
|
|
|
|
description = "RPC security service for NFS server";
|
|
|
|
wantedBy = [ "auth-rpcgss-module.service" ];
|
|
|
|
after =
|
|
|
|
[ "host-keytab-watcher.service" "local-fs.target" "gssproxy.service" ];
|
|
|
|
wants = [ "host-keytab-watcher.service" ];
|
|
|
|
partOf = [ "nfs-utils.service" "nfs-server.service" ];
|
|
|
|
unitConfig = {
|
|
|
|
DefaultDependencies = false;
|
|
|
|
ConditionPathExists =
|
|
|
|
[ "|!/run/gssproxy.pid" "|!/proc/net/rpc/use-gss-proxy" ];
|
|
|
|
};
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "forking";
|
|
|
|
ExecStart = "${pkgs.nfs-utils}/bin/rpc.svcgssd";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-03-16 09:49:35 -07:00
|
|
|
|
2021-04-02 14:08:01 -07:00
|
|
|
services.printing = {
|
|
|
|
enable = true;
|
2022-06-01 13:57:58 -07:00
|
|
|
drivers = [ pkgs.brgenml1cupswrapper ];
|
2021-04-02 14:08:01 -07:00
|
|
|
};
|
2021-03-31 16:28:42 -07:00
|
|
|
}
|