mirror of
https://github.com/foo-dogsquared/nix-module-wrapper-manager-fds.git
synced 2025-01-30 22:57:58 +00:00
tests/configs: add test for setting XDG base directories
This commit is contained in:
parent
96ba0a0702
commit
9c4ea57cc7
@ -16,6 +16,7 @@ in
|
||||
specialArgs.yourMomName = "Yor mom";
|
||||
};
|
||||
xdg-desktop-entry = build { modules = [ ./xdg-desktop-entry.nix ]; };
|
||||
xdg-basedirs = build { modules = [ ./xdg-basedirs.nix ]; };
|
||||
single-basepackage = build { modules = [ ./single-basepackage.nix ]; };
|
||||
neofetch-with-additional-files = build { modules = [ ./neofetch-with-additional-files.nix ]; };
|
||||
lib-modules-make-wraparound = build { modules = [ ./lib-modules-subset/make-wraparound.nix ]; };
|
||||
|
53
tests/configs/xdg-basedirs.nix
Normal file
53
tests/configs/xdg-basedirs.nix
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
wrapperManagerLib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
xdg.configDirs = wrapperManagerLib.getXdgConfigDirs (
|
||||
with pkgs;
|
||||
[
|
||||
yt-dlp
|
||||
]
|
||||
);
|
||||
|
||||
xdg.dataDirs = wrapperManagerLib.getXdgDataDirs (
|
||||
with pkgs;
|
||||
[
|
||||
yt-dlp
|
||||
]
|
||||
);
|
||||
|
||||
wrappers.xdg-config-dirs-script = {
|
||||
arg0 = let
|
||||
app = pkgs.writeShellScript "xdg-dirs-script" ''
|
||||
echo "$XDG_CONFIG_DIRS" | tr ':' '\n'
|
||||
'';
|
||||
in builtins.toString app;
|
||||
};
|
||||
|
||||
wrappers.xdg-data-dirs-script = {
|
||||
arg0 = let
|
||||
app = pkgs.writeShellScript "xdg-dirs-script" ''
|
||||
echo "$XDG_DATA_DIRS" | tr ':' '\n'
|
||||
'';
|
||||
in builtins.toString app;
|
||||
};
|
||||
|
||||
build.extraPassthru.wrapperManagerTests = {
|
||||
actuallyBuilt =
|
||||
let
|
||||
wrapper = config.build.toplevel;
|
||||
in
|
||||
pkgs.runCommand "wrapper-manager-xdg-desktop-entry-actually-built" { } ''
|
||||
[ -x "${wrapper}/bin/xdg-data-dirs-script" ] && {
|
||||
${lib.getExe' wrapper "xdg-data-dirs-script"} | grep "${pkgs.yt-dlp}/share" > /dev/null
|
||||
} && [ -x "${wrapper}/bin/xdg-config-dirs-script" ] && {
|
||||
${lib.getExe' wrapper "xdg-config-dirs-script"} | grep "${pkgs.yt-dlp}/etc/xdg" > /dev/null
|
||||
} && touch $out
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user