This repository has been archived on 2023-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dotfiles/hosts/library/default.nix

85 lines
1.9 KiB
Nix

{ config, lib, pkgs, ... }:
with lib.my;
{
imports = [
./hardware-configuration.nix
../server.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "library";
networking.domain = "mesh.vimium.net";
networking.hostId = "d24ae953";
networking.networkmanager.enable = true;
nix.package = pkgs.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
users.defaultUserShell = pkgs.zsh;
system.stateVersion = "22.11";
systemd.services.vps1-tunnel = {
enable = true;
description = "vps1.mesh.vimium.net SSH tunnel";
after = [
"network-online.target"
"podman-jellyfin.service"
];
wants = [ "network-online.target" ];
serviceConfig = {
Type=Simple;
ExecStart='''
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;
};
wantedBy = [ "default.target" ];
};
virtualisation.podman.enable = true;
virtualisation.oci-containers.containers = {
jellyfin = {
user = "1000:1000";
image = "docker.io/jellyfin/jellyfin:10.8.10";
autoStart = true;
ports = "8096:8096/tcp";
volumes = [
"jellyfin-cache:/cache:Z"
"jellyfin-config:/config:Z"
];
extraOptions = [
"--detach"
"--label io.containers.autoupdate=registry"
"--privileged"
"--userns keep-id"
"--group-add=989"
"--mount type=bind,source=/mnt/library,target=/library"
"--device /dev/dri:/dev/dri"
];
};
};
modules = {
security = {
gpg.enable = true;
};
shell = {
zsh.enable = true;
};
};
}