From b7eb0d5179a1b822369cbaa1c2f6b96bad46dae7 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Mon, 18 Mar 2024 14:46:37 +0100 Subject: [PATCH] Small tweaks, disable my earlier tinkering to not have it interfere --- nixos/hosts/shodan/auto-mount.nix | 2 ++ nixos/hosts/shodan/configuration.nix | 2 ++ pkgs/auto-mount/default.nix | 2 ++ 3 files changed, 6 insertions(+) diff --git a/nixos/hosts/shodan/auto-mount.nix b/nixos/hosts/shodan/auto-mount.nix index ac346cf..a52c160 100644 --- a/nixos/hosts/shodan/auto-mount.nix +++ b/nixos/hosts/shodan/auto-mount.nix @@ -6,6 +6,8 @@ pkgs, ... }: { + environment.systemPackages = with pkgs; [auto-mount]; + services.udev.extraRules = '' KERNEL=="sd[a-z]|sd[a-z][0-9]", ACTION=="add", RUN+="/bin/systemctl start --no-block external-drive-mount@%k.service" KERNEL=="sd[a-z]|sd[a-z][0-9]", ACTION=="remove", RUN+="/bin/systemctl stop --no-block external-drive-mount@%k.service" diff --git a/nixos/hosts/shodan/configuration.nix b/nixos/hosts/shodan/configuration.nix index 55ea51e..f750210 100644 --- a/nixos/hosts/shodan/configuration.nix +++ b/nixos/hosts/shodan/configuration.nix @@ -21,6 +21,8 @@ # You can also split up your configuration and import pieces of it here: # ./nvim.nix ./hardware-configuration.nix + + ./auto-mount.nix ]; boot.tmp.cleanOnBoot = true; diff --git a/pkgs/auto-mount/default.nix b/pkgs/auto-mount/default.nix index e80df01..176ee24 100644 --- a/pkgs/auto-mount/default.nix +++ b/pkgs/auto-mount/default.nix @@ -6,6 +6,8 @@ }: writeShellApplication { + # Originally from: https://github.com/scawp/Steam-Deck.Mount-External-Drive/ + name = "auto-mount"; runtimeInputs = [];