mirror of
https://github.com/nix-community/home-manager
synced 2024-12-30 13:49:47 +01:00
cb09a968e9
This option provides a more convenient way to overlay dummy packages. It also adds a function `config.lib.test.mkStubPackage` that can, e.g., be used for `package` options.
37 lines
1,022 B
Nix
37 lines
1,022 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
config = {
|
|
programs.mpv = {
|
|
enable = true;
|
|
package = pkgs.mpvDummy;
|
|
scripts = [ pkgs.mpvScript ];
|
|
};
|
|
|
|
nixpkgs.overlays = [
|
|
(self: super: {
|
|
mpv-unwrapped = pkgs.runCommandLocal "mpv" {
|
|
version = "0";
|
|
passthru = {
|
|
lua.luaversion = "0";
|
|
luaEnv = "/dummy";
|
|
vapoursynthSupport = false;
|
|
};
|
|
} ''
|
|
mkdir -p $out/bin $out/Applications/mpv.app/Contents/MacOS
|
|
touch $out/bin/{,u}mpv $out/Applications/mpv.app/Contents/MacOS/mpv
|
|
chmod 755 $out/bin/{,u}mpv $out/Applications/mpv.app/Contents/MacOS/mpv
|
|
'';
|
|
mpvDummy = config.lib.test.mkStubPackage { };
|
|
mpvScript =
|
|
pkgs.runCommandLocal "mpvScript" { scriptName = "something"; }
|
|
"mkdir $out";
|
|
})
|
|
];
|
|
|
|
test.asserts.assertions.expected = [
|
|
''
|
|
The programs.mpv "package" option is mutually exclusive with "scripts" option.''
|
|
];
|
|
};
|
|
}
|