snix/users/tazjin/nixos/tverskoy/default.nix
Vincent Ambo b9e0a682ab fix(users/tazjin): disable systemd user slice freezing
I have a suspicion that some systemd bugs around this feature (I actually
couldn't figure out what it does and why?) introduced in systemd 256 lead to
issues with suspend that I've seen in recent times.

In the issue, my machine is seemingly frozen after resuming from suspend. I'd
seen this previously on EXWM with xsecurelock, but now I'm seeing it on niri
with swaylock, where it is more severe because switching to a VT is impossible.

Upstream tickets:

- https://github.com/systemd/systemd/issues/33083
- https://github.com/systemd/systemd/issues/33626
- https://bugzilla.redhat.com/show_bug.cgi?id=2321268

I'm not running a VM, but there seem to be multiple different bugs leading to
this, so who knows. It's worth a try.

The long-term fix will be getting rid of systemd)

Change-Id: Ie985a3f222f3daac1e3c7db79ee8624c66297374
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12961
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2025-01-07 09:45:08 +00:00

158 lines
3.6 KiB
Nix

# tverskoy is my Thinkpad X13 AMD 1st gen
{ depot, lib, pkgs, ... }:
config:
let
quasselClient = pkgs.quassel.override {
client = true;
enableDaemon = false;
monolithic = false;
};
mod = name: depot.path.origSrc + ("/ops/modules/" + name);
usermod = name: depot.path.origSrc + ("/users/tazjin/nixos/modules/" + name);
in
lib.fix (self: {
imports = [
(mod "open_eid.nix")
(usermod "chromium.nix")
(usermod "desktop.nix")
(usermod "fonts.nix")
(usermod "home-config.nix")
(usermod "laptop.nix")
(usermod "persistence.nix")
(usermod "physical.nix")
(usermod "systemd-unfreeze.nix")
(pkgs.home-manager.src + "/nixos")
] ++ lib.optional (builtins.pathExists ./local-config.nix) ./local-config.nix;
tvl.cache.enable = true;
boot = {
initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
initrd.kernelModules = [ ];
# Restore /home to the blank snapshot, erasing all ephemeral data.
initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r zpool/ephemeral/home@tazjin-clean
'';
# Install thinkpad modules for TLP
extraModulePackages = [ pkgs.linuxPackages.acpi_call ];
kernelModules = [ "acpi_call" "kvm-amd" "i2c_dev" ];
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
};
users.users.tazjin.extraGroups = [ "docker" "vboxusers" "adbusers" ];
fileSystems = {
"/" = {
device = "zpool/ephemeral/root";
fsType = "zfs";
};
"/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";
neededForBoot = true;
};
# SD card
"/mnt" = {
device = "/dev/disk/by-uuid/c602d703-f1b9-4a44-9e45-94dfe24bdaa8";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/BF4F-388B";
fsType = "vfat";
};
};
hardware = {
cpu.amd.updateMicrocode = true;
enableRedistributableFirmware = true;
bluetooth.enable = true;
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
vaapiVdpau
libvdpau-va-gl
];
};
};
networking = {
hostName = "tverskoy";
hostId = "3c91827f";
domain = "tvl.su";
useDHCP = false;
networkmanager.enable = true;
firewall.enable = false;
nameservers = [
"8.8.8.8"
"8.8.4.4"
];
};
security.rtkit.enable = true;
services = {
tailscale.enable = true;
printing.enable = true;
# expose i2c device as /dev/i2c-amdgpu-dm and make it user-accessible
# this is required for sending control commands to the Dasung screen.
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"
'';
xserver.videoDrivers = [ "amdgpu" ];
};
systemd.user.services.lieer-tazjin = {
description = "Synchronise mail@tazj.in via lieer";
script = "${pkgs.lieer}/bin/gmi sync";
serviceConfig = {
WorkingDirectory = "%h/mail/account.tazjin";
Type = "oneshot";
};
};
systemd.user.timers.lieer-tazjin = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnActiveSec = "1";
OnUnitActiveSec = "180";
};
};
# android stuff for hacking on Awful.apk
programs.adb.enable = true;
system.stateVersion = "20.09";
})