From fff7506433cf5d830a74c1821a9c2463364c1adb Mon Sep 17 00:00:00 2001 From: Kabbone Date: Wed, 27 Dec 2023 07:49:24 +0100 Subject: [PATCH] hosts: steamdeck: make sdcard automount with udev --- hosts/steamdeck/hardware-configuration.nix | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/hosts/steamdeck/hardware-configuration.nix b/hosts/steamdeck/hardware-configuration.nix index 8406677..cbfd2a3 100644 --- a/hosts/steamdeck/hardware-configuration.nix +++ b/hosts/steamdeck/hardware-configuration.nix @@ -38,12 +38,17 @@ zramSwap.enable = true; - services.btrfs.autoScrub = { - enable = true; - interval = "monthly"; - fileSystems = [ - "/" - ]; + services = { + btrfs.autoScrub = { + enable = true; + interval = "monthly"; + fileSystems = [ + "/" + ]; + }; + udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="block", KERNEL=="mmcblk[0-9]p[0-9]", ENV{ID_FS_USAGE}=="filesystem", RUN{program}+="${pkgs.systemd}/bin/systemd-mount -o noatime,compress-force=zstd:15,ssd_spread,commit=120 --no-block --automount=yes --collect $devnode /run/media/mmcblk0p1" + ''; }; services.btrbk = { @@ -119,11 +124,11 @@ options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ]; }; - fileSystems."/sdcard" = - { device = "/dev/disk/by-label/sdcard"; - fsType = "ext4"; - options = [ "nofail,noauto,users,x-systemd.automount" ]; - }; +# fileSystems."/sdcard" = +# { device = "/dev/disk/by-label/sdcard"; +# fsType = "ext4"; +# options = [ "nofail,noauto,users,x-systemd.automount" ]; +# }; fileSystems."/mnt/Pluto" = { device = "jupiter:/Pluto";