1
0
mirror of https://github.com/tboerger/nixos-config synced 2024-11-22 18:21:58 +01:00

chore: another refactoring to split desktops and server

This commit is contained in:
Thomas Boerger 2022-11-15 10:32:56 +01:00
parent fdd212730a
commit a5bcd9b11c
No known key found for this signature in database
GPG Key ID: 09745AFF9D63C79B
77 changed files with 834 additions and 190 deletions

118
README.md

@ -4,13 +4,21 @@
Provisioning for my NixOS systems based on [Nix][nix]. Provisioning for my NixOS systems based on [Nix][nix].
## Chnum ## Prepare
### Bootstrap
Copy `/etc/ssh/ssh_host_ed25519_key.pub` into [secrets](./secrets/secrets.nix) Copy `/etc/ssh/ssh_host_ed25519_key.pub` into [secrets](./secrets/secrets.nix)
and rekey the secrets via [agenix][agenix]. After pushing the rekeyed secrets and rekey the secrets via [agenix][agenix]. After pushing the rekeyed secrets
execute these commands: execute the commands below.
## Desktops
Generally after the installation I'm cloning this repository somewhere onto the
desktop machine and just execute `make switch` within that repository to apply
updates, if this is not the case I can always execute
`nixos-rebuild switch --flake github:tboerger/nixos-config#name` to get the
latest changes pulled in.
### Chnum
```console ```console
sudo loadkeys de sudo loadkeys de
@ -23,23 +31,39 @@ cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#chnum nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#chnum
``` ```
### Updates ### Hathor
If the repository had been cloned you could just execute `make switch`,
otherwise there is still this long option to update the deployment:
```console ```console
nixos-rebuild switch \ sudo loadkeys de
--flake github:tboerger/nixos-config#chnum sudo nix-shell --packages nixUnstable
bash -c "$(curl -fsSL https://raw.githubusercontent.com/tboerger/nixos-config/master/scripts/hathor-partitions)"
mkdir -p /mnt/etc/ssh
cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#hathor
``` ```
## Niflheim ### Osiris
### Bootstrap ```console
sudo loadkeys de
sudo nix-shell --packages nixUnstable
Copy `/etc/ssh/ssh_host_ed25519_key.pub` into [secrets](./secrets/secrets.nix) bash -c "$(curl -fsSL https://raw.githubusercontent.com/tboerger/nixos-config/master/scripts/osiris-partitions)"
and rekey the secrets via [agenix][agenix]. After pushing the rekeyed secrets
execute these commands: mkdir -p /mnt/etc/ssh
cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#osiris
```
## Servers
Currently I'm applying the updates manually by cloning the repository into the
machine and executing `make switch`, but on longterm it should also just work to
use the `deploy #name` command, at least if it's executed from a NixOS desktop.
### Niflheim
```console ```console
sudo loadkeys de sudo loadkeys de
@ -52,23 +76,7 @@ cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#niflheim nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#niflheim
``` ```
### Updates ### Asgard
If the repository had been cloned you could just execute `make switch`,
otherwise there is still this long option to update the deployment:
```console
nixos-rebuild switch \
--flake github:tboerger/nixos-config#niflheim
```
## Asgard
### Bootstrap
Copy `/etc/ssh/ssh_host_ed25519_key.pub` into [secrets](./secrets/secrets.nix)
and rekey the secrets via [agenix][agenix]. After pushing the rekeyed secrets
execute these commands:
```console ```console
sudo loadkeys de sudo loadkeys de
@ -81,23 +89,7 @@ cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#asgard nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#asgard
``` ```
### Updates ### Utgard
If the repository had been cloned you could just execute `make switch`,
otherwise there is still this long option to update the deployment:
```console
nixos-rebuild switch \
--flake github:tboerger/nixos-config#asgard
```
## Utgard
### Bootstrap
Copy `/etc/ssh/ssh_host_ed25519_key.pub` into [secrets](./secrets/secrets.nix)
and rekey the secrets via [agenix][agenix]. After pushing the rekeyed secrets
execute these commands:
```console ```console
sudo loadkeys de sudo loadkeys de
@ -110,23 +102,7 @@ cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#utgard nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#utgard
``` ```
### Updates ### Midgard
If the repository had been cloned you could just execute `make switch`,
otherwise there is still this long option to update the deployment:
```console
nixos-rebuild switch \
--flake github:tboerger/nixos-config#utgard
```
## Midgard
### Bootstrap
Copy `/etc/ssh/ssh_host_ed25519_key.pub` into [secrets](./secrets/secrets.nix)
and rekey the secrets via [agenix][agenix]. After pushing the rekeyed secrets
execute these commands:
```console ```console
sudo loadkeys de sudo loadkeys de
@ -139,16 +115,6 @@ cp /etc/ssh/ssh_host_* /mnt/etc/ssh/
nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#midgard nixos-install --no-root-password --root /mnt --flake github:tboerger/nixos-config#midgard
``` ```
### Updates
If the repository had been cloned you could just execute `make switch`,
otherwise there is still this long option to update the deployment:
```console
nixos-rebuild switch \
--flake github:tboerger/nixos-config#midgard
```
## Security ## Security
If you find a security issue please contact thomas@webhippie.de first. If you find a security issue please contact thomas@webhippie.de first.

@ -2,8 +2,9 @@
{ {
imports = [ imports = [
../modules ../../shared/modules
../services ../../shared/programs
../../shared/services
./filesystems.nix ./filesystems.nix
./boot.nix ./boot.nix
@ -12,10 +13,13 @@
]; ];
personal = { personal = {
services = { programs = {
citrix = { citrix = {
enable = config.personal.services.enable; enable = config.personal.programs.enable;
}; };
};
services = {
desktop = { desktop = {
enable = config.personal.services.enable; enable = config.personal.services.enable;
}; };

@ -21,10 +21,4 @@
}; };
}; };
}; };
environment = {
systemPackages = with pkgs; [
intel-gpu-tools
];
};
} }

35
desktops/hathor/boot.nix Normal file

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
{
boot = {
binfmt = {
emulatedSystems = [
"aarch64-linux"
];
};
kernelPackages = lib.mkDefault pkgs.linuxPackages;
cleanTmpDir = true;
loader = {
efi = {
canTouchEfiVariables = true;
};
systemd-boot = {
enable = true;
consoleMode = "2";
configurationLimit = 5;
editor = false;
};
};
kernelModules = [ ];
extraModulePackages = [ ];
initrd = {
availableKernelModules = [ ];
kernelModules = [ "dm-snapshot" ];
};
};
}

@ -2,8 +2,9 @@
{ {
imports = [ imports = [
../modules ../../shared/modules
../services ../../shared/programs
../../shared/services
./filesystems.nix ./filesystems.nix
./boot.nix ./boot.nix
@ -12,11 +13,20 @@
]; ];
personal = { personal = {
programs = {
citrix = {
enable = config.personal.programs.enable;
};
};
services = { services = {
desktop = {
enable = config.personal.services.enable;
};
docker = { docker = {
enable = config.personal.services.enable; enable = config.personal.services.enable;
}; };
shares = { libvirt = {
enable = config.personal.services.enable; enable = config.personal.services.enable;
}; };
tailscale = { tailscale = {

@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }:
{
swapDevices = [{
device = "/dev/disk/by-label/swap";
}];
fileSystems."/" = {
device = "/dev/disk/by-label/root";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/nix";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/home";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
}

@ -0,0 +1,24 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
hardware = {
enableAllFirmware = true;
enableRedistributableFirmware = true;
cpu = {
intel = {
updateMicrocode = lib.mkDefault true;
};
};
video = {
hidpi = {
enable = lib.mkDefault true;
};
};
};
}

@ -0,0 +1,11 @@
{ config, lib, pkgs, ... }:
{
networking = {
hostName = "hathor";
networkmanager = {
enable = true;
};
};
}

35
desktops/osiris/boot.nix Normal file

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
{
boot = {
binfmt = {
emulatedSystems = [
"aarch64-linux"
];
};
kernelPackages = lib.mkDefault pkgs.linuxPackages;
cleanTmpDir = true;
loader = {
efi = {
canTouchEfiVariables = true;
};
systemd-boot = {
enable = true;
consoleMode = "2";
configurationLimit = 5;
editor = false;
};
};
kernelModules = [ ];
extraModulePackages = [ ];
initrd = {
availableKernelModules = [ ];
kernelModules = [ "dm-snapshot" ];
};
};
}

@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
{
imports = [
../../shared/modules
../../shared/programs
../../shared/services
./filesystems.nix
./boot.nix
./networking.nix
./hardware.nix
];
personal = {
programs = {
citrix = {
enable = config.personal.programs.enable;
};
};
services = {
desktop = {
enable = config.personal.services.enable;
};
docker = {
enable = config.personal.services.enable;
};
libvirt = {
enable = config.personal.services.enable;
};
tailscale = {
enable = config.personal.services.enable;
};
};
};
system = {
stateVersion = "21.11";
};
}

@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }:
{
swapDevices = [{
device = "/dev/disk/by-label/swap";
}];
fileSystems."/" = {
device = "/dev/disk/by-label/root";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/nix";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/home";
fsType = "ext4";
options = [
"noatime"
"discard"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
}

@ -0,0 +1,24 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
hardware = {
enableAllFirmware = true;
enableRedistributableFirmware = true;
cpu = {
intel = {
updateMicrocode = lib.mkDefault true;
};
};
video = {
hidpi = {
enable = lib.mkDefault true;
};
};
};
}

@ -0,0 +1,11 @@
{ config, lib, pkgs, ... }:
{
networking = {
hostName = "osiris";
networkmanager = {
enable = true;
};
};
}

@ -78,7 +78,27 @@
{ {
nixosConfigurations = { nixosConfigurations = {
chnum = mkComputer chnum = mkComputer
./machines/chnum ./desktops/chnum
"x86_64-linux"
[
./profiles/thomas
# ./profiles/anna
# ./profiles/adrian
# ./profiles/tabea
];
hathor = mkComputer
./desktops/hathor
"x86_64-linux"
[
./profiles/thomas
# ./profiles/anna
# ./profiles/adrian
# ./profiles/tabea
];
osiris = mkComputer
./desktops/osiris
"x86_64-linux" "x86_64-linux"
[ [
./profiles/thomas ./profiles/thomas
@ -88,7 +108,7 @@
]; ];
niflheim = mkComputer niflheim = mkComputer
./machines/niflheim ./servers/niflheim
"x86_64-linux" "x86_64-linux"
[ [
./profiles/thomas ./profiles/thomas
@ -98,7 +118,7 @@
]; ];
asgard = mkComputer asgard = mkComputer
./machines/asgard ./servers/asgard
"x86_64-linux" "x86_64-linux"
[ [
./profiles/thomas ./profiles/thomas
@ -108,7 +128,7 @@
]; ];
utgard = mkComputer utgard = mkComputer
./machines/utgard ./servers/utgard
"x86_64-linux" "x86_64-linux"
[ [
./profiles/thomas ./profiles/thomas
@ -118,7 +138,7 @@
]; ];
midgard = mkComputer midgard = mkComputer
./machines/midgard ./servers/midgard
"aarch64-linux" "aarch64-linux"
[ [
hardware.nixosModules.raspberry-pi-4 hardware.nixosModules.raspberry-pi-4
@ -130,6 +150,9 @@
}; };
chnum = self.nixosConfigurations.chnum.config.system.build.toplevel; chnum = self.nixosConfigurations.chnum.config.system.build.toplevel;
hathor = self.nixosConfigurations.hathor.config.system.build.toplevel;
osiris = self.nixosConfigurations.osiris.config.system.build.toplevel;
niflheim = self.nixosConfigurations.niflheim.config.system.build.toplevel; niflheim = self.nixosConfigurations.niflheim.config.system.build.toplevel;
asgard = self.nixosConfigurations.asgard.config.system.build.toplevel; asgard = self.nixosConfigurations.asgard.config.system.build.toplevel;
utgard = self.nixosConfigurations.utgard.config.system.build.toplevel; utgard = self.nixosConfigurations.utgard.config.system.build.toplevel;

@ -1,24 +0,0 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.services.prowlarr;
in
{
config = mkIf cfg.enable {
systemd.services.prowlarr = {
description = "Prowlarr";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = mkForce {
Type = "simple";
User = cfg.user;
Group = cfg.group;
ExecStart = "${cfg.package}/bin/Prowlarr -nobrowser -data='${cfg.dataDir}'";
Restart = "on-failure";
};
};
};
}

@ -1,33 +0,0 @@
{ pkgs, lib, config, options, ... }:
with lib;
{
imports = [
./acme.nix
./adguard.nix
./citrix.nix
./coredns.nix
./desktop.nix
./docker.nix
./hass.nix
./haveged.nix
./libvirt.nix
./media.nix
./nixbuild.nix
./openssh.nix
./shares.nix
./tailscale.nix
./timesyncd.nix
./webserver.nix
];
options = {
personal = {
services = {
enable = mkEnableOption "Services" // {
default = true;
};
};
};
};
}

@ -2,8 +2,9 @@
{ {
imports = [ imports = [
../modules ../../shared/modules
../services ../../shared/programs
../../shared/services
./filesystems.nix ./filesystems.nix
./boot.nix ./boot.nix
@ -13,7 +14,7 @@
personal = { personal = {
services = { services = {
docker = { shares = {
enable = config.personal.services.enable; enable = config.personal.services.enable;
}; };
tailscale = { tailscale = {

@ -13,6 +13,14 @@
]; ];
}; };
# fileSystems."/nix" = {
# device = "/dev/disk/by-label/nix";
# fsType = "ext4";
# options = [
# "noatime"
# ];
# };
fileSystems."/home" = { fileSystems."/home" = {
device = "/dev/disk/by-label/home"; device = "/dev/disk/by-label/home";
fsType = "ext4"; fsType = "ext4";
@ -39,7 +47,9 @@
fileSystems."/exports/shares" = { fileSystems."/exports/shares" = {
device = "/var/lib/shares"; device = "/var/lib/shares";
options = [ "bind" ]; options = [
"bind"
];
}; };
fileSystems."/var/lib/photos" = { fileSystems."/var/lib/photos" = {
@ -52,7 +62,9 @@
fileSystems."/exports/photos" = { fileSystems."/exports/photos" = {
device = "/var/lib/photos"; device = "/var/lib/photos";
options = [ "bind" ]; options = [
"bind"
];
}; };
fileSystems."/var/lib/videos" = { fileSystems."/var/lib/videos" = {
@ -65,7 +77,9 @@
fileSystems."/exports/videos" = { fileSystems."/exports/videos" = {
device = "/var/lib/videos"; device = "/var/lib/videos";
options = [ "bind" ]; options = [
"bind"
];
}; };
fileSystems."/var/lib/movies" = { fileSystems."/var/lib/movies" = {
@ -78,7 +92,9 @@
fileSystems."/exports/movies" = { fileSystems."/exports/movies" = {
device = "/var/lib/movies"; device = "/var/lib/movies";
options = [ "bind" ]; options = [
"bind"
];
}; };
fileSystems."/var/lib/shows" = { fileSystems."/var/lib/shows" = {
@ -91,7 +107,9 @@
fileSystems."/exports/shows" = { fileSystems."/exports/shows" = {
device = "/var/lib/shows"; device = "/var/lib/shows";
options = [ "bind" ]; options = [
"bind"
];
}; };
fileSystems."/var/lib/books" = { fileSystems."/var/lib/books" = {
@ -104,7 +122,9 @@
fileSystems."/exports/books" = { fileSystems."/exports/books" = {
device = "/var/lib/books"; device = "/var/lib/books";
options = [ "bind" ]; options = [
"bind"
];
}; };
fileSystems."/var/lib/music" = { fileSystems."/var/lib/music" = {
@ -117,7 +137,9 @@
fileSystems."/exports/music" = { fileSystems."/exports/music" = {
device = "/var/lib/music"; device = "/var/lib/music";
options = [ "bind" ]; options = [
"bind"
];
}; };
fileSystems."/var/lib/printer" = { fileSystems."/var/lib/printer" = {
@ -130,7 +152,9 @@
fileSystems."/exports/printer" = { fileSystems."/exports/printer" = {
device = "/var/lib/printer"; device = "/var/lib/printer";
options = [ "bind" ]; options = [
"bind"
];
}; };
fileSystems."/var/lib/backup" = { fileSystems."/var/lib/backup" = {

@ -2,8 +2,9 @@
{ {
imports = [ imports = [
../modules ../../shared/modules
../services ../../shared/programs
../../shared/services
./filesystems.nix ./filesystems.nix
./boot.nix ./boot.nix
@ -22,9 +23,6 @@
coredns = { coredns = {
enable = config.personal.services.enable; enable = config.personal.services.enable;
}; };
docker = {
enable = config.personal.services.enable;
};
tailscale = { tailscale = {
enable = config.personal.services.enable; enable = config.personal.services.enable;
}; };

@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
{
imports = [
../../shared/modules
../../shared/programs
../../shared/services
./filesystems.nix
./boot.nix
./networking.nix
./hardware.nix
];
personal = {
services = {
authentik = {
enable = config.personal.services.enable;
};
dst = {
enable = config.personal.services.enable;
};
mediang = {
enable = config.personal.services.enable;
};
minecraft = {
enable = config.personal.services.enable;
};
owncloud = {
enable = config.personal.services.enable;
};
tailscale = {
enable = config.personal.services.enable;
};
};
};
system = {
stateVersion = "21.11";
};
}

@ -11,7 +11,7 @@
]; ];
interfaces = { interfaces = {
enp2s0 = { enp0s1 = {
ipv4 = { ipv4 = {
addresses = [{ addresses = [{
address = "192.168.64.4"; address = "192.168.64.4";

@ -2,8 +2,8 @@
{ {
imports = [ imports = [
../modules ../../shared/modules
../services ../../shared/services
./filesystems.nix ./filesystems.nix
./boot.nix ./boot.nix

@ -0,0 +1,13 @@
{ pkgs, lib, config, options, ... }:
{
imports = [
./global
./network
./nixpkgs
./shells
./sudo
./tools
./users
];
}

@ -2,16 +2,6 @@
with lib; with lib;
{ {
imports = [
./network.nix
./nixpkgs.nix
./prowlarr.nix
./shells.nix
./sudo.nix
./tools.nix
./users.nix
];
config = { config = {
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;

@ -42,11 +42,11 @@ with lib;
}; };
age.secrets."users/root/password" = { age.secrets."users/root/password" = {
file = ../../secrets/users/root/password.age; file = ../../../secrets/users/root/password.age;
}; };
age.secrets."users/admin/password" = { age.secrets."users/admin/password" = {
file = ../../secrets/users/admin/password.age; file = ../../../secrets/users/admin/password.age;
}; };
}; };
} }

@ -2,13 +2,13 @@
with lib; with lib;
let let
cfg = config.personal.services.citrix; cfg = config.personal.programs.citrix;
in in
{ {
options = { options = {
personal = { personal = {
services = { programs = {
citrix = { citrix = {
enable = mkEnableOption "Citrix"; enable = mkEnableOption "Citrix";
}; };

@ -0,0 +1,18 @@
{ pkgs, lib, config, options, ... }:
with lib;
{
imports = [
./citrix
];
options = {
personal = {
programs = {
enable = mkEnableOption "Programs" // {
default = true;
};
};
};
};
}

@ -36,7 +36,7 @@ in
}; };
age.secrets."services/acme/credentials" = { age.secrets."services/acme/credentials" = {
file = ../../secrets/services/acme/credentials.age; file = ../../../secrets/services/acme/credentials.age;
owner = "acme"; owner = "acme";
}; };
}; };

@ -0,0 +1,4 @@
{ pkgs, lib, config, options, ... }:
with lib;
{ }

@ -0,0 +1,20 @@
{ pkgs, lib, config, options, fetchurl, ... }:
with lib;
let
cfg = config.personal.services.authentik;
in
{
options = {
personal = {
services = {
authentik = {
enable = mkEnableOption "Authentik";
};
};
};
};
config = mkIf cfg.enable { };
}

@ -0,0 +1,37 @@
{ pkgs, lib, config, options, ... }:
with lib;
{
imports = [
./acme
./adguard
./authentik
./coredns
./desktop
./docker
./dst
./hass
./haveged
./libvirt
./media
./mediang
./minecraft
./nixbuild
./openssh
./owncloud
./shares
./tailscale
./timesyncd
./webserver
];
options = {
personal = {
services = {
enable = mkEnableOption "Services" // {
default = true;
};
};
};
};
}

@ -0,0 +1,4 @@
{ pkgs, lib, config, options, ... }:
with lib;
{ }

@ -0,0 +1,20 @@
{ pkgs, lib, config, options, fetchurl, ... }:
with lib;
let
cfg = config.personal.services.dst;
in
{
options = {
personal = {
services = {
dst = {
enable = mkEnableOption "Don't Starve Together";
};
};
};
};
config = mkIf cfg.enable { };
}

@ -0,0 +1,4 @@
{ pkgs, lib, config, options, ... }:
with lib;
{ }

@ -173,7 +173,7 @@ in
}; };
age.secrets."users/media/password" = { age.secrets."users/media/password" = {
file = ../../secrets/users/media/password.age; file = ../../../secrets/users/media/password.age;
}; };
}; };
} }

@ -0,0 +1,4 @@
{ pkgs, lib, config, options, ... }:
with lib;
{ }

@ -0,0 +1,215 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.personal.services.mediang;
in
{
options = {
personal = {
services = {
mediang = {
enable = mkEnableOption "Media";
};
};
};
};
config = mkIf cfg.enable {
# networking = {
# nat = {
# enable = true;
# internalInterfaces = ["ve-+"];
# externalInterface = "ens3";
# };
# };
containers = {
media =
let
passwordFile = config.age.secrets."users/media/password".path;
in
{
autoStart = true;
privateNetwork = true;
# hostAddress = "192.168.100.10";
# localAddress = "192.168.100.11";
config = { config, pkgs, ... }: {
users = {
users = {
media = {
uid = 20000;
description = "Media";
shell = pkgs.zsh;
isSystemUser = true;
group = "media";
home = "/var/lib/media";
passwordFile = passwordFile;
};
};
groups = {
media = {
gid = 20000;
};
};
};
services = {
jellyfin = {
enable = true;
user = "media";
group = "media";
package = pkgs.jellyfin;
};
};
networking.firewall = {
enable = true;
allowedTCPPorts = [
8080
];
};
environment.etc."resolv.conf".text = "nameserver 8.8.8.8";
system.stateVersion = "22.05";
};
};
};
age.secrets."users/media/password" = {
file = ../../../secrets/users/media/password.age;
};
};
}
# services = {
# nzbget = {
# enable = true;
# user = "media";
# group = "media";
# settings = {
# MainDir = "/var/lib/downloads";
# DestDir = "/var/lib/downloads/completed";
# InterDir = "/var/lib/downloads/intermediate";
# NzbDir = "/var/lib/downloads/nzb";
# QueueDir = "/var/lib/downloads/queue";
# TempDir = "/var/lib/downloads/temp";
# ScriptDir = "/var/lib/downloads/scripts";
# "Category1.Name" = "Movies";
# "Category1.Unpack" = "yes";
# "Category2.Name" = "Series";
# "Category2.Unpack" = "yes";
# "Category3.Name" = "Music";
# "Category3.Unpack" = "yes";
# "Category4.Name" = "Books";
# "Category4.Unpack" = "yes";
# "Category5.Name" = "Prowlarr";
# "Category5.Unpack" = "yes";
# };
# };
# jellyfin = {
# enable = true;
# user = "media";
# group = "media";
# package = pkgs.jellyfin;
# };
# radarr = {
# enable = true;
# user = "media";
# group = "media";
# package = pkgs.radarr;
# dataDir = "/var/lib/radarr";
# };
# sonarr = {
# enable = true;
# user = "media";
# group = "media";
# package = pkgs.sonarr;
# dataDir = "/var/lib/sonarr";
# };
# lidarr = {
# enable = true;
# user = "media";
# group = "media";
# package = pkgs.lidarr;
# dataDir = "/var/lib/lidarr";
# };
# readarr = {
# enable = true;
# user = "media";
# group = "media";
# package = pkgs.nur.repos.tboerger.readarr;
# dataDir = "/var/lib/readarr";
# };
# bazarr = {
# enable = true;
# user = "media";
# group = "media";
# package = pkgs.bazarr;
# };
# prowlarr = {
# enable = true;
# user = "media";
# group = "media";
# package = pkgs.prowlarr;
# };
# nginx = {
# virtualHosts =
# let
# base = locations: {
# inherit locations;
# useACMEHost = "boerger.ws";
# forceSSL = true;
# };
# proxy = port: base {
# "/" = {
# proxyPass = "http://127.0.0.1:" + toString (port) + "/";
# proxyWebsockets = true;
# };
# };
# in
# {
# "nzbget.boerger.ws" = proxy 6789;
# "jellyfin.boerger.ws" = proxy 8096;
# "radarr.boerger.ws" = proxy 7878;
# "sonarr.boerger.ws" = proxy 8989;
# "lidarr.boerger.ws" = proxy 8686;
# "readarr.boerger.ws" = proxy 8787;
# "bazarr.boerger.ws" = proxy 6767;
# "prowlarr.boerger.ws" = proxy 9696;
# };
# };
# };
# personal = {
# services = {
# webserver = {
# enable = true;
# };
# };
# };
# networking = {
# firewall = {
# allowedTCPPorts = [ 8096 ];
# allowedUDPPorts = [ 1900 7359 ];
# };
# };

@ -0,0 +1,4 @@
{ pkgs, lib, config, options, ... }:
with lib;
{ }

@ -0,0 +1,20 @@
{ pkgs, lib, config, options, fetchurl, ... }:
with lib;
let
cfg = config.personal.services.minecraft;
in
{
options = {
personal = {
services = {
minecraft = {
enable = mkEnableOption "Minecraft";
};
};
};
};
config = mkIf cfg.enable { };
}

@ -69,7 +69,7 @@ in
}; };
age.secrets."services/nixbuild/sshkey" = { age.secrets."services/nixbuild/sshkey" = {
file = ../../secrets/services/nixbuild/sshkey.age; file = ../../../secrets/services/nixbuild/sshkey.age;
}; };
}; };
} }

@ -0,0 +1,4 @@
{ pkgs, lib, config, options, ... }:
with lib;
{ }

@ -0,0 +1,20 @@
{ pkgs, lib, config, options, fetchurl, ... }:
with lib;
let
cfg = config.personal.services.owncloud;
in
{
options = {
personal = {
services = {
owncloud = {
enable = mkEnableOption "ownCloud";
};
};
};
};
config = mkIf cfg.enable { };
}

@ -0,0 +1,4 @@
{ pkgs, lib, config, options, ... }:
with lib;
{ }

@ -214,11 +214,11 @@ in
}; };
age.secrets."users/printer/password" = { age.secrets."users/printer/password" = {
file = ../../secrets/users/printer/password.age; file = ../../../secrets/users/printer/password.age;
}; };
age.secrets."users/media/password" = { age.secrets."users/media/password" = {
file = ../../secrets/users/media/password.age; file = ../../../secrets/users/media/password.age;
}; };
}; };
} }

@ -51,7 +51,7 @@ in
}; };
age.secrets."services/tailscale/authkey" = { age.secrets."services/tailscale/authkey" = {
file = ../../secrets/services/tailscale/authkey.age; file = ../../../secrets/services/tailscale/authkey.age;
}; };
}; };
} }