Regenerated
This commit is contained in:
+8
-10
@@ -143,7 +143,10 @@ The Nix flake definition for Droidnix.
|
||||
nixosConfigurations.traveldroid = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
|
||||
specialArgs = { inherit inputs; };
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
flakeRoot = ./.; # <-- Pass the absolute path of the flake root
|
||||
};
|
||||
|
||||
modules = [
|
||||
./generated/hosts/traveldroid/boot.nix
|
||||
@@ -287,26 +290,21 @@ in {
|
||||
** =generated/modules/users/copy_2_home.nix=
|
||||
This copies stuff to the user home-folder
|
||||
#+BEGIN_SRC nix :tangle generated/modules/users/copy_2_home.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ lib, config, pkgs, ... }:
|
||||
{ lib, config, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
homeDir = config.home.homeDirectory or "/home/${username}";
|
||||
assetPath = ../../../assets/copy_2_home;
|
||||
assetPath = "${flakeRoot}/assets/copy_2_home";
|
||||
in
|
||||
{
|
||||
_module.args.hmUsers = {
|
||||
${username} = {
|
||||
# This runs after everything else
|
||||
home.activation.copyAssets = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
echo "Copying assets from ${assetPath} to ${homeDir} ..."
|
||||
|
||||
# Ensure the destination exists
|
||||
mkdir -p "${homeDir}"
|
||||
|
||||
# Copy all files and directories recursively, overwrite existing
|
||||
cp -rT "${assetPath}" "${homeDir}"
|
||||
|
||||
# Copy recursively, overwrite existing files, preserve symlinks
|
||||
cp -a "${assetPath}/." "${homeDir}/"
|
||||
echo "Done copying assets."
|
||||
'';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user