From ef7388d000aea583c5aff4228c075aa5583c0b3a Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 10 Oct 2023 18:37:55 +0200 Subject: [PATCH] WIP: computer bricked --- README.md | 2 +- hosts/desktopnix/default.nix | 1 - modules/config/boot.nix | 2 +- modules/config/system.nix | 2 +- modules/optional/xserver.nix | 18 ++++++++++-------- users/common/graphical/Xorg/wallpapers.nix | 7 +++++-- users/common/graphical/Xorg/xinitrc | 5 +++++ users/common/impermanence.nix | 5 ----- users/common/programs/nvim/default.nix | 5 +++++ users/patrick/streamdeck.nix | 14 -------------- 10 files changed, 28 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 7873b41..6a79b93 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ 1. Time to reboot and pray ### Add luks encryption TPM keys -`systemd-cryptenroll --tpm2-pcrs=7+8+9 --tpm2-with-pin={yes/no} --tpm2-device=auto ` +`systemd-cryptenroll --tpm2-with-pin={yes/no} --tpm2-device=auto ` ## Deploy diff --git a/hosts/desktopnix/default.nix b/hosts/desktopnix/default.nix index d960a6b..d4f4ad7 100644 --- a/hosts/desktopnix/default.nix +++ b/hosts/desktopnix/default.nix @@ -12,7 +12,6 @@ ../../modules/optional/xserver.nix ../../modules/optional/secureboot.nix - ../../modules/hardware/bluetooth.nix ../../modules/hardware/intel.nix ../../modules/hardware/nintendo.nix ../../modules/hardware/nvidia.nix diff --git a/modules/config/boot.nix b/modules/config/boot.nix index d65d871..51cadfe 100644 --- a/modules/config/boot.nix +++ b/modules/config/boot.nix @@ -11,7 +11,7 @@ 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"]; kernelModules = ["kvm-intel"]; kernelParams = [ diff --git a/modules/config/system.nix b/modules/config/system.nix index 6dbed65..6b59ad0 100644 --- a/modules/config/system.nix +++ b/modules/config/system.nix @@ -39,7 +39,7 @@ time.timeZone = lib.mkDefault "Europe/Berlin"; i18n.defaultLocale = "C.UTF-8"; console = { - font = "ter-v28n"; + font = "${pkgs.terminus_font}/share/consolefonts/ter-v28n.psf.gz"; packages = with pkgs; [terminus_font]; useXkbConfig = true; # use xkbOptions in tty. keyMap = lib.mkDefault "de-latin1-nodeadkeys"; diff --git a/modules/optional/xserver.nix b/modules/optional/xserver.nix index e559fe7..8f1cb6b 100644 --- a/modules/optional/xserver.nix +++ b/modules/optional/xserver.nix @@ -32,15 +32,17 @@ lib.optionalAttrs (!minimal) { exe = pkgs.writeShellScript "set-key-repeat" '' - if [ -d "/tmp/.X11-unix" ]; then - for D in /tmp/.X11-unix/*; do - file=$(${pkgs.coreutils}/bin/basename $D) - export DISPLAY=":''${file:1}" + if [ -d "/tmp/.X11-unix" ]; then + for D in /tmp/.X11-unix/*; do + file=$(${pkgs.coreutils}/bin/basename $D) + export DISPLAY=":''${file:1}" user=$(${pkgs.coreutils}/bin/stat -c '%U' "$D") - ${pkgs.util-linux}/bin/runuser -u "$user" -- ${pkgs.xorg.xset}/bin/xset r rate \ - ${toString config.services.xserver.autoRepeatDelay} ${toString config.services.xserver.autoRepeatInterval} - done - fi + # sleep to give X time to access the keyboard + (sleep 0.2; ${pkgs.util-linux}/bin/runuser -u "$user" -- ${pkgs.xorg.xset}/bin/xset r rate \ + ${toString config.services.xserver.autoRepeatDelay} ${toString config.services.xserver.autoRepeatInterval})& + echo "lol" > /tmp/lel + done + fi ''; in '' ACTION=="add", SUBSYSTEM=="input", ATTRS{bInterfaceClass}=="03", RUN+="${exe}" diff --git a/users/common/graphical/Xorg/wallpapers.nix b/users/common/graphical/Xorg/wallpapers.nix index 05aaf3a..a27d901 100644 --- a/users/common/graphical/Xorg/wallpapers.nix +++ b/users/common/graphical/Xorg/wallpapers.nix @@ -17,9 +17,13 @@ in { Description = "Set a random wallpaper every 3 minutes"; }; Timer = { + OnActiveSec = "5 sec"; OnUnitActiveSec = "3 min"; }; - Install.WantedBy = ["timers.target"]; + Install.WantedBy = [ + "timers.target" + "graphical-session.target" + ]; }; }; services = { @@ -32,7 +36,6 @@ in { ExecStart = exe; }; - Install.WantedBy = ["graphical-session.target"]; }; }; }; diff --git a/users/common/graphical/Xorg/xinitrc b/users/common/graphical/Xorg/xinitrc index 889f51c..c7f834d 100644 --- a/users/common/graphical/Xorg/xinitrc +++ b/users/common/graphical/Xorg/xinitrc @@ -15,4 +15,9 @@ if command -v dbus-update-activation-environment >/dev/null 2>&1; then dbus-update-activation-environment DISPLAY XAUTHORITY 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 diff --git a/users/common/impermanence.nix b/users/common/impermanence.nix index 207b1d5..7fd1ef2 100644 --- a/users/common/impermanence.nix +++ b/users/common/impermanence.nix @@ -21,11 +21,6 @@ ++ optionals config.programs.nushell.enable [ ".config/nushell" ] - ++ optionals config.programs.neovim.enable [ - ".local/share/nvim" - ".local/state/nvim" - ".cache/nvim" - ] ++ optionals nixosConfig.services.pipewire.enable [ # persist sound config ".local/state/wireplumber" diff --git a/users/common/programs/nvim/default.nix b/users/common/programs/nvim/default.nix index 5ffdf59..102e333 100644 --- a/users/common/programs/nvim/default.nix +++ b/users/common/programs/nvim/default.nix @@ -24,4 +24,9 @@ recursive = true; source = ./.; }; + home.persistence."/state".directories = [ + ".local/share/nvim" + ".local/state/nvim" + ".cache/nvim" + ]; } diff --git a/users/patrick/streamdeck.nix b/users/patrick/streamdeck.nix index af7c6ab..56a6d2a 100644 --- a/users/patrick/streamdeck.nix +++ b/users/patrick/streamdeck.nix @@ -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"]; - }; - }; - }; }