Files
lavitz/modules/assets.nix
2025-12-29 20:40:47 -07:00

25 lines
627 B
Nix

{ config, pkgs, lib, ... }:
let
# The assets folder from the project root
assetsPath = ../assets;
in
{
systemd.user.services.sync-assets = {
description = "Sync assets to home directory";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
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;
};
};
}