???
This commit is contained in:
@@ -1,24 +1,14 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
settings = import ../settings.nix;
|
||||||
# The assets folder from the project root
|
# The assets folder from the project root
|
||||||
assetsPath = ../assets;
|
assetsPath = ../assets;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
systemd.user.services.sync-assets = {
|
# Use tmpfiles.rules to create the symlink at boot/activation
|
||||||
description = "Sync assets to home directory";
|
# L+ forces the creation of the symlink, removing existing file/dir if necessary
|
||||||
wantedBy = [ "graphical-session.target" ];
|
systemd.tmpfiles.rules = [
|
||||||
partOf = [ "graphical-session.target" ];
|
"L+ /home/${settings.username}/Assets - - - - ${assetsPath}"
|
||||||
script = ''
|
];
|
||||||
# Remove existing Assets directory or symlink
|
|
||||||
${pkgs.coreutils}/bin/rm -rf %h/Assets
|
|
||||||
|
|
||||||
# Create symbolic link to the assets in the Nix store
|
|
||||||
${pkgs.coreutils}/bin/ln -s ${assetsPath} %h/Assets
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
RemainAfterExit = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user