best practices: got rid of rec

This commit is contained in:
Danilo Reyes 2024-11-09 14:53:58 -06:00
parent 0bebf3e366
commit be0e4d7109
8 changed files with 283 additions and 243 deletions

View File

@ -124,12 +124,16 @@
wget
sops
];
variables = rec {
# PATH
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_BIN_HOME = "\${HOME}/.local/bin";
variables =
let
XDG_DATA_HOME = "\${HOME}/.local/share";
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_CACHE_HOME = "\${HOME}/.cache";
in
{
# PATH
inherit XDG_DATA_HOME XDG_CONFIG_HOME XDG_CACHE_HOME;
XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_STATE_HOME = "\${HOME}/.local/state";
# DEV PATH

View File

@ -44,14 +44,19 @@ in
nodejs
perl
(python311.withPackages (ps: with ps; [ tensorflow ]))
(perlPackages.buildPerlPackage rec {
pname = "Image-ExifTool";
(perlPackages.buildPerlPackage (
let
version = "12.70";
in
{
pname = "Image-ExifTool";
inherit version;
src = fetchurl {
url = "https://exiftool.org/Image-ExifTool-${version}.tar.gz";
hash = "sha256-TLJSJEXMPj870TkExq6uraX8Wl4kmNerrSlX3LQsr/4=";
};
})
}
))
];
};
programs.msmtp = {

View File

@ -15,9 +15,12 @@
imagemagick # photoshop what??
])
++ [
(pkgs.python3Packages.buildPythonApplication rec {
(pkgs.python3Packages.buildPythonApplication (
let
pname = "ffpb";
version = "0.4.1";
in
{
src = pkgs.python3Packages.fetchPypi {
inherit pname version;
sha256 = "sha256-7eVqbLpMHS1sBw2vYS4cTtyVdnnknGtEI8190VlXflk=";
@ -25,7 +28,8 @@
doCheck = false;
buildInputs = [ pkgs.python3Packages.setuptools ];
propagatedBuildInputs = [ pkgs.python3Packages.tqdm ];
})
}
))
];
};
}

View File

@ -15,9 +15,17 @@ let
};
in
{
nightly = qt6Packages.callPackage ./generic.nix rec {
pname = "citra-nightly";
nightly = qt6Packages.callPackage ./generic.nix (
let
version = "2104";
in
{
pname = "citra-nightly";
inherit
version
branch
compat-list
;
src = fetchFromGitHub {
owner = "CaptainJawZ";
@ -27,7 +35,7 @@ in
fetchSubmodules = true;
};
inherit branch compat-list;
};
}
);
}
.${branch}

View File

@ -37,7 +37,7 @@ assert lib.assertMsg (
!enableFfmpegAudioDecoder || !enableFdk
) "Can't enable both enableFfmpegAudioDecoder and enableFdk";
stdenv.mkDerivation rec {
stdenv.mkDerivation {
inherit pname version src;
nativeBuildInputs = [

View File

@ -58,9 +58,13 @@ let
gameLibraryPath = libpath + ":${addOpenGLRunpath.driverLink}/lib";
in
stdenv.mkDerivation rec {
pname = "polymc" + (lib.optionalString ((lib.versions.major qt6.qtbase.version) == "5") "-qt5");
stdenv.mkDerivation (
let
version = "6.1";
in
{
pname = "polymc" + (lib.optionalString ((lib.versions.major qt6.qtbase.version) == "5") "-qt5");
inherit version;
src = fetchFromGitHub {
owner = "PolyMC";
@ -117,19 +121,23 @@ let
withMangohud ? true,
withGamemode ? true,
}:
stdenv.mkDerivation rec {
pname = "${polymc.pname}-wrapped";
inherit (polymc) version;
stdenv.mkDerivation (
let
libsPath =
(lib.makeLibraryPath (extraLibs ++ lib.optional withGamemode gamemode.lib))
+ lib.optionalString withMangohud "${mangohud + "/lib/mangohud"}";
binsPath = lib.makeBinPath (extraPaths ++ lib.optional withMangohud mangohud);
waylandPreExec = writeShellScript "waylandGLFW" ''
if [ -n "$WAYLAND_DISPLAY" ]; then
export LD_LIBRARY_PATH=${lib.getLib glfw-wayland-minecraft}/lib:"$LD_LIBRARY_PATH"
fi
'';
in
{
pname = "${polymc.pname}-wrapped";
inherit (polymc) version;
inherit libsPath binsPath waylandPreExec;
src = polymc;
nativeBuildInputs = [ makeWrapper ];
phases = [
@ -157,7 +165,8 @@ let
preferLocalBuild = true;
inherit (polymc) meta;
};
}
);
};
meta = with lib; {
homepage = "https://polymc.org/";
@ -172,6 +181,7 @@ let
platforms = [ "x86_64-linux" ];
license = licenses.gpl3Only;
};
};
}
);
in
polymc

View File

@ -16,16 +16,19 @@ let
filepicker = callPackage ./filepicker.nix { };
in
buildNpmPackage rec {
pname = "vdhcoapp";
buildNpmPackage (
let
version = "2.0.19";
pname = "vdhcoapp";
src = fetchFromGitHub {
owner = "aclap-dev";
repo = "vdhcoapp";
repo = "${pname}";
rev = "v${version}";
hash = "sha256-8xeZvqpRq71aShVogiwlVD3gQoPGseNOmz5E3KbsZxU=";
};
in
{
inherit pname version src;
sourceRoot = "${src.name}/app";
npmDepsHash = "sha256-E032U2XZdyTER6ROkBosOTn7bweDXHl8voC3BQEz8Wg=";
@ -70,4 +73,5 @@ buildNpmPackage rec {
maintainers = with maintainers; [ wolfangaukang ];
mainProgram = "vdhcoapp";
};
}
}
)

View File

@ -8,9 +8,13 @@
glib,
}:
rustPlatform.buildRustPackage rec {
pname = "filepicker";
rustPlatform.buildRustPackage (
let
version = "1.0.1";
in
{
pname = "filepicker";
inherit version;
src = fetchFromGitHub {
owner = "paulrouget";
@ -36,4 +40,5 @@ rustPlatform.buildRustPackage rec {
mainProgram = "filepicker";
maintainers = with maintainers; [ hannesgith ];
};
}
}
)