2023-09-13 12:17:43 +03:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
myData,
|
|
|
|
...
|
2023-09-17 07:06:19 +03:00
|
|
|
}: let
|
|
|
|
randr = import ./randr.nix;
|
|
|
|
in {
|
2023-11-28 22:57:58 +02:00
|
|
|
boot = {
|
|
|
|
initrd = {
|
2023-09-16 23:05:01 +03:00
|
|
|
availableKernelModules = ["usb_storage" "sd_mod" "xhci_pci" "thunderbolt" "nvme" "usbhid"];
|
2023-11-28 22:57:58 +02:00
|
|
|
};
|
|
|
|
loader.systemd-boot.enable = true;
|
|
|
|
supportedFilesystems = ["zfs"];
|
|
|
|
zfs = {
|
|
|
|
forceImportRoot = false;
|
|
|
|
devNodes = "/dev/disk/by-id/";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "rpool/nixos/root";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_2TB_S6P1NS0TA01331A_1-part2";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
"/home" = {
|
|
|
|
device = "rpool/nixos/home";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
"/nix" = {
|
|
|
|
device = "rpool/nixos/nix";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
"/var/lib" = {
|
|
|
|
device = "rpool/nixos/var/lib";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
"/var/log" = {
|
|
|
|
device = "rpool/nixos/var/log";
|
|
|
|
fsType = "zfs";
|
2023-09-13 12:17:43 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-24 10:53:49 +02:00
|
|
|
powerManagement = {
|
|
|
|
cpuFreqGovernor = "powersave";
|
|
|
|
powertop.enable = true;
|
|
|
|
};
|
|
|
|
|
2023-09-14 12:40:16 +03:00
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
|
|
|
nixpkgs.hostPlatform = "x86_64-linux";
|
|
|
|
|
2023-09-13 12:17:43 +03:00
|
|
|
boot.binfmt.emulatedSystems = ["aarch64-linux"];
|
|
|
|
|
2023-09-14 15:26:16 +03:00
|
|
|
systemd.services.zfs-mount.enable = false;
|
|
|
|
|
2023-09-13 12:17:43 +03:00
|
|
|
mj = {
|
|
|
|
stateVersion = "23.05";
|
|
|
|
timeZone = "Europe/Vilnius";
|
|
|
|
|
|
|
|
base = {
|
|
|
|
zfs.enable = true;
|
|
|
|
users = {
|
2024-02-04 16:18:47 +02:00
|
|
|
enable = true;
|
2024-02-04 22:05:44 +02:00
|
|
|
devTools = true;
|
2023-09-13 12:17:43 +03:00
|
|
|
passwd = {
|
2023-11-27 17:54:44 +02:00
|
|
|
root.hashedPasswordFile = config.age.secrets.root-passwd-hash.path;
|
|
|
|
motiejus.hashedPasswordFile = config.age.secrets.motiejus-passwd-hash.path;
|
2023-09-13 12:17:43 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
snapshot = {
|
|
|
|
enable = true;
|
|
|
|
mountpoints = ["/home" "/var/lib" "/var/log"];
|
|
|
|
};
|
|
|
|
|
|
|
|
unitstatus = {
|
|
|
|
enable = true;
|
|
|
|
email = "motiejus+alerts@jakstys.lt";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
2023-09-14 14:37:55 +03:00
|
|
|
sshguard.enable = false;
|
2023-11-15 00:29:22 +02:00
|
|
|
tailscale = {
|
|
|
|
enable = true;
|
|
|
|
verboseLogs = true;
|
|
|
|
};
|
2023-09-20 21:28:15 +03:00
|
|
|
|
2023-09-18 19:29:27 +03:00
|
|
|
node_exporter = {
|
|
|
|
enable = true;
|
|
|
|
extraSubnets = [myData.subnets.vno1.cidr];
|
|
|
|
};
|
2023-09-13 12:17:43 +03:00
|
|
|
|
|
|
|
deployerbot = {
|
|
|
|
follower = {
|
2023-10-01 23:26:01 +03:00
|
|
|
inherit (myData.hosts."vno1-oh2.servers.jakst") publicKey;
|
2023-10-01 23:14:05 +03:00
|
|
|
|
2023-09-13 12:17:43 +03:00
|
|
|
enable = true;
|
|
|
|
uidgid = myData.uidgid.updaterbot-deployee;
|
2023-09-20 14:43:04 +03:00
|
|
|
sshAllowSubnets = with myData.subnets; [tailscale.sshPattern];
|
2023-09-13 12:17:43 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-09-15 13:23:52 +03:00
|
|
|
postfix = {
|
|
|
|
enable = true;
|
|
|
|
saslPasswdPath = config.age.secrets.sasl-passwd.path;
|
|
|
|
};
|
2023-09-13 12:17:43 +03:00
|
|
|
|
|
|
|
syncthing = {
|
2023-09-18 11:55:09 +03:00
|
|
|
enable = true;
|
2023-09-13 12:17:43 +03:00
|
|
|
dataDir = "/home/motiejus/";
|
|
|
|
user = "motiejus";
|
|
|
|
group = "users";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-09-20 14:35:11 +03:00
|
|
|
services.autorandr = {
|
|
|
|
enable = true;
|
|
|
|
profiles = {
|
|
|
|
default = {
|
2023-09-17 22:12:46 +03:00
|
|
|
fingerprint = {inherit (randr) eDP-1;};
|
|
|
|
config = {
|
2023-09-20 07:57:12 +03:00
|
|
|
DP-1.enable = false;
|
|
|
|
DP-2.enable = false;
|
|
|
|
DP-3.enable = false;
|
|
|
|
DP-4.enable = false;
|
2023-09-17 22:12:46 +03:00
|
|
|
eDP-1 = {
|
|
|
|
enable = true;
|
|
|
|
primary = true;
|
2023-09-20 07:57:12 +03:00
|
|
|
mode = "1920x1200";
|
2023-09-17 22:12:46 +03:00
|
|
|
crtc = 0;
|
2023-09-20 07:57:12 +03:00
|
|
|
position = "0x0";
|
|
|
|
rate = "59.88";
|
2023-09-17 22:02:30 +03:00
|
|
|
};
|
|
|
|
};
|
2023-09-17 22:12:46 +03:00
|
|
|
};
|
2023-09-17 22:02:30 +03:00
|
|
|
|
2023-09-17 07:06:19 +03:00
|
|
|
dualhome = {
|
2023-09-17 22:02:30 +03:00
|
|
|
fingerprint = {inherit (randr) eDP-1 DP-3 DP-4;};
|
2023-09-17 07:06:19 +03:00
|
|
|
config = {
|
|
|
|
eDP-1.enable = false;
|
2023-09-20 07:57:12 +03:00
|
|
|
DP-1.enable = false;
|
|
|
|
DP-2.enable = false;
|
|
|
|
DP-3 = {
|
|
|
|
enable = true;
|
|
|
|
mode = "2560x1440";
|
|
|
|
position = "0x0";
|
|
|
|
crtc = 1;
|
|
|
|
rate = "59.95";
|
|
|
|
};
|
2023-09-17 07:06:19 +03:00
|
|
|
DP-4 = {
|
|
|
|
enable = true;
|
|
|
|
mode = "2560x1440";
|
2023-09-17 07:39:00 +03:00
|
|
|
position = "2560x0";
|
2023-09-17 07:06:19 +03:00
|
|
|
primary = true;
|
2023-09-17 22:02:30 +03:00
|
|
|
crtc = 0;
|
2023-09-20 07:57:12 +03:00
|
|
|
rate = "59.95";
|
2023-09-17 07:06:19 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-16 18:09:59 +02:00
|
|
|
virtualisation.virtualbox.host.enable = true;
|
|
|
|
users.extraGroups.vboxusers.members = ["motiejus"];
|
|
|
|
|
2024-02-27 15:49:40 +02:00
|
|
|
nix = {
|
|
|
|
buildMachines = [
|
|
|
|
{
|
|
|
|
hostName = myData.hosts."fra1-a.servers.jakst".jakstIP;
|
|
|
|
system = "aarch64-linux";
|
|
|
|
protocol = "ssh-ng";
|
|
|
|
sshUser = "remote-builder";
|
|
|
|
sshKey = "/etc/ssh/ssh_host_ed25519_key";
|
|
|
|
supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm" "gccarch-armv8-a"];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
distributedBuilds = true;
|
|
|
|
extraOptions = ''builders-use-substitutes = true'';
|
|
|
|
};
|
2024-02-27 15:40:16 +02:00
|
|
|
|
2023-09-13 12:17:43 +03:00
|
|
|
networking = {
|
2023-09-13 14:46:58 +03:00
|
|
|
hostId = "3a54afcd";
|
2023-09-13 12:17:43 +03:00
|
|
|
hostName = "fwminex";
|
|
|
|
domain = "motiejus.jakst";
|
2023-09-22 09:58:09 +03:00
|
|
|
firewall.rejectPackets = true;
|
2023-09-13 12:17:43 +03:00
|
|
|
};
|
2024-01-24 10:53:49 +02:00
|
|
|
|
|
|
|
services.tlp = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
CPU_BOOST_ON_BAT = 0;
|
|
|
|
CPU_HWP_DYN_BOOST_ON_BAT = 0;
|
|
|
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
|
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
|
|
|
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
|
|
|
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
|
|
|
PLATFORM_PROFILE_ON_BAT = "low-power";
|
|
|
|
START_CHARGE_THRESH_BAT1 = 90;
|
|
|
|
STOP_CHARGE_THRESH_BAT1 = 97;
|
|
|
|
RUNTIME_PM_ON_BAT = "auto";
|
|
|
|
};
|
|
|
|
};
|
2023-09-13 12:17:43 +03:00
|
|
|
}
|