diff --git a/hosts/desktopnix/default.nix b/hosts/desktopnix/default.nix index d4f4ad7..14ede1c 100644 --- a/hosts/desktopnix/default.nix +++ b/hosts/desktopnix/default.nix @@ -34,8 +34,4 @@ applications = 10; desktop = 10; }; - services.xserver = { - layout = "de"; - xkbVariant = "bone"; - }; } diff --git a/hosts/desktopnix/fs.nix b/hosts/desktopnix/fs.nix index 053c694..e485350 100644 --- a/hosts/desktopnix/fs.nix +++ b/hosts/desktopnix/fs.nix @@ -32,8 +32,18 @@ }; zpool = with lib.disko.zfs; { rpool = defaultZpoolOptions // {datasets = defaultZfsDatasets;}; - panzer = defaultZpoolOptions // {datasets = {};}; + panzer = + defaultZpoolOptions + // { + datasets = { + "local" = unmountable; + "local/state" = filesystem "/panzer/state"; + }; + }; }; }; + fileSystems."/state".neededForBoot = true; + fileSystems."/panzer/state".neededForBoot = true; boot.initrd.luks.devices.enc-rpool.allowDiscards = true; + boot.initrd.luks.devices.enc-panzer.allowDiscards = true; } diff --git a/modules/impermanence/default.nix b/modules/impermanence/default.nix index 89274db..72bab29 100644 --- a/modules/impermanence/default.nix +++ b/modules/impermanence/default.nix @@ -7,7 +7,6 @@ imports = [./users.nix]; # to allow all users to access hm managed persistent folders programs.fuse.userAllowOther = true; - fileSystems."/state".neededForBoot = true; environment.persistence."/state" = { hideMounts = true; diff --git a/modules/optional/streamdeck.nix b/modules/optional/streamdeck.nix index c8a4070..2b49dc3 100644 --- a/modules/optional/streamdeck.nix +++ b/modules/optional/streamdeck.nix @@ -25,8 +25,22 @@ in { }; }; config = mkIf config.programs.streamdeck-ui.enable { - home.packages = [pkgs.streamdeck-ui]; - home.sessionVariables.STREAMDECK_UI_CONFIG = "${config.xdg.configHome}/streamdeck-ui/config.json"; + systemd.user = { + services = { + streamdeck = { + Unit = { + Description = "start streamdeck-ui"; + }; + Service = { + Type = "exec"; + ExecStart = "${pkgs.streamdeck-ui}/bin/streamdeck-ui --no-ui"; + Environment = "STREAMDECK_UI_CONFIG=${config.xdg.configHome}/streamdeck-ui/config.json"; + }; + Install.WantedBy = ["graphical-session.target"]; + }; + }; + }; + xdg.configFile.streamdeck-ui = { target = "streamdeck-ui/config.json"; source = settingsFormat.generate "config.json" { diff --git a/modules/optional/xserver.nix b/modules/optional/xserver.nix index 8f1cb6b..2953ca0 100644 --- a/modules/optional/xserver.nix +++ b/modules/optional/xserver.nix @@ -27,22 +27,20 @@ lib.optionalAttrs (!minimal) { }; }; }; - services.autorandr.enable = true; services.udev.extraRules = let 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}" - user=$(${pkgs.coreutils}/bin/stat -c '%U' "$D") - # 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 + 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") + # 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})& + done + fi ''; in '' ACTION=="add", SUBSYSTEM=="input", ATTRS{bInterfaceClass}=="03", RUN+="${exe}" diff --git a/users/common/graphical/Xorg/autorandr.nix b/users/common/graphical/Xorg/autorandr.nix index f60e7d9..4cf45df 100644 --- a/users/common/graphical/Xorg/autorandr.nix +++ b/users/common/graphical/Xorg/autorandr.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { programs.autorandr = let dpi_hd = 96; dpi_uhd = 216; diff --git a/users/common/graphical/Xorg/default.nix b/users/common/graphical/Xorg/default.nix index 8ae7547..6cdb6a8 100644 --- a/users/common/graphical/Xorg/default.nix +++ b/users/common/graphical/Xorg/default.nix @@ -6,7 +6,6 @@ imports = [ ../. ./rofi.nix - ./autorandr.nix ./i3.nix ./wallpapers.nix ]; diff --git a/users/common/graphical/Xorg/i3.nix b/users/common/graphical/Xorg/i3.nix index 0d3d65a..2c9cec3 100644 --- a/users/common/graphical/Xorg/i3.nix +++ b/users/common/graphical/Xorg/i3.nix @@ -9,6 +9,10 @@ xsession.windowManager.i3 = { enable = true; config = { + startup = [ + {command = "xrandr --output DVI-D-0 --mode 1920x1080 --pos 0x0 --rate 60.00 --output DP-4 --mode 2560x1440 --pos 1920x720 --primary --rate 144 --output HDMI-0 --pos 0x1080 --rate 60.00";} + {command = "systemctl --user start set-wallpaper.timer streamdeck.service";} + ]; menu = "rofi -show drun"; keybindings = let cfg = config.xsession.windowManager.i3.config; diff --git a/users/common/graphical/Xorg/wallpapers.nix b/users/common/graphical/Xorg/wallpapers.nix index a27d901..40d6e79 100644 --- a/users/common/graphical/Xorg/wallpapers.nix +++ b/users/common/graphical/Xorg/wallpapers.nix @@ -17,7 +17,7 @@ in { Description = "Set a random wallpaper every 3 minutes"; }; Timer = { - OnActiveSec = "5 sec"; + OnActiveSec = "10 sec"; OnUnitActiveSec = "3 min"; }; Install.WantedBy = [ diff --git a/users/common/graphical/Xorg/xinitrc b/users/common/graphical/Xorg/xinitrc index c7f834d..1954e73 100644 --- a/users/common/graphical/Xorg/xinitrc +++ b/users/common/graphical/Xorg/xinitrc @@ -15,9 +15,7 @@ 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/patrick/impermanence.nix b/users/patrick/impermanence.nix index 6386681..190d58f 100644 --- a/users/patrick/impermanence.nix +++ b/users/patrick/impermanence.nix @@ -1,30 +1,42 @@ { - home.persistence."/state" = { - directories = [ - "repos" - "Downloads" + nixosConfig, + lib, + ... +}: { + home.persistence = + { + "/state" = { + directories = [ + "repos" + "Downloads" - # For nextcloud client install - "Nextcloud" - ".config/Nextcloud" + # For nextcloud client install + "Nextcloud" + ".config/Nextcloud" - # for electron signal app state - ".config/Signal" - ".config/discord" - ".local/share/TelegramDesktop" + # for electron signal app state + ".config/Signal" + ".config/discord" + ".local/share/TelegramDesktop" - # Folders for steam - ".local/share/Steam" - ".steam" - # Ken follets pillars of earth - ".local/share//Daedalic Entertainment GmbH/" - # Nvidia shader cache - ".cache/nvidia" - # Vulkan shader cache - ".local/share/vulkan" + # Folders for steam + ".local/share/Steam" + ".steam" + # Ken follets pillars of earth + ".local/share//Daedalic Entertainment GmbH/" + # Nvidia shader cache + ".cache/nvidia" + # Vulkan shader cache + ".local/share/vulkan" - # bottles state games - ".local/share/bottles" - ]; - }; + # bottles state games + ".local/share/bottles" + ]; + }; + } + // lib.mkIf (nixosConfig.disko.devices.zpool ? "panzer") { + "/panzer/state".directories = [ + ".local/share/SteamPanzer" + ]; + }; }