2023-04-13 14:45:01 +00:00
|
|
|
args@{ pkgs, config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
ssh-keys = import ../shared/ssh-keys.nix;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
../../hardware/hosts/mediaserver.nix
|
|
|
|
../../agenix/hosts/mediaserver/config.nix
|
|
|
|
../nixos/ssh.nix
|
|
|
|
|
|
|
|
../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-04-13 14:51:18 +00:00
|
|
|
../nixos/attic.nix
|
2023-04-13 16:16:44 +00:00
|
|
|
|
|
|
|
../nixos/tailscale.nix
|
2023-04-13 20:46:32 +00:00
|
|
|
|
|
|
|
../nixos/wireguard-netns.nix
|
2023-04-13 20:53:38 +00:00
|
|
|
../nixos/prowlarr.nix
|
2023-04-13 14:45:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
system.stateVersion = "22.11";
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
package = pkgs.nixVersions.stable;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
auto-optimise-store = true;
|
|
|
|
|
|
|
|
substituters = [
|
|
|
|
"https://attic.cache.daniel.sx/nifoc-systems"
|
|
|
|
"https://nifoc.cachix.org"
|
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
];
|
|
|
|
|
|
|
|
trusted-public-keys = [
|
|
|
|
"nifoc-systems:eDDqVP5BFR6/1KvXbF9oUL8JahDdmbrsYtxlQ57LOTU="
|
|
|
|
"nifoc.cachix.org-1:ymuftq7RgN/lf/iWXFK8gpwDSAGFaGBeliWe9u6q8II="
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
post-build-hook = ${../../home/programs/scripts/attic-system-cache}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.etc."nix/netrc".source = ../../secret/shared/nix-netrc;
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
cleanTmpDir = true;
|
|
|
|
|
|
|
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
zramSwap.enable = true;
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "mediaserver";
|
|
|
|
useNetworkd = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
networks = {
|
|
|
|
"10-lan" = {
|
|
|
|
matchConfig.Name = "ens3";
|
|
|
|
networkConfig = {
|
|
|
|
DHCP = "yes";
|
|
|
|
IPv6AcceptRA = true;
|
|
|
|
};
|
|
|
|
linkConfig.RequiredForOnline = "routable";
|
|
|
|
|
|
|
|
ntp = [
|
|
|
|
"ptbtime1.ptb.de"
|
|
|
|
"ptbtime2.ptb.de"
|
|
|
|
"ptbtime3.ptb.de"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.journald.extraConfig = ''
|
|
|
|
SystemMaxUse=1G
|
|
|
|
'';
|
|
|
|
|
|
|
|
documentation = {
|
|
|
|
nixos.enable = false;
|
|
|
|
doc.enable = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.fish.enable = true;
|
|
|
|
|
|
|
|
users.users = {
|
|
|
|
root = {
|
|
|
|
openssh.authorizedKeys.keys = [ ssh-keys.LAN ];
|
|
|
|
};
|
|
|
|
|
|
|
|
daniel = {
|
|
|
|
passwordFile = config.age.secrets.user-daniel-password.path;
|
|
|
|
isNormalUser = true;
|
|
|
|
home = "/home/daniel";
|
|
|
|
description = "Daniel";
|
|
|
|
extraGroups = [ "wheel" ];
|
|
|
|
shell = pkgs.fish;
|
|
|
|
openssh.authorizedKeys.keys = [ ssh-keys.LAN ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|