Refactor Nix package definitions for improved clarity and consistency, including updates to overlays, dependencies, and build inputs across multiple packages.

This commit is contained in:
Danilo Reyes 2025-10-02 14:45:13 -06:00
parent 38959dc37b
commit e9fc085de1
14 changed files with 188 additions and 198 deletions

View File

@ -28,8 +28,8 @@
|> builtins.listToAttrs; |> builtins.listToAttrs;
in in
{ {
overlays.default = final: prev: { overlays.default = _final: prev: {
scrapy = prev.scrapy.overrideAttrs (old: rec { scrapy = prev.scrapy.overrideAttrs (_old: rec {
version = "2.11.2"; version = "2.11.2";
src = prev.fetchFromGitHub { src = prev.fetchFromGitHub {
owner = "scrapy"; owner = "scrapy";
@ -42,7 +42,7 @@
packages.x86_64-linux = packages.x86_64-linux =
let let
scriptBin = path: name: pkgs.writeScriptBin name (builtins.readFile path); scriptBin = path: name: pkgs.writeScriptBin name (builtins.readFile path);
pkgsBin = path: name: pkgs.callPackage path { }; pkgsBin = path: _name: pkgs.callPackage path { };
in in
{ {
citra = pkgs.callPackage ./pkgs/citra/default.nix { branch = "nightly"; }; citra = pkgs.callPackage ./pkgs/citra/default.nix { branch = "nightly"; };

View File

@ -45,10 +45,10 @@ stdenv.mkDerivation {
glslang glslang
pkg-config pkg-config
python3 python3
] ++ lib.optionals enableQt [ wrapQtAppsHook ]; ]
++ lib.optionals enableQt [ wrapQtAppsHook ];
buildInputs = buildInputs = [
[
boost boost
libusb1 libusb1
] ]
@ -63,8 +63,7 @@ stdenv.mkDerivation {
++ lib.optional useDiscordRichPresence rapidjson ++ lib.optional useDiscordRichPresence rapidjson
++ lib.optional enableFdk fdk_aac; ++ lib.optional enableFdk fdk_aac;
cmakeFlags = cmakeFlags = [
[
"-DUSE_SYSTEM_BOOST=ON" "-DUSE_SYSTEM_BOOST=ON"
"-DCITRA_WARNINGS_AS_ERRORS=OFF" "-DCITRA_WARNINGS_AS_ERRORS=OFF"
"-DCITRA_USE_BUNDLED_FFMPEG=OFF" "-DCITRA_USE_BUNDLED_FFMPEG=OFF"

View File

@ -2,7 +2,6 @@
python3Packages, python3Packages,
gallery-dl, gallery-dl,
ffmpeg, ffmpeg,
callPackage,
... ...
}: }:
let let
@ -21,8 +20,7 @@ python3Packages.buildPythonApplication {
build-system = [ python3Packages.setuptools ]; build-system = [ python3Packages.setuptools ];
dependencies = dependencies = [
[
ffmpeg ffmpeg
gallery-dl gallery-dl
# (callPackage ../pkgs_pr/webcomix.nix { }) # (callPackage ../pkgs_pr/webcomix.nix { })

View File

@ -95,7 +95,8 @@ let
cmakeFlags = [ cmakeFlags = [
"-GNinja" "-GNinja"
"-DLauncher_QT_VERSION_MAJOR=${lib.versions.major qt6.qtbase.version}" "-DLauncher_QT_VERSION_MAJOR=${lib.versions.major qt6.qtbase.version}"
] ++ lib.optionals (msaClientID != null) [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]; ]
++ lib.optionals (msaClientID != null) [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ];
postPatch = '' postPatch = ''
# hardcode jdk paths # hardcode jdk paths

View File

@ -22,7 +22,6 @@
lz4, lz4,
python3, python3,
unzip, unzip,
nix-update-script,
nlohmann_json, nlohmann_json,
nv-codec-headers-12, nv-codec-headers-12,
pkg-config, pkg-config,
@ -30,7 +29,6 @@
vulkan-headers, vulkan-headers,
vulkan-loader, vulkan-loader,
yasm, yasm,
simpleini,
zlib, zlib,
vulkan-memory-allocator, vulkan-memory-allocator,
zstd, zstd,

View File

@ -10,8 +10,7 @@ python3Packages.buildPythonApplication {
name = "${pname}-${version}"; name = "${pname}-${version}";
}; };
build-system = [ python3Packages.setuptools ]; build-system = [ python3Packages.setuptools ];
dependencies = dependencies = [
[
sqlite sqlite
] ]
++ builtins.attrValues { ++ builtins.attrValues {

View File

@ -44,8 +44,7 @@ stdenv.mkDerivation rec {
}) })
]; ];
nativeBuildInputs = nativeBuildInputs = [
[
pkg-config pkg-config
sphinx sphinx
scons scons
@ -56,8 +55,7 @@ stdenv.mkDerivation rec {
gobject-introspection gobject-introspection
]; ];
buildInputs = buildInputs = [
[
glib glib
json-glib json-glib
util-linux util-linux

View File

@ -44,8 +44,7 @@ stdenv.mkDerivation (finalAttrs: {
copyDesktopItems copyDesktopItems
]; ];
buildInputs = buildInputs = [
[
nss nss
cairo cairo
alsa-lib alsa-lib

View File

@ -16,7 +16,7 @@
gtk4, gtk4,
}: }:
stdenv.mkDerivation (finaAttrs: rec { stdenv.mkDerivation (_finaAttrs: rec {
pname = "aviator"; pname = "aviator";
version = "0.6.0"; version = "0.6.0";
pyproject = true; pyproject = true;

View File

@ -49,8 +49,7 @@ stdenv.mkDerivation rec {
desktop-file-utils desktop-file-utils
]; ];
buildInputs = buildInputs = [
[
cairo cairo
gdk-pixbuf gdk-pixbuf
glib glib

View File

@ -2,57 +2,48 @@
lib, lib,
python3, python3,
fetchFromGitHub, fetchFromGitHub,
callPackage,
}: }:
python3.pkgs.buildPythonApplication rec { python3.pkgs.buildPythonApplication rec {
pname = "qbit-manage"; pname = "qbit-manage";
version = "4.3.0"; version = "4.6.3";
pyproject = true; pyproject = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "StuffAnThings"; owner = "StuffAnThings";
repo = "qbit_manage"; repo = "qbit_manage";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-Wj1s11PwHfH4hDGEn0jW/REO2gI7+AGyb2B/QKUhlyk="; hash = "sha256-cTxM3nHQQto7lpoNjShYcCbJCSYiwS9bKqw0DWAjw6A=";
}; };
postPatch = '' postPatch = ''
rm LICENSE rm LICENSE
''; '';
build-system = [ build-system = builtins.attrValues {
python3.pkgs.setuptools inherit (python3.pkgs)
python3.pkgs.wheel setuptools
]; wheel
;
};
dependencies = with python3.pkgs; [ propagatedBuildInputs = builtins.attrValues {
inherit (python3.pkgs)
argon2-cffi
bencode-py
croniter croniter
fastapi
gitpython gitpython
humanize humanize
pytimeparse2 pytimeparse2
bencode-py qbittorrent-api
requests requests
retrying retrying
ruamel-yaml ruamel-yaml
schedule slowapi
(callPackage ./qbittorrent-api.nix { uvicorn
inherit lib;
inherit (python3.pkgs)
buildPythonPackage
fetchPypi
# build-system
setuptools
setuptools-scm
# dependencies
packaging
requests
urllib3
; ;
}) };
];
meta = { meta = {
description = "This tool will help manage tedious tasks in qBittorrent and automate them. Tag, categorize, remove Orphaned data, remove unregistered torrents and much much more"; description = "This tool will help manage tedious tasks in qBittorrent and automate them. Tag, categorize, remove Orphaned data, remove unregistered torrents and much much more";

View File

@ -3,8 +3,7 @@
}: }:
pkgs.mkShell { pkgs.mkShell {
packages = packages = [
[
(pkgs.python3.withPackages ( (pkgs.python3.withPackages (
ps: ps:
builtins.attrValues { builtins.attrValues {

View File

@ -1,12 +1,18 @@
let pkgs = import <nixpkgs> { }; let
in pkgs.haskellPackages.developPackage { pkgs = import <nixpkgs> { };
in
pkgs.haskellPackages.developPackage {
root = ./.; root = ./.;
modifier = drv: modifier =
pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages; [ drv:
pkgs.haskell.lib.addBuildTools drv (
with pkgs.haskellPackages;
[
cabal-install cabal-install
ghcid ghcid
haskell-language-server haskell-language-server
fourmolu fourmolu
regex regex
]); ]
);
} }

View File

@ -1,18 +1,21 @@
{ pkgs ? import <nixpkgs> { } }: {
pkgs ? import <nixpkgs> { },
}:
with pkgs; with pkgs;
mkShell { mkShell {
packages = [ packages = [
geckodriver geckodriver
(python3.withPackages (ps: (python3.withPackages (
with ps; [ ps: with ps; [
tweepy tweepy
requests requests
beautifulsoup4 beautifulsoup4
selenium selenium
webdriver-manager webdriver-manager
])) ]
))
]; ];
buildInputs = [ ]; buildInputs = [ ];
} }