2020-05-08 22:26:21 +00:00
|
|
|
{ depot, lib, pkgs, rebuilder, config, ... }:
|
2020-05-05 23:28:23 +00:00
|
|
|
let
|
|
|
|
inherit (depot.ops) secrets;
|
2020-05-09 11:56:56 +00:00
|
|
|
machineSecrets = secrets.machineSpecific.clouvider-fra01;
|
2020-05-05 23:28:23 +00:00
|
|
|
in {
|
2020-05-08 22:26:21 +00:00
|
|
|
imports = [
|
|
|
|
../lib/zfs.nix
|
|
|
|
../lib/bgp.nix
|
|
|
|
];
|
|
|
|
|
2020-05-05 23:28:23 +00:00
|
|
|
boot.initrd.availableKernelModules = [
|
|
|
|
"xhci_pci"
|
|
|
|
"ahci"
|
|
|
|
"nvme"
|
|
|
|
"usbhid"
|
|
|
|
"usb_storage"
|
|
|
|
"sd_mod"
|
|
|
|
"sr_mod"
|
|
|
|
];
|
2020-05-08 22:26:21 +00:00
|
|
|
boot.kernelModules = [ "kvm-intel" ];
|
2020-05-05 23:28:23 +00:00
|
|
|
|
|
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
|
|
|
|
|
|
|
fileSystems = let
|
|
|
|
zfs = device: {
|
|
|
|
device = device;
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
"/" = zfs "zfast/local/root";
|
|
|
|
"/nix" = zfs "zfast/local/nix";
|
|
|
|
"/persist" = zfs "zfast/safe/persist";
|
|
|
|
"/home" = zfs "zfast/safe/home";
|
|
|
|
"/store" = zfs "zslow/local/store";
|
|
|
|
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-label/ESP";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nix.maxJobs = lib.mkDefault 12;
|
|
|
|
|
|
|
|
# Use systemd-boot.
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
|
|
|
# Networking!
|
|
|
|
networking = {
|
|
|
|
hostName = "clouvider-fra01";
|
|
|
|
domain = "as205479.net";
|
|
|
|
hostId = "9e983570";
|
|
|
|
|
|
|
|
nameservers = [
|
|
|
|
"2001:4860:4860::8888"
|
|
|
|
"2001:4860:4860::8844"
|
|
|
|
"8.8.8.8"
|
|
|
|
"8.8.4.4"
|
|
|
|
];
|
|
|
|
useDHCP = false;
|
|
|
|
defaultGateway = {
|
|
|
|
address = "193.228.196.56";
|
|
|
|
interface = "enp1s0";
|
|
|
|
};
|
|
|
|
defaultGateway6 = {
|
|
|
|
address = "2a0f:93c0:0:22::1";
|
|
|
|
interface = "enp1s0";
|
|
|
|
};
|
|
|
|
interfaces.enp1s0 = {
|
|
|
|
useDHCP = false;
|
|
|
|
ipv4.addresses = [{ address = "193.228.196.57"; prefixLength = 31; }];
|
|
|
|
ipv6.addresses = [{ address = "2a0f:93c0:0:22::2"; prefixLength = 126; }];
|
|
|
|
};
|
|
|
|
firewall.allowPing = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
# $ nix search wget
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
mercurial
|
|
|
|
rebuilder
|
|
|
|
];
|
|
|
|
|
|
|
|
programs.mtr.enable = true;
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
|
|
# Define a user account.
|
|
|
|
users.mutableUsers = false;
|
|
|
|
users.users = {
|
2020-05-08 22:26:21 +00:00
|
|
|
lukegb.extraGroups = [ "wheel" "content" ];
|
2020-05-06 09:14:04 +00:00
|
|
|
content = {
|
|
|
|
isSystemUser = true;
|
|
|
|
extraGroups = [ "content" ];
|
|
|
|
};
|
2020-05-09 10:14:37 +00:00
|
|
|
plex.extraGroups = [ "content" ];
|
|
|
|
deluge.extraGroups = [ "content" ];
|
2020-05-06 09:14:04 +00:00
|
|
|
};
|
|
|
|
users.groups = {
|
|
|
|
content = {};
|
2020-05-05 23:28:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
services.openssh.hostKeys = [
|
|
|
|
{
|
|
|
|
path = "/persist/etc/ssh/ssh_host_ed25519_key";
|
|
|
|
type = "ed25519";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
path = "/persist/etc/ssh/ssh_host_rsa_key";
|
|
|
|
type = "rsa";
|
|
|
|
bits = 4096;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2020-05-06 09:02:00 +00:00
|
|
|
services.plex = {
|
|
|
|
enable = true;
|
|
|
|
dataDir = "/store/plex";
|
|
|
|
openFirewall = true;
|
|
|
|
package = depot.nix.pkgs.plex-pass;
|
|
|
|
};
|
|
|
|
|
2020-05-09 10:14:37 +00:00
|
|
|
services.deluge = {
|
|
|
|
enable = true;
|
|
|
|
declarative = true;
|
|
|
|
openFirewall = true;
|
|
|
|
dataDir = "/store/deluge";
|
|
|
|
config = {
|
|
|
|
upnp = false;
|
|
|
|
natpmp = false;
|
|
|
|
max_active_seeding = 100;
|
|
|
|
max_active_downloading = 100;
|
|
|
|
max_active_limit = 200;
|
|
|
|
move_completed_paths_list = [ "/store/content/Anime" "/store/content/Films" "/store/content/TV" ];
|
|
|
|
};
|
2020-05-09 11:56:56 +00:00
|
|
|
authFile = machineSecrets.delugeAuthFile;
|
2020-05-09 10:14:37 +00:00
|
|
|
|
|
|
|
web.enable = true;
|
|
|
|
};
|
|
|
|
|
2020-05-05 23:28:23 +00:00
|
|
|
system.stateVersion = "20.03";
|
|
|
|
}
|