2022-05-09 17:12:37 +02:00
|
|
|
# tverskoy is my Thinkpad X13 AMD 1st gen
|
2021-04-10 18:05:16 +02:00
|
|
|
{ depot, lib, pkgs, ... }:
|
2021-03-21 00:48:27 +01:00
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
config:
|
|
|
|
let
|
2021-04-10 18:05:16 +02:00
|
|
|
quasselClient = pkgs.quassel.override {
|
2021-03-21 00:48:27 +01:00
|
|
|
client = true;
|
|
|
|
enableDaemon = false;
|
|
|
|
monolithic = false;
|
|
|
|
};
|
2021-03-23 21:08:01 +01:00
|
|
|
|
2022-05-26 14:50:41 +02:00
|
|
|
mod = name: depot.path.origSrc + ("/ops/modules/" + name);
|
|
|
|
usermod = name: depot.path.origSrc + ("/users/tazjin/nixos/modules/" + name);
|
2022-01-30 17:06:58 +01:00
|
|
|
in
|
|
|
|
lib.fix (self: {
|
2021-03-21 01:36:56 +01:00
|
|
|
imports = [
|
2022-04-03 20:47:20 +02:00
|
|
|
(mod "open_eid.nix")
|
2022-05-09 17:04:52 +02:00
|
|
|
(usermod "desktop.nix")
|
2022-05-09 15:26:39 +02:00
|
|
|
(usermod "fonts.nix")
|
2022-05-09 16:50:59 +02:00
|
|
|
(usermod "home-config.nix")
|
2022-05-09 17:04:52 +02:00
|
|
|
(usermod "laptop.nix")
|
2022-05-09 15:40:15 +02:00
|
|
|
(usermod "persistence.nix")
|
|
|
|
(usermod "physical.nix")
|
|
|
|
(usermod "zerotier.nix")
|
2022-05-09 17:04:52 +02:00
|
|
|
|
2022-05-09 16:50:59 +02:00
|
|
|
(pkgs.home-manager.src + "/nixos")
|
2022-03-31 15:19:22 +02:00
|
|
|
] ++ lib.optional (builtins.pathExists ./local-config.nix) ./local-config.nix;
|
2021-03-21 01:36:56 +01:00
|
|
|
|
2021-12-15 23:44:37 +01:00
|
|
|
tvl.cache.enable = true;
|
2021-03-23 00:14:10 +01:00
|
|
|
|
2021-12-06 11:58:13 +01:00
|
|
|
boot = rec {
|
2021-03-21 00:48:27 +01:00
|
|
|
initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
|
|
|
initrd.kernelModules = [ ];
|
2021-03-21 03:21:16 +01:00
|
|
|
|
|
|
|
# Restore /home to the blank snapshot, erasing all ephemeral data.
|
|
|
|
initrd.postDeviceCommands = lib.mkAfter ''
|
|
|
|
zfs rollback -r zpool/ephemeral/home@tazjin-clean
|
|
|
|
'';
|
|
|
|
|
2021-12-06 11:58:13 +01:00
|
|
|
# Install thinkpad modules for TLP
|
|
|
|
extraModulePackages = [ kernelPackages.acpi_call ];
|
|
|
|
|
2021-04-17 15:53:36 +02:00
|
|
|
kernelModules = [ "kvm-amd" "i2c_dev" ];
|
2022-05-27 16:36:40 +02:00
|
|
|
kernelPackages = pkgs.zfsUnstable.latestCompatibleLinuxPackages;
|
2021-03-21 00:48:27 +01:00
|
|
|
loader.systemd-boot.enable = true;
|
|
|
|
loader.efi.canTouchEfiVariables = true;
|
2021-06-02 22:32:41 +02:00
|
|
|
zfs.enableUnstable = true;
|
2021-03-21 00:48:27 +01:00
|
|
|
};
|
|
|
|
|
2023-01-24 20:53:15 +01:00
|
|
|
virtualisation.virtualbox.host.enable = true;
|
|
|
|
users.users.tazjin.extraGroups = [ "vboxusers" ];
|
2022-06-14 15:06:28 +02:00
|
|
|
|
2021-03-21 00:48:27 +01:00
|
|
|
fileSystems = {
|
2022-01-30 17:06:58 +01:00
|
|
|
"/" = {
|
2022-06-13 15:21:36 +02:00
|
|
|
device = "zpool/ephemeral/root";
|
|
|
|
fsType = "zfs";
|
2021-03-21 00:48:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
"/home" = {
|
|
|
|
device = "zpool/ephemeral/home";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/nix" = {
|
|
|
|
device = "zpool/local/nix";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/depot" = {
|
|
|
|
device = "zpool/safe/depot";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/persist" = {
|
|
|
|
device = "zpool/safe/persist";
|
|
|
|
fsType = "zfs";
|
2021-03-21 01:36:56 +01:00
|
|
|
neededForBoot = true;
|
2021-03-21 00:48:27 +01:00
|
|
|
};
|
|
|
|
|
2021-04-04 15:05:56 +02:00
|
|
|
# SD card
|
|
|
|
"/mnt" = {
|
|
|
|
device = "/dev/disk/by-uuid/c602d703-f1b9-4a44-9e45-94dfe24bdaa8";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
|
2021-03-21 00:48:27 +01:00
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-uuid/BF4F-388B";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware = {
|
|
|
|
cpu.amd.updateMicrocode = true;
|
|
|
|
enableRedistributableFirmware = true;
|
|
|
|
bluetooth.enable = true;
|
2021-10-10 00:51:37 +02:00
|
|
|
|
|
|
|
opengl = {
|
|
|
|
enable = true;
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
vaapiVdpau
|
|
|
|
libvdpau-va-gl
|
|
|
|
];
|
|
|
|
};
|
2021-03-21 00:48:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "tverskoy";
|
|
|
|
hostId = "3c91827f";
|
2021-04-09 22:45:00 +02:00
|
|
|
domain = "tvl.su";
|
2021-03-21 00:48:27 +01:00
|
|
|
useDHCP = false;
|
|
|
|
networkmanager.enable = true;
|
2021-03-30 00:15:44 +02:00
|
|
|
firewall.enable = false;
|
2021-03-21 00:48:27 +01:00
|
|
|
|
|
|
|
nameservers = [
|
|
|
|
"8.8.8.8"
|
|
|
|
"8.8.4.4"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
security.rtkit.enable = true;
|
2021-03-21 04:27:11 +01:00
|
|
|
|
2021-03-21 00:48:27 +01:00
|
|
|
services = {
|
2021-10-08 12:04:16 +02:00
|
|
|
printing.enable = true;
|
2021-03-21 00:48:27 +01:00
|
|
|
|
2021-04-17 15:53:36 +02:00
|
|
|
# expose i2c device as /dev/i2c-amdgpu-dm and make it user-accessible
|
2021-11-27 18:56:05 +01:00
|
|
|
# this is required for sending control commands to the Dasung screen.
|
2021-04-17 15:53:36 +02:00
|
|
|
udev.extraRules = ''
|
|
|
|
SUBSYSTEM=="i2c-dev", ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:08.1/0000:06:00.0/i2c-5/i2c-dev/i2c-5", SYMLINK+="i2c-amdgpu-dm", TAG+="uaccess"
|
|
|
|
'';
|
|
|
|
|
2022-05-09 17:04:52 +02:00
|
|
|
xserver.videoDrivers = [ "amdgpu" ];
|
2021-09-10 13:34:10 +02:00
|
|
|
|
|
|
|
# Automatically collect garbage from the Nix store.
|
|
|
|
depot.automatic-gc = {
|
|
|
|
enable = true;
|
|
|
|
interval = "1 hour";
|
2021-11-11 22:25:19 +01:00
|
|
|
diskThreshold = 16; # GiB
|
|
|
|
maxFreed = 10; # GiB
|
2021-09-10 13:34:10 +02:00
|
|
|
preserveGenerations = "14d";
|
|
|
|
};
|
2021-03-21 00:48:27 +01:00
|
|
|
};
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
systemd.user.services.lieer-tazjin = {
|
|
|
|
description = "Synchronise mail@tazj.in via lieer";
|
|
|
|
script = "${pkgs.lieer}/bin/gmi sync";
|
2021-05-22 21:51:59 +02:00
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
serviceConfig = {
|
|
|
|
WorkingDirectory = "%h/mail/account.tazjin";
|
|
|
|
Type = "oneshot";
|
2021-05-22 21:51:59 +02:00
|
|
|
};
|
2022-01-30 17:06:58 +01:00
|
|
|
};
|
2021-05-22 21:51:59 +02:00
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
systemd.user.timers.lieer-tazjin = {
|
|
|
|
wantedBy = [ "timers.target" ];
|
2021-05-22 21:51:59 +02:00
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
timerConfig = {
|
|
|
|
OnActiveSec = "1";
|
|
|
|
OnUnitActiveSec = "180";
|
2021-05-22 21:51:59 +02:00
|
|
|
};
|
2022-01-30 17:06:58 +01:00
|
|
|
};
|
2021-05-22 21:51:59 +02:00
|
|
|
|
2023-01-17 21:34:27 +01:00
|
|
|
# systemd-oomd seems to have been enabled by default around ~
|
|
|
|
# December 2022, and it's really into killing my X session as soon
|
|
|
|
# as I do anything stressful to the machine
|
|
|
|
systemd.services.systemd-oomd.enable = lib.mkForce false;
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
system.stateVersion = "20.09";
|
2021-03-21 00:48:27 +01:00
|
|
|
})
|