nix-files/hosts/common/fs.nix

95 lines
2.4 KiB
Nix
Raw Normal View History

{ pkgs, sane-lib, ... }:
2022-06-02 10:40:14 +00:00
2022-08-31 02:55:15 +00:00
let sshOpts = rec {
fsType = "fuse.sshfs";
2022-08-31 02:55:15 +00:00
optionsBase = [
"x-systemd.automount"
"_netdev"
"user"
"identityfile=/home/colin/.ssh/id_ed25519"
"allow_other"
"default_permissions"
2022-08-31 02:55:15 +00:00
];
optionsColin = optionsBase ++ [
"transform_symlinks"
2022-08-31 04:14:12 +00:00
"idmap=user"
"uid=1000"
"gid=100"
];
2022-08-31 04:14:12 +00:00
optionsRoot = optionsBase ++ [
# we don't transform_symlinks because that breaks the validity of remote /nix stores
"sftp_server=/run/wrappers/bin/sudo\\040/run/current-system/sw/libexec/sftp-server"
2022-08-31 04:14:12 +00:00
];
};
in
2022-06-02 10:40:14 +00:00
{
environment.pathsToLink = [
# needed to achieve superuser access for user-mounted filesystems (see optionsRoot above)
# we can only link whole directories here, even though we're only interested in pkgs.openssh
"/libexec"
];
2023-06-15 02:14:42 +00:00
fileSystems."/mnt/servo-nfs" = {
device = "servo-hn:/";
noCheck = true;
fsType = "nfs";
options = [ "x-systemd.automount" ];
};
# fileSystems."/mnt/servo-nfs-lan" = {
# device = "servo:/";
# noCheck = true;
# fsType = "nfs";
# options = [ "x-systemd.automount" ];
# };
# fileSystems."/mnt/servo-media-nfs" = {
# device = "10.0.10.5:/media";
# noCheck = true;
# fsType = "nfs";
# options = [ "x-systemd.automount" ];
# };
sane.fs."/mnt/servo-media" = sane-lib.fs.wantedSymlinkTo "/mnt/servo-nfs/media";
2023-06-15 02:14:42 +00:00
fileSystems."/mnt/servo-media-wan" = {
device = "colin@uninsane.org:/var/lib/uninsane/media";
2022-08-31 02:55:15 +00:00
inherit (sshOpts) fsType;
options = sshOpts.optionsColin;
noCheck = true;
};
fileSystems."/mnt/servo-media-lan" = {
device = "colin@servo:/var/lib/uninsane/media";
2022-08-31 02:55:15 +00:00
inherit (sshOpts) fsType;
options = sshOpts.optionsColin;
noCheck = true;
2022-08-31 02:55:15 +00:00
};
fileSystems."/mnt/servo-root-wan" = {
device = "colin@uninsane.org:/";
inherit (sshOpts) fsType;
2022-08-31 04:14:12 +00:00
options = sshOpts.optionsRoot;
noCheck = true;
2022-08-31 02:55:15 +00:00
};
fileSystems."/mnt/servo-root-lan" = {
device = "colin@servo:/";
inherit (sshOpts) fsType;
2022-08-31 04:14:12 +00:00
options = sshOpts.optionsRoot;
noCheck = true;
2022-06-02 10:40:14 +00:00
};
fileSystems."/mnt/desko-home" = {
device = "colin@desko:/home/colin";
2022-08-31 02:55:15 +00:00
inherit (sshOpts) fsType;
options = sshOpts.optionsColin;
noCheck = true;
};
2022-08-31 04:14:12 +00:00
fileSystems."/mnt/desko-root" = {
device = "colin@desko:/";
inherit (sshOpts) fsType;
options = sshOpts.optionsRoot;
noCheck = true;
2022-08-31 04:14:12 +00:00
};
2022-06-02 10:40:14 +00:00
environment.systemPackages = [
pkgs.sshfs-fuse
];
}