2023-06-15 16:44:31 +02:00
|
|
|
# NUC in my closet.
|
|
|
|
_: # ignore readTree options
|
|
|
|
|
|
|
|
{ config, depot, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
mod = name: depot.path.origSrc + ("/ops/modules/" + name);
|
|
|
|
usermod = name: depot.path.origSrc + ("/users/tazjin/nixos/modules/" + name);
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
(mod "quassel.nix")
|
|
|
|
(mod "www/base.nix")
|
|
|
|
];
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
loader.systemd-boot.enable = true;
|
|
|
|
loader.efi.canTouchEfiVariables = true;
|
|
|
|
initrd.availableKernelModules = [ "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
|
|
|
kernelModules = [ "kvm-intel" ];
|
|
|
|
kernelParams = [ "nomodeset" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nix.settings.trusted-users = [ "tazjin" ];
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "rpool/root";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-uuid/E214-E6B3";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/var" = {
|
|
|
|
device = "rpool/var";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/home" = {
|
|
|
|
device = "rpool/home";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
services.fwupd.enable = true;
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "koptevo";
|
|
|
|
hostId = "07bbbf4f";
|
|
|
|
domain = "tazj.in";
|
|
|
|
useDHCP = true;
|
|
|
|
firewall.enable = true;
|
2023-06-15 22:20:07 +02:00
|
|
|
firewall.allowedTCPPorts = [ 22 80 443 ];
|
2023-06-15 16:44:31 +02:00
|
|
|
|
|
|
|
wireless.enable = true;
|
|
|
|
wireless.networks."How do I computer fast?" = {
|
|
|
|
psk = "washyourface";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
time.timeZone = "UTC";
|
|
|
|
|
|
|
|
security.acme.acceptTerms = true;
|
2023-06-15 22:20:07 +02:00
|
|
|
security.acme.defaults.email = lib.mkForce "acme@tazj.in";
|
2023-06-15 16:44:31 +02:00
|
|
|
|
|
|
|
programs.fish.enable = true;
|
|
|
|
|
|
|
|
users.users.tazjin = {
|
|
|
|
isNormalUser = true;
|
2023-06-15 22:20:07 +02:00
|
|
|
extraGroups = [ "wheel" "docker" "systemd-journal" ];
|
2023-06-15 16:44:31 +02:00
|
|
|
shell = pkgs.fish;
|
|
|
|
openssh.authorizedKeys.keys = depot.users.tazjin.keys.all;
|
|
|
|
};
|
|
|
|
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
|
2023-06-15 22:20:07 +02:00
|
|
|
services.openssh.enable = true;
|
|
|
|
|
2023-06-15 16:44:31 +02:00
|
|
|
services.depot.quassel = {
|
|
|
|
enable = true;
|
|
|
|
acmeHost = "koptevo.tazj.in";
|
|
|
|
bindAddresses = [
|
|
|
|
"0.0.0.0"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Automatically collect garbage from the Nix store.
|
|
|
|
services.depot.automatic-gc = {
|
|
|
|
enable = true;
|
|
|
|
interval = "daily";
|
|
|
|
diskThreshold = 2; # GiB # TODO
|
|
|
|
maxFreed = 8; # GiB
|
|
|
|
preserveGenerations = "14d";
|
|
|
|
};
|
|
|
|
|
2023-06-15 22:20:56 +02:00
|
|
|
services.nginx.virtualHosts."koptevo.tazj.in" = {
|
|
|
|
addSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
location = / {
|
|
|
|
return 302 https://at.tvl.fyi/?q=%2F%2Fusers%2Ftazjin%2Fnixos%2Fkoptevo%2Fdefault.nix;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-06-15 16:44:31 +02:00
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
# $ nix search wget
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
curl
|
|
|
|
htop
|
|
|
|
jq
|
|
|
|
nmap
|
|
|
|
bat
|
|
|
|
emacs-nox
|
|
|
|
nano
|
|
|
|
wget
|
|
|
|
];
|
|
|
|
|
|
|
|
programs.mtr.enable = true;
|
|
|
|
programs.mosh.enable = true;
|
2023-06-15 22:20:07 +02:00
|
|
|
|
2023-06-15 16:44:31 +02:00
|
|
|
system.stateVersion = "23.05";
|
|
|
|
}
|