mirror of
https://github.com/foo-dogsquared/nix-module-wrapper-manager-fds.git
synced 2025-01-31 04:58:17 +00:00
wrapper-manager-fds/lib: add function for getting XDG-related directories
This commit is contained in:
parent
62cc18faf5
commit
724ac43d83
@ -9,7 +9,23 @@ rec {
|
|||||||
builtins.map (v: lib.getBin v) drvs;
|
builtins.map (v: lib.getBin v) drvs;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Given a list of derivations, return a list of the store paths with the
|
||||||
|
`libexec` appended.
|
||||||
*/
|
*/
|
||||||
getLibexec = drvs:
|
getLibexec = drvs:
|
||||||
builtins.map (v: "${v}/libexec") drvs;
|
builtins.map (v: "${v}/libexec") drvs;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Given a list of derivations, return a list of the store paths appended with
|
||||||
|
`/etc/xdg` suitable as part of the XDG_CONFIG_DIRS environment variable.
|
||||||
|
*/
|
||||||
|
getXdgConfigDirs = drvs:
|
||||||
|
builtins.map (v: "${v}/etc/xdg") drvs;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Given a list of derivations, return a list of store paths appended with
|
||||||
|
`/share` suitable as part of the XDG_DATA_DIRS environment variable.
|
||||||
|
*/
|
||||||
|
getXdgDataDirs = drvs:
|
||||||
|
builtins.map (v: "${v}/share") drvs;
|
||||||
}
|
}
|
||||||
|
@ -22,4 +22,26 @@ lib.runTests {
|
|||||||
"${../../modules}/libexec"
|
"${../../modules}/libexec"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
testsUtilsGetXdgConfigDirs = {
|
||||||
|
expr = self.utils.getXdgConfigDirs [
|
||||||
|
../../lib
|
||||||
|
../../modules
|
||||||
|
];
|
||||||
|
expected = [
|
||||||
|
"${../../lib}/etc/xdg"
|
||||||
|
"${../../modules}/etc/xdg"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
testsUtilsGetXdgDataDirs = {
|
||||||
|
expr = self.utils.getXdgDataDirs [
|
||||||
|
../../lib
|
||||||
|
../../modules
|
||||||
|
];
|
||||||
|
expected = [
|
||||||
|
"${../../lib}/share"
|
||||||
|
"${../../modules}/share"
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user