Fix filesystem mounts and add tunnel config

This commit is contained in:
2023-05-09 23:05:51 +01:00
parent 1d551d6ea7
commit dbcc2b48e7
2 changed files with 81 additions and 27 deletions

View File

@ -34,41 +34,49 @@ with lib.my;
];
wants = [ "network-online.target" ];
serviceConfig = {
Type=Simple;
ExecStart='''
ssh \
-NT
Type="simple";
ExecStart=pkgs.lib.mkForce ''
${pkgs.openssh}/bin/ssh \
-NT \
-o ExitOnForwardFailure=yes \
-o ServerAliveInterval=60 \
-o TCPKeepAlive=no \
-i %h/.ssh/id_jellyfin \
-R localhost:8096:localhost:8096 \
jellyfin@vps1.mesh.vimium.net
''';
Restart=on-failure;
'';
Restart="on-failure";
};
wantedBy = [ "default.target" ];
};
virtualisation.podman.enable = true;
virtualisation.podman = {
enable = true;
extraPackages = [ pkgs.zfs ];
};
virtualisation.containers.storage.settings = {
storage = {
driver = "zfs";
graphroot = "/var/lib/containers/storage";
runroot = "/run/containers/storage";
};
};
virtualisation.oci-containers.containers = {
jellyfin = {
user = "1000:1000";
image = "docker.io/jellyfin/jellyfin:10.8.10";
autoStart = true;
ports = "8096:8096/tcp";
ports = [ "8096:8096/tcp" ];
volumes = [
"jellyfin-cache:/cache:Z"
"jellyfin-config:/config:Z"
];
extraOptions = [
"--detach"
"--label io.containers.autoupdate=registry"
"--privileged"
"--userns keep-id"
"--label=io.containers.autoupdate=registry"
"--group-add=989"
"--mount type=bind,source=/mnt/library,target=/library"
"--device /dev/dri:/dev/dri"
"--mount=type=bind,source=/mnt/library,target=/library,ro=true"
"--device=/dev/dri:/dev/dri"
];
};
};

View File

@ -8,9 +8,9 @@
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
@ -18,21 +18,11 @@
fsType = "zfs";
};
fileSystems."/home" =
{ device = "rpool/user/home";
fsType = "zfs";
};
fileSystems."/var" =
{ device = "rpool/system/var";
fsType = "zfs";
};
fileSystems."/tmp" =
{ device = "rpool/local/tmp";
fsType = "zfs";
};
fileSystems."/var/log" =
{ device = "rpool/system/var/log";
fsType = "zfs";
@ -44,12 +34,27 @@
};
fileSystems."/var/lib/containers/storage" =
{ device = "rpool/system/var/lib/containers/storage";
{ device = "rpool/system/var/lib-containers-storage";
fsType = "zfs";
};
fileSystems."/nix" =
{ device = "rpool/local/nix";
fsType = "zfs";
};
fileSystems."/tmp" =
{ device = "rpool/local/tmp";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "rpool/user/home";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E63E-8E75";
{ device = "/dev/disk/by-uuid/F697-F1C0";
fsType = "vfat";
};
@ -58,6 +63,46 @@
fsType = "zfs";
};
fileSystems."/mnt/library/books" =
{ device = "library/books";
fsType = "zfs";
};
fileSystems."/mnt/library/fonts" =
{ device = "library/fonts";
fsType = "zfs";
};
fileSystems."/mnt/library/movies" =
{ device = "library/movies";
fsType = "zfs";
};
fileSystems."/mnt/library/music" =
{ device = "library/music";
fsType = "zfs";
};
fileSystems."/mnt/library/software" =
{ device = "library/software";
fsType = "zfs";
};
fileSystems."/mnt/library/tv" =
{ device = "library/tv";
fsType = "zfs";
};
fileSystems."/mnt/library/videos" =
{ device = "library/videos";
fsType = "zfs";
};
fileSystems."/mnt/library/web" =
{ device = "library/web";
fsType = "zfs";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
@ -68,4 +113,5 @@
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}