Make the paths relative to the user's home directory.
This commit is contained in:
parent
eb5815048f
commit
6b42a09468
@ -21,28 +21,30 @@ let
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
stage: target: (constructors."${target.method}"."${stage}" target);
|
stage: target: (constructors."${target.method}"."${stage}" target);
|
||||||
old_install_user_file =
|
|
||||||
let
|
|
||||||
constructors = {
|
|
||||||
"overwrite" = install_user_file_overwrite;
|
|
||||||
"symlink" = install_user_file_symlink;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
(target: (constructors."${target.method}" target));
|
|
||||||
install_user_file_overwrite = {
|
install_user_file_overwrite = {
|
||||||
"check" = (target: "");
|
"check" = (target: "");
|
||||||
"install" = (
|
"install" = (
|
||||||
target:
|
target:
|
||||||
let
|
let
|
||||||
source = lib.strings.escapeShellArg "${target.source}";
|
source = lib.strings.escapeShellArg "${target.source}";
|
||||||
destination = lib.strings.escapeShellArg "${target.target}";
|
homedir = config.users.users."${target.username}".home;
|
||||||
|
destination = lib.strings.escapeShellArg "${homedir}/${target.target}";
|
||||||
mode = lib.strings.escapeShellArg "${target.mode}";
|
mode = lib.strings.escapeShellArg "${target.mode}";
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
$DRY_RUN_CMD install $VERBOSE_ARG -D --compare -m ${mode} ${source} ${destination}
|
$DRY_RUN_CMD install $VERBOSE_ARG -D --compare -m ${mode} ${source} ${destination}
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
"uninstall" = (target: "");
|
"uninstall" = (
|
||||||
|
target:
|
||||||
|
let
|
||||||
|
homedir = config.users.users."${target.username}".home;
|
||||||
|
destination = lib.strings.escapeShellArg "${homedir}/${target.target}";
|
||||||
|
in
|
||||||
|
''
|
||||||
|
$DRY_RUN_CMD echo rm -f ${destination}
|
||||||
|
''
|
||||||
|
);
|
||||||
};
|
};
|
||||||
install_user_file_symlink = {
|
install_user_file_symlink = {
|
||||||
"check" = (target: "");
|
"check" = (target: "");
|
||||||
@ -50,13 +52,23 @@ let
|
|||||||
target:
|
target:
|
||||||
let
|
let
|
||||||
source = lib.strings.escapeShellArg "${target.source}";
|
source = lib.strings.escapeShellArg "${target.source}";
|
||||||
destination = lib.strings.escapeShellArg "${target.target}";
|
homedir = config.users.users."${target.username}".home;
|
||||||
|
destination = lib.strings.escapeShellArg "${homedir}/${target.target}";
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
$DRY_RUN_CMD ln $VERBOSE_ARG -s ${source} ${destination}
|
$DRY_RUN_CMD ln $VERBOSE_ARG -s ${source} ${destination}
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
"uninstall" = (target: "");
|
"uninstall" = (
|
||||||
|
target:
|
||||||
|
let
|
||||||
|
homedir = config.users.users."${target.username}".home;
|
||||||
|
destination = lib.strings.escapeShellArg "${homedir}/${target.target}";
|
||||||
|
in
|
||||||
|
''
|
||||||
|
$DRY_RUN_CMD echo rm -f ${destination}
|
||||||
|
''
|
||||||
|
);
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user