mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
tests: reduce closure sizes
This commit is contained in:
parent
880d9bc211
commit
1ca210648a
5 changed files with 98 additions and 64 deletions
|
@ -18,6 +18,21 @@
|
|||
fcitx5-qt = { outPath = null; };
|
||||
fcitx5-gtk = { outPath = null; };
|
||||
fcitx5-chinese-addons = { outPath = null; };
|
||||
|
||||
gtk2 = {
|
||||
buildScript = ''
|
||||
mkdir -p $out/bin
|
||||
echo '#/usr/bin/env bash' > $out/bin/gtk-query-immodules-2.0
|
||||
chmod +x $out/bin/*
|
||||
'';
|
||||
};
|
||||
gtk3 = {
|
||||
buildScript = ''
|
||||
mkdir -p $out/bin
|
||||
echo '#/usr/bin/env bash' > $out/bin/gtk-query-immodules-3.0
|
||||
chmod +x $out/bin/*
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
|
|
|
@ -11,10 +11,14 @@
|
|||
|
||||
programs.beets = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { outPath = "@beets@"; };
|
||||
mpdIntegration.enableStats = true;
|
||||
};
|
||||
|
||||
test.stubs = {
|
||||
beets = { };
|
||||
mpd = { };
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/beets/config.yaml
|
||||
assertFileContent \
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
imports = [ ./mpv-stubs.nix ];
|
||||
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
package = pkgs.mpvDummy;
|
||||
|
||||
bindings = {
|
||||
WHEEL_UP = "seek 10";
|
||||
|
@ -37,8 +37,6 @@
|
|||
defaultProfiles = [ "gpu-hq" ];
|
||||
};
|
||||
|
||||
test.stubs.mpvDummy = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/mpv/mpv.conf \
|
||||
|
@ -50,6 +48,4 @@
|
|||
home-files/.config/mpv/script-opts/osc.conf \
|
||||
${./mpv-example-settings-expected-osc-opts}
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,25 +1,16 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
imports = [ ./mpv-stubs.nix ];
|
||||
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
package = pkgs.mpvDummy;
|
||||
package = pkgs.emptyDirectory;
|
||||
scripts = [ pkgs.mpvScript ];
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
mpvScript =
|
||||
pkgs.runCommandLocal "mpvScript" { scriptName = "something"; }
|
||||
"mkdir $out";
|
||||
})
|
||||
];
|
||||
test.stubs.mpvDummy = { };
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
''
|
||||
The programs.mpv "package" option is mutually exclusive with "scripts" option.''
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
28
tests/modules/programs/mpv/mpv-stubs.nix
Normal file
28
tests/modules/programs/mpv/mpv-stubs.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
mpvScript = pkgs.runCommandLocal "mpvScript" { scriptName = "something"; }
|
||||
"mkdir $out";
|
||||
|
||||
mpv-unwrapped = super.mpv-unwrapped.overrideAttrs {
|
||||
builder = pkgs.writeShellScript "dummy" ''
|
||||
PATH=${pkgs.coreutils}/bin
|
||||
mkdir -p $dev $man $out/bin $out/Applications/mpv.app/Contents/MacOS
|
||||
touch $out/bin/{mpv,umpv} \
|
||||
$out/Applications/mpv.app/Contents/MacOS/{mpv,mpv-bundle}
|
||||
chmod +x $out/bin/{mpv,umpv} \
|
||||
$out/Applications/mpv.app/Contents/MacOS/{mpv,mpv-bundle}
|
||||
'';
|
||||
};
|
||||
|
||||
lua = pkgs.emptyDirectory.overrideAttrs {
|
||||
luaversion = "0";
|
||||
withPackages = ps: pkgs.emptyDirectory;
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
test.stubs = { yt-dlp = { }; };
|
||||
}
|
Loading…
Reference in a new issue