moderat tidy up of home.nix
This commit is contained in:
parent
7f73c1af20
commit
4ca6cff337
12 changed files with 110 additions and 115 deletions
31
home/programs/sync/postActivation.nix
Normal file
31
home/programs/sync/postActivation.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ inputs, outputs, lib, config, pkgs, primaryUser, homeDir, flakePath, disksPath
|
||||
, ... }:
|
||||
|
||||
{
|
||||
|
||||
## Work in progress - to fix/configure:
|
||||
## - automatically copy flake repo to desired path
|
||||
## - automatically copy sync directories to to desired paths
|
||||
## - expand script with a try/catch block to provide output for failed links
|
||||
## - expand script to only run if desired directories are NOT already linked
|
||||
|
||||
## To utilise this script place the following option into some system-level module
|
||||
imports = [ ../home/scripts/automount/postActivation.nix ];
|
||||
|
||||
## Runs after using `sudo nixos-rebuild switch --flake .#<hostname>`
|
||||
system.activationScripts.disksLink = {
|
||||
supportsDryActivation = false;
|
||||
## Prints status of run commmand with a cute message if successful
|
||||
text = ''
|
||||
cd ~ && ln -s Disks /run/media/${primaryUser}/*
|
||||
echo "Current variables required are:"
|
||||
echo "primaryUser - ${primaryUser}"
|
||||
echo "homeDir - ${homeDir}"
|
||||
echo "current paths linked are:"
|
||||
echo "flakePath - ${flakePath}"
|
||||
echo "disksPath - ${disksPath}"
|
||||
echo "<3"
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue