refactor(flake): move some code out of flake.in.nix

This commit is contained in:
matt1432 2024-07-21 17:12:26 -04:00
parent b3b65c1bd9
commit c701e335d1
39 changed files with 54 additions and 42 deletions

View file

@ -0,0 +1,16 @@
{pkgs, ...} @ inputs:
pkgs.lib.makeScope pkgs.newScope (mpv: let
buildLua =
mpv.callPackage
"${pkgs.path}/pkgs/applications/video/mpv/scripts/buildLua.nix" {};
buildLuaScript = file:
mpv.callPackage file (inputs // {inherit buildLua;});
in {
modernx = buildLuaScript ./modernx.nix;
pointer-event = buildLuaScript ./pointer-event.nix;
touch-gestures = buildLuaScript ./touch-gestures.nix;
kdialog-open-files = buildLuaScript ./kdialog-open-files.nix;
persist-properties = buildLuaScript ./persist-properties.nix;
undo-redo = buildLuaScript ./undo-redo.nix;
})

View file

@ -0,0 +1,16 @@
{
fetchurl,
buildLua,
...
}:
buildLua rec {
pname = "zenity-open-files";
version = "0.0.0";
unpackPhase = ":";
src = fetchurl {
url = "https://gist.githubusercontent.com/ntasos/d1d846abd7d25e4e83a78d22ee067a22/raw/b23b20e830bba024836f8b09412000658edee95c/kdialog-open-files.lua";
hash = "sha256-qJ/Myx0mdaRsWWd+4Mk1/SUSSI/uqQdg/vLZo2pkEwA=";
};
scriptPath = "${src}";
}

View file

@ -0,0 +1,27 @@
{
buildLua,
makeFontsConf,
mkVersion,
modernx-src,
...
}:
buildLua (finalAttrs: {
pname = "modernx";
version = mkVersion modernx-src;
src = modernx-src;
# Make font available to script
postInstall = ''
mkdir -p $out/share/fonts
cp -r ./Material-Design-Iconic-Font.ttf $out/share/fonts
'';
passthru.extraWrapperArgs = [
"--set"
"FONTCONFIG_FILE"
(toString (makeFontsConf {
fontDirectories = ["${finalAttrs.finalPackage}/share/fonts"];
}))
];
})

View file

@ -0,0 +1,12 @@
{
buildLua,
mkVersion,
mpv-persist-properties-src,
...
}:
buildLua {
pname = "persist-properties";
version = mkVersion mpv-persist-properties-src;
src = mpv-persist-properties-src;
}

View file

@ -0,0 +1,12 @@
{
buildLua,
mkVersion,
mpv-pointer-event-src,
...
}:
buildLua {
pname = "pointer-event";
version = mkVersion mpv-pointer-event-src;
src = mpv-pointer-event-src;
}

View file

@ -0,0 +1,12 @@
{
buildLua,
mkVersion,
mpv-touch-gestures-src,
...
}:
buildLua {
pname = "touch-gestures";
version = mkVersion mpv-touch-gestures-src;
src = mpv-touch-gestures-src;
}

View file

@ -0,0 +1,13 @@
{
buildLua,
eisa-scripts-src,
mkVersion,
...
}:
buildLua rec {
pname = "undo-redo";
version = mkVersion eisa-scripts-src;
src = eisa-scripts-src;
scriptPath = "${src}/scripts/UndoRedo.lua";
}