config/hosts/mtworx/configuration.nix

152 lines
3.4 KiB
Nix
Raw Normal View History

2024-03-12 21:26:31 +02:00
{
pkgs,
2024-03-18 17:46:17 +02:00
config,
2024-03-12 21:26:31 +02:00
myData,
...
}: let
2024-03-12 13:44:40 +02:00
nvme = "/dev/disk/by-id/nvme-WD_PC_SN810_SDCQNRY-1T00-1201_23234W800017";
2024-03-12 21:26:31 +02:00
in {
imports = [
2024-03-13 10:01:09 +02:00
../../shared/work
2024-03-12 21:26:31 +02:00
../../modules
../../modules/profiles/desktop
2024-04-12 16:37:06 +03:00
../../modules/profiles/autorandr
2024-03-12 21:26:31 +02:00
];
boot = {
kernelPackages = pkgs.linuxPackages_latest;
2024-03-12 21:26:31 +02:00
kernelModules = ["kvm-intel"];
2024-03-27 09:53:23 +02:00
#kernelParams = ["intel_pstate=disable"];
2024-03-12 21:26:31 +02:00
loader.systemd-boot.enable = true;
initrd = {
availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usbhid"];
luks.devices = {
luksroot = {
device = "${nvme}-part3";
allowDiscards = true;
};
};
};
};
swapDevices = [
{
device = "${nvme}-part2";
randomEncryption.enable = true;
}
];
fileSystems = {
"/" = {
device = "/dev/mapper/luksroot";
2024-03-13 15:28:35 +02:00
fsType = "btrfs";
2024-03-13 16:23:01 +02:00
options = ["compress=zstd"];
2024-03-12 21:26:31 +02:00
};
"/boot" = {
device = "${nvme}-part1";
2024-03-12 21:36:08 +02:00
fsType = "vfat";
2024-03-12 21:26:31 +02:00
};
};
hardware.cpu.intel.updateMicrocode = true;
nixpkgs.hostPlatform = "x86_64-linux";
boot.binfmt.emulatedSystems = ["aarch64-linux"];
2024-05-01 20:59:42 +03:00
systemd = {
timers = {
btrfs-snap-home-5m = {
enable = true;
wantedBy = ["timers.target"];
timerConfig.OnCalendar = "*:0/5";
};
btrfs-snap-home-1h = {
enable = true;
wantedBy = ["timers.target"];
timerConfig.OnCalendar = "*:0";
};
};
services = {
zfs-mount.enable = false;
btrfs-snap-home-5m = {
enable = true;
serviceConfig.Type = "oneshot";
script = "${pkgs.btrfs-snap}/bin/btrfs-snap -r /home 5m 12";
};
btrfs-snap-home-1h = {
enable = true;
serviceConfig.Type = "oneshot";
script = "${pkgs.btrfs-snap}/bin/btrfs-snap -r /home 1h 24";
};
};
};
2024-03-12 21:26:31 +02:00
mj = {
stateVersion = "23.11";
timeZone = "Europe/Vilnius";
username = "motiejus";
base.users = {
enable = true;
2024-03-12 16:03:50 +02:00
devTools = true;
2024-03-18 17:46:17 +02:00
root.hashedPasswordFile = config.age.secrets.root-work-passwd-hash.path;
user.hashedPasswordFile = config.age.secrets.motiejus-work-passwd-hash.path;
2024-03-12 21:26:31 +02:00
};
services = {
sshguard.enable = false;
tailscale = {
enable = true;
verboseLogs = true;
};
node_exporter = {
enable = true;
extraSubnets = [myData.subnets.vno1.cidr];
};
deployerbot = {
follower = {
inherit (myData.hosts."vno1-oh2.servers.jakst") publicKey;
enable = true;
uidgid = myData.uidgid.updaterbot-deployee;
sshAllowSubnets = with myData.subnets; [tailscale.sshPattern];
};
};
#postfix = {
# enable = true;
# saslPasswdPath = config.age.secrets.sasl-passwd.path;
#};
syncthing = {
enable = true;
dataDir = "/home/motiejus/";
user = "motiejus";
group = "users";
};
#remote-builder.client = let
# host = myData.hosts."fra1-a.servers.jakst";
#in {
# enable = true;
# inherit (host) system supportedFeatures;
# hostName = host.jakstIP;
# sshKey = "/etc/ssh/ssh_host_ed25519_key";
#};
};
};
users.extraGroups.vboxusers.members = ["motiejus"];
networking = {
hostId = "b14a02aa";
hostName = "mtworx";
domain = "motiejus.jakst";
firewall.rejectPackets = true;
};
}