WIP: computer bricked

This commit is contained in:
Patrick 2023-10-10 18:37:55 +02:00
parent 5105004d98
commit ef7388d000
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
10 changed files with 28 additions and 33 deletions

View file

@ -101,7 +101,7 @@
1. Time to reboot and pray 1. Time to reboot and pray
### Add luks encryption TPM keys ### Add luks encryption TPM keys
`systemd-cryptenroll --tpm2-pcrs=7+8+9 --tpm2-with-pin={yes/no} --tpm2-device=auto <device>` `systemd-cryptenroll --tpm2-with-pin={yes/no} --tpm2-device=auto <device>`
## Deploy ## Deploy

View file

@ -12,7 +12,6 @@
../../modules/optional/xserver.nix ../../modules/optional/xserver.nix
../../modules/optional/secureboot.nix ../../modules/optional/secureboot.nix
../../modules/hardware/bluetooth.nix
../../modules/hardware/intel.nix ../../modules/hardware/intel.nix
../../modules/hardware/nintendo.nix ../../modules/hardware/nintendo.nix
../../modules/hardware/nvidia.nix ../../modules/hardware/nvidia.nix

View file

@ -11,7 +11,7 @@
extraBin.ip = "${pkgs.iproute}/bin/ip"; extraBin.ip = "${pkgs.iproute}/bin/ip";
}; };
initrd.availableKernelModules = ["xhci_pci" "nvme" "r8169" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" "ahci" "uas"]; initrd.availableKernelModules = ["xhci_pci" "nvme" "r8169" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" "ahci" "uas" "tpm_crb"];
supportedFilesystems = ["ntfs"]; supportedFilesystems = ["ntfs"];
kernelModules = ["kvm-intel"]; kernelModules = ["kvm-intel"];
kernelParams = [ kernelParams = [

View file

@ -39,7 +39,7 @@
time.timeZone = lib.mkDefault "Europe/Berlin"; time.timeZone = lib.mkDefault "Europe/Berlin";
i18n.defaultLocale = "C.UTF-8"; i18n.defaultLocale = "C.UTF-8";
console = { console = {
font = "ter-v28n"; font = "${pkgs.terminus_font}/share/consolefonts/ter-v28n.psf.gz";
packages = with pkgs; [terminus_font]; packages = with pkgs; [terminus_font];
useXkbConfig = true; # use xkbOptions in tty. useXkbConfig = true; # use xkbOptions in tty.
keyMap = lib.mkDefault "de-latin1-nodeadkeys"; keyMap = lib.mkDefault "de-latin1-nodeadkeys";

View file

@ -32,15 +32,17 @@ lib.optionalAttrs (!minimal) {
exe = exe =
pkgs.writeShellScript "set-key-repeat" pkgs.writeShellScript "set-key-repeat"
'' ''
if [ -d "/tmp/.X11-unix" ]; then if [ -d "/tmp/.X11-unix" ]; then
for D in /tmp/.X11-unix/*; do for D in /tmp/.X11-unix/*; do
file=$(${pkgs.coreutils}/bin/basename $D) file=$(${pkgs.coreutils}/bin/basename $D)
export DISPLAY=":''${file:1}" export DISPLAY=":''${file:1}"
user=$(${pkgs.coreutils}/bin/stat -c '%U' "$D") user=$(${pkgs.coreutils}/bin/stat -c '%U' "$D")
${pkgs.util-linux}/bin/runuser -u "$user" -- ${pkgs.xorg.xset}/bin/xset r rate \ # sleep to give X time to access the keyboard
${toString config.services.xserver.autoRepeatDelay} ${toString config.services.xserver.autoRepeatInterval} (sleep 0.2; ${pkgs.util-linux}/bin/runuser -u "$user" -- ${pkgs.xorg.xset}/bin/xset r rate \
done ${toString config.services.xserver.autoRepeatDelay} ${toString config.services.xserver.autoRepeatInterval})&
fi echo "lol" > /tmp/lel
done
fi
''; '';
in '' in ''
ACTION=="add", SUBSYSTEM=="input", ATTRS{bInterfaceClass}=="03", RUN+="${exe}" ACTION=="add", SUBSYSTEM=="input", ATTRS{bInterfaceClass}=="03", RUN+="${exe}"

View file

@ -17,9 +17,13 @@ in {
Description = "Set a random wallpaper every 3 minutes"; Description = "Set a random wallpaper every 3 minutes";
}; };
Timer = { Timer = {
OnActiveSec = "5 sec";
OnUnitActiveSec = "3 min"; OnUnitActiveSec = "3 min";
}; };
Install.WantedBy = ["timers.target"]; Install.WantedBy = [
"timers.target"
"graphical-session.target"
];
}; };
}; };
services = { services = {
@ -32,7 +36,6 @@ in {
ExecStart = ExecStart =
exe; exe;
}; };
Install.WantedBy = ["graphical-session.target"];
}; };
}; };
}; };

View file

@ -15,4 +15,9 @@ if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY dbus-update-activation-environment DISPLAY XAUTHORITY
fi fi
autorandr -c
# I3 does no start graphical session.target because ????
# so we need to manually start all service we want
systemctl --user start set-wallpaper.timer streamdeck.service
xset r rate 235 60
exec i3 exec i3

View file

@ -21,11 +21,6 @@
++ optionals config.programs.nushell.enable [ ++ optionals config.programs.nushell.enable [
".config/nushell" ".config/nushell"
] ]
++ optionals config.programs.neovim.enable [
".local/share/nvim"
".local/state/nvim"
".cache/nvim"
]
++ optionals nixosConfig.services.pipewire.enable [ ++ optionals nixosConfig.services.pipewire.enable [
# persist sound config # persist sound config
".local/state/wireplumber" ".local/state/wireplumber"

View file

@ -24,4 +24,9 @@
recursive = true; recursive = true;
source = ./.; source = ./.;
}; };
home.persistence."/state".directories = [
".local/share/nvim"
".local/state/nvim"
".cache/nvim"
];
} }

View file

@ -74,18 +74,4 @@
}; };
}; };
}; };
systemd.user = {
services = {
streamdeck-ui = {
Unit = {
Description = "start streamdeck-ui";
};
Service = {
Type = "exec";
ExecStart = "${pkgs.streamdeck-ui}/bin/streamdeck-ui --no-ui";
};
Install.WantedBy = ["graphical-session.target"];
};
};
};
} }