2020-06-28 18:32:52 +00:00
|
|
|
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
{ depot, lib, pkgs, rebuilder, config, ... }:
|
|
|
|
let
|
|
|
|
inherit (depot.ops) secrets;
|
|
|
|
in {
|
|
|
|
imports =
|
2020-06-28 18:38:49 +00:00
|
|
|
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ../lib/client.nix ];
|
2020-06-28 18:32:52 +00:00
|
|
|
|
|
|
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
|
|
|
boot.kernelModules = lib.mkAfter [ "kvm-intel" ];
|
|
|
|
boot.kernelParams = [ "mitigations=off" ];
|
|
|
|
|
|
|
|
fileSystems = let
|
|
|
|
zfs = device: {
|
|
|
|
device = device;
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
"/" = zfs "zboot/safe/root";
|
|
|
|
"/nix" = zfs "zboot/local/nix";
|
|
|
|
|
|
|
|
"/home" = zfs "tank/safe/home";
|
2020-07-04 19:36:38 +00:00
|
|
|
"/export" = zfs "tank/safe/export";
|
2020-06-28 18:32:52 +00:00
|
|
|
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-uuid/D178-4E19";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
|
|
|
nix.maxJobs = lib.mkDefault 8;
|
|
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
|
|
|
|
2020-07-19 16:59:20 +00:00
|
|
|
# Extra packages.
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
oven-media-engine
|
|
|
|
];
|
|
|
|
|
2020-06-28 18:32:52 +00:00
|
|
|
# Networking!
|
|
|
|
networking = {
|
|
|
|
hostName = "totoro"; # Define your hostname.
|
|
|
|
domain = "lukegb.xyz";
|
|
|
|
hostId = "676c08c4";
|
|
|
|
useDHCP = false;
|
2020-06-28 22:22:43 +00:00
|
|
|
interfaces.br-ext.useDHCP = true;
|
|
|
|
bridges.br-ext.interfaces = [ "enp0s31f6" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Virtualisation
|
|
|
|
virtualisation.libvirtd = {
|
|
|
|
enable = true;
|
|
|
|
allowedBridges = [ "virbr0" "br-ext" ];
|
2020-06-28 18:32:52 +00:00
|
|
|
};
|
2020-06-28 22:23:43 +00:00
|
|
|
users.users.lukegb = {
|
2020-07-08 18:35:48 +00:00
|
|
|
packages = with depot.pkgs; [ irssi ];
|
2020-06-28 22:23:43 +00:00
|
|
|
extraGroups = lib.mkAfter [ "libvirtd" ];
|
|
|
|
};
|
2020-06-28 18:32:52 +00:00
|
|
|
|
2020-07-04 19:36:38 +00:00
|
|
|
# NFS
|
|
|
|
services.nfs.server = {
|
|
|
|
enable = true;
|
|
|
|
exports = ''
|
|
|
|
/export 192.168.1.0/24(rw,sync,nohide,no_subtree_check,no_root_squash,wdelay,fsid=0,insecure,crossmnt)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [ 111 2049 ];
|
|
|
|
networking.firewall.allowedUDPPorts = [ 111 2049 ];
|
|
|
|
|
2020-07-08 18:34:33 +00:00
|
|
|
# Distributed builds!
|
|
|
|
nix.buildMachines = [ {
|
|
|
|
hostName = "whitby";
|
|
|
|
system = "x86_64-linux";
|
|
|
|
maxJobs = 64;
|
|
|
|
speedFactor = 2;
|
|
|
|
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
|
|
|
mandatoryFeatures = [ ];
|
|
|
|
}] ;
|
|
|
|
nix.distributedBuilds = true;
|
|
|
|
nix.extraOptions = ''
|
|
|
|
builders-use-substitutes = true
|
|
|
|
'';
|
|
|
|
|
2020-06-28 18:32:52 +00:00
|
|
|
system.stateVersion = "20.03";
|
|
|
|
}
|