2023-07-16 22:17:50 +00:00
|
|
|
args@{ pkgs, config, ... }:
|
2023-04-13 14:45:01 +00:00
|
|
|
|
|
|
|
let
|
2023-04-20 19:41:45 +00:00
|
|
|
secret = import ../../secret/hosts/mediaserver.nix;
|
2023-04-13 14:45:01 +00:00
|
|
|
ssh-keys = import ../shared/ssh-keys.nix;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
../../hardware/hosts/mediaserver.nix
|
|
|
|
../../agenix/hosts/mediaserver/config.nix
|
2023-05-14 19:24:51 +00:00
|
|
|
../shared/show-update-changelog.nix
|
2023-04-13 14:45:01 +00:00
|
|
|
../nixos/ssh.nix
|
2024-01-21 12:09:54 +00:00
|
|
|
../nixos/eternal-terminal.nix
|
2023-04-13 14:45:01 +00:00
|
|
|
|
|
|
|
../nixos/git.nix
|
2023-04-13 14:51:18 +00:00
|
|
|
|
2023-04-14 13:20:51 +00:00
|
|
|
../nixos/acme-mediaserver.nix
|
|
|
|
../nixos/nginx.nix
|
2023-09-04 10:45:06 +00:00
|
|
|
../nixos/nginx-mediaserver.nix
|
2023-08-14 13:37:36 +00:00
|
|
|
../nixos/postgresql.nix
|
2023-04-14 13:20:51 +00:00
|
|
|
|
2023-06-10 18:48:07 +00:00
|
|
|
(import ../nixos/adguardhome.nix (args // { inherit secret; }))
|
|
|
|
|
2023-04-13 14:51:18 +00:00
|
|
|
../nixos/attic.nix
|
2023-04-13 16:16:44 +00:00
|
|
|
|
2024-02-11 18:07:09 +00:00
|
|
|
../nixos/ddg.nix
|
2023-05-18 11:02:06 +00:00
|
|
|
|
2023-04-13 16:16:44 +00:00
|
|
|
../nixos/tailscale.nix
|
2024-05-25 13:47:17 +00:00
|
|
|
../nixos/tailscale-nodns.nix
|
2023-04-13 20:46:32 +00:00
|
|
|
|
2023-08-20 23:08:23 +00:00
|
|
|
../nixos/unbound.nix
|
|
|
|
|
2023-05-24 11:02:56 +00:00
|
|
|
../nixos/container.nix
|
2023-04-15 17:43:09 +00:00
|
|
|
../nixos/mediaserver-setup.nix
|
2023-04-20 19:41:45 +00:00
|
|
|
(import ../nixos/wireguard-netns.nix (args // { inherit secret; }))
|
2023-05-20 22:50:04 +00:00
|
|
|
(import ../nixos/wireguard-firewall-mediaserver.nix (args // { inherit secret; }))
|
2023-04-13 20:53:38 +00:00
|
|
|
../nixos/prowlarr.nix
|
2023-05-24 11:02:56 +00:00
|
|
|
../nixos/autobrr.nix
|
2023-05-21 21:14:53 +00:00
|
|
|
../nixos/unpackerr.nix
|
2023-04-15 22:11:15 +00:00
|
|
|
../nixos/sonarr.nix
|
2023-04-15 22:46:06 +00:00
|
|
|
../nixos/radarr.nix
|
2023-10-08 10:49:01 +00:00
|
|
|
../nixos/recyclarr.nix
|
2023-05-20 11:15:01 +00:00
|
|
|
../nixos/sabnzbd.nix
|
|
|
|
../nixos/qbittorrent.nix
|
2023-06-03 11:47:54 +00:00
|
|
|
../nixos/flaresolverr.nix
|
2023-04-19 19:30:42 +00:00
|
|
|
../nixos/jellyfin.nix
|
2023-04-26 11:53:36 +00:00
|
|
|
../nixos/aria2.nix
|
2023-04-17 15:11:07 +00:00
|
|
|
|
2023-05-24 11:02:56 +00:00
|
|
|
../nixos/convos.nix
|
|
|
|
|
2023-04-20 13:02:34 +00:00
|
|
|
../../container/tubearchivist
|
2023-04-18 11:49:03 +00:00
|
|
|
../../secret/container/additional-media
|
2023-04-13 14:45:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
system.stateVersion = "22.11";
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
package = pkgs.nixVersions.stable;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
auto-optimise-store = true;
|
|
|
|
|
|
|
|
substituters = [
|
2023-12-14 17:29:26 +00:00
|
|
|
"https://attic.cache.daniel.sx/nifoc-systems?priority=1"
|
|
|
|
"https://attic.cache.daniel.sx/nifoc-ci?priority=2"
|
|
|
|
"https://nix-community.cachix.org?priority=3"
|
2024-07-03 12:40:31 +00:00
|
|
|
"https://cache.garnix.io?priority=4"
|
2023-04-13 14:45:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
trusted-public-keys = [
|
|
|
|
"nifoc-systems:eDDqVP5BFR6/1KvXbF9oUL8JahDdmbrsYtxlQ57LOTU="
|
2023-09-18 09:23:08 +00:00
|
|
|
"nifoc-ci:JpD9zqVQi8JuS7B8htPDOQZh08rhInMnGFS9RVhiuwk="
|
2023-04-13 14:45:01 +00:00
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
2024-07-03 12:40:31 +00:00
|
|
|
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
2023-04-13 14:45:01 +00:00
|
|
|
];
|
2023-10-25 21:31:32 +00:00
|
|
|
|
|
|
|
trusted-users = [
|
|
|
|
"root"
|
|
|
|
"nix-remote-builder"
|
|
|
|
];
|
2023-04-13 14:45:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "weekly";
|
|
|
|
options = "--delete-older-than 14d";
|
|
|
|
};
|
|
|
|
|
|
|
|
extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
extra-platforms = aarch64-linux
|
|
|
|
keep-derivations = true
|
|
|
|
keep-outputs = true
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-12-05 10:51:55 +00:00
|
|
|
environment.etc."nix/netrc".source = ../../secret/shared/nix-netrc;
|
2023-04-13 14:45:01 +00:00
|
|
|
|
|
|
|
boot = {
|
2023-04-14 15:36:49 +00:00
|
|
|
tmp.cleanOnBoot = true;
|
2023-04-13 14:45:01 +00:00
|
|
|
|
|
|
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
|
|
|
};
|
|
|
|
|
2023-07-04 08:41:03 +00:00
|
|
|
zramSwap = {
|
|
|
|
enable = true;
|
|
|
|
memoryPercent = 25;
|
|
|
|
};
|
2023-04-13 14:45:01 +00:00
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "mediaserver";
|
|
|
|
useNetworkd = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
networks = {
|
|
|
|
"10-lan" = {
|
|
|
|
matchConfig.Name = "ens3";
|
|
|
|
networkConfig = {
|
2023-04-14 18:31:24 +00:00
|
|
|
DHCP = "yes";
|
|
|
|
IPv6AcceptRA = true;
|
2023-04-14 19:43:19 +00:00
|
|
|
IPv6PrivacyExtensions = true;
|
2023-04-13 14:45:01 +00:00
|
|
|
};
|
|
|
|
linkConfig.RequiredForOnline = "routable";
|
|
|
|
|
|
|
|
ntp = [
|
|
|
|
"ptbtime1.ptb.de"
|
|
|
|
"ptbtime2.ptb.de"
|
|
|
|
"ptbtime3.ptb.de"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2023-05-09 07:15:01 +00:00
|
|
|
|
2023-05-15 18:34:08 +00:00
|
|
|
wait-online.extraArgs = [
|
|
|
|
"--interface=ens3"
|
2023-05-09 07:15:01 +00:00
|
|
|
];
|
2023-04-13 14:45:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
services.journald.extraConfig = ''
|
|
|
|
SystemMaxUse=1G
|
2023-10-11 12:41:14 +00:00
|
|
|
MaxRetentionSec=30day
|
2023-04-13 14:45:01 +00:00
|
|
|
'';
|
|
|
|
|
2023-11-12 21:40:40 +00:00
|
|
|
security.sudo.enable = true;
|
|
|
|
|
2023-04-13 14:45:01 +00:00
|
|
|
documentation = {
|
|
|
|
nixos.enable = false;
|
|
|
|
doc.enable = false;
|
|
|
|
};
|
|
|
|
|
2023-07-16 22:17:50 +00:00
|
|
|
fonts.fontconfig.enable = false;
|
|
|
|
sound.enable = false;
|
|
|
|
|
2023-10-25 21:31:32 +00:00
|
|
|
programs = {
|
|
|
|
fish.enable = true;
|
|
|
|
zsh.enable = true;
|
|
|
|
htop.enable = true;
|
|
|
|
};
|
2023-04-13 14:45:01 +00:00
|
|
|
|
|
|
|
users.users = {
|
|
|
|
root = {
|
|
|
|
openssh.authorizedKeys.keys = [ ssh-keys.LAN ];
|
|
|
|
};
|
|
|
|
|
|
|
|
daniel = {
|
2023-09-16 11:08:38 +00:00
|
|
|
hashedPasswordFile = config.age.secrets.user-daniel-password.path;
|
2023-04-13 14:45:01 +00:00
|
|
|
isNormalUser = true;
|
|
|
|
home = "/home/daniel";
|
|
|
|
description = "Daniel";
|
|
|
|
extraGroups = [ "wheel" ];
|
|
|
|
shell = pkgs.fish;
|
2024-01-21 12:09:54 +00:00
|
|
|
openssh.authorizedKeys.keys = [ ssh-keys.LAN ssh-keys.DanielsPhone ];
|
2023-04-13 14:45:01 +00:00
|
|
|
};
|
2023-10-25 21:31:32 +00:00
|
|
|
|
|
|
|
nix-remote-builder = {
|
|
|
|
isNormalUser = true;
|
|
|
|
home = "/home/nix-remote-builder";
|
|
|
|
description = "Nix Remote Builder";
|
|
|
|
shell = pkgs.zsh;
|
|
|
|
openssh.authorizedKeys.keys = [ ssh-keys.NixRemoteBuilder ];
|
|
|
|
};
|
2023-04-13 14:45:01 +00:00
|
|
|
};
|
|
|
|
}
|