Files
nixos-setup/modules/skyg-utils.nix
T

21 lines
457 B
Nix

{ pkgs, lib }:
{
makeHyperlinkScriptToConfigs =
{ filePath
, configSource
}:
let
homePath = "$HOME/.config/${filePath}";
sourcePath = "${configSource}/${filePath}";
in
''
rm -f "${homePath}"
if [[ ! -h "$HOME/.config/${filePath}" ]]; then
ln -s "${sourcePath}" "${homePath}" || {
echo "Failed to create symlink for ${filePath} at ${homePath}"
exit 1
}
fi
'';
}