From a2e7501f23052b1dd6933dd0c89278bba41203bb Mon Sep 17 00:00:00 2001 From: serenity-F Date: Tue, 25 Mar 2025 12:50:18 +1000 Subject: [PATCH] tweaked `automount.nix` --- home/scripts/automount/default.nix | 10 +++++----- home/scripts/automount/postActivation.nix | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 home/scripts/automount/postActivation.nix diff --git a/home/scripts/automount/default.nix b/home/scripts/automount/default.nix index 922da5a..99f0ccb 100755 --- a/home/scripts/automount/default.nix +++ b/home/scripts/automount/default.nix @@ -14,11 +14,11 @@ file = { ## Path to automount disks to - "Disks" = { - source = ./Disks; - target = "${disksPath}"; - #recursive = true; - }; + #"Disks" = { + #source = ./Disks; + #target = "${disksPath}"; + #recursive = true; + #}; ## (current) Flake path #"flakes/nixdots" = { diff --git a/home/scripts/automount/postActivation.nix b/home/scripts/automount/postActivation.nix new file mode 100644 index 0000000..cd59fea --- /dev/null +++ b/home/scripts/automount/postActivation.nix @@ -0,0 +1,20 @@ +{ pkgs, flakePath, disksPath, primaryUser, ... }: + +{ + + imports = [ ]; + + ## Activation Scripts + ## - these run after using `sudo nixos-rebuild switch --flake .#` + ## - assumes command is run from the flake directory + system.activationScripts.diff = { + supportsDryActivation = false; + ## Prints diff of the nix store and a cute message if rebuild successful + text = '' + cp home/scripts/automount/Disks /home/${primaryUser}/ + + echo "disksPaths linked successfully <3" + ''; + }; + +}