From f12e7f2513632031029dd62bd3a364873da7a11c Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 11 Feb 2025 13:05:14 -0500 Subject: [PATCH] refactor(packages): clarify inputs and cleanup meta --- packages/README.md | 8 +++---- packages/gpu-screen-recorder/generic.nix | 18 +++++++++------ packages/homepage/default.nix | 21 ++++++++++------- packages/jmusicbot/default.nix | 2 ++ packages/libratbag/default.nix | 2 ++ packages/librespot-auth/default.nix | 11 ++++++--- packages/pam-fprint-grosshack/default.nix | 12 ++++++---- packages/piper/default.nix | 2 ++ packages/pokemon-colorscripts/default.nix | 8 +++++-- packages/proton-ge-latest/default.nix | 10 ++++++++ packages/protonhax/default.nix | 9 +++++--- packages/repl/default.nix | 12 +++++++--- .../some-sass-language-server/default.nix | 23 +++++++++++++------ packages/subscleaner/default.nix | 8 +++++-- packages/trash-d/default.nix | 21 +++++++++++------ packages/urllib3/default.nix | 10 +++++--- 16 files changed, 124 insertions(+), 53 deletions(-) diff --git a/packages/README.md b/packages/README.md index 2df6e533..d59b273f 100644 --- a/packages/README.md +++ b/packages/README.md @@ -8,17 +8,17 @@ This directory contains every derivations for packages exposed by this flake. | ---- | ----------- | -------- | | `gpu-screen-recorder` | Screen recorder that has minimal impact on system performance by recording a window using the GPU only | https://git.dec05eba.com/gpu-screen-recorder/about/ | | `gsr-kms-server` | Screen recorder that has minimal impact on system performance by recording a window using the GPU only | https://git.dec05eba.com/gpu-screen-recorder/about/ | -| `homepage` | Highly customisable dashboard with Docker and service API integrations | https://gethomepage.dev | +| `homepage` | Highly customisable dashboard with Docker and service API integrations. | https://gethomepage.dev | | `jmusicbot` | Discord music bot that's easy to set up and run yourself | https://github.com/jagrosh/MusicBot | | `libratbag` | Configuration library for gaming mice | https://github.com/libratbag/libratbag | | `librespot-auth` | A simple program for populating a credentials.json via Spotify's zeroconf authentication. | https://github.com/dspearson/librespot-auth | | `pam-fprint-grosshack` | This is a fork of the pam module which implements the simultaneous password and fingerprint behaviour present in pam_thinkfinger. | https://gitlab.com/mishakmak/pam-fprint-grosshack | | `piper` | GTK frontend for ratbagd mouse config daemon | https://github.com/libratbag/piper | | `pokemon-colorscripts` | A script to print out images of pokemon to the terminal. | https://gitlab.com/phoneybadger/pokemon-colorscripts | -| `proton-ge-latest` | Compatibility tool for Steam Play based on Wine and additional components. (This is intended for use in the `programs.steam.extraCompatPackages` option only.) | https://github.com/GloriousEggroll/proton-ge-custom | +| `proton-ge-latest` | Compatibility tool for Steam Play based on Wine and additional components. (This is intended for use in the `programs.steam.extraCompatPackages` option only.) This derivation overrides the Proton version in Steam so that games using the Proton from nix keep using it after every version change. | https://github.com/GloriousEggroll/proton-ge-custom | | `protonhax` | Tool to help running other programs (i.e. Cheat Engine) inside Steam's proton. | https://github.com/jcnils/protonhax | -| `repl` | A simple program for populating a credentials.json via Spotify's zeroconf authentication. | fork of https://github.com/fufexan/dotfiles/blob/main/pkgs/repl/default.nix | +| `repl` | A wrapper of `nix repl` with the flake located at `$FLAKE` loaded in. It also attempts to load the current system's derivation for both `nixosConfigurations` and `nixOnDroidConfigurations`. | fork of https://github.com/fufexan/dotfiles/blob/main/pkgs/repl/default.nix | | `some-sass-language-server` | Some Sass is a language server extension for Visual Studio Code and other editors with a language server protocol (LSP) client. It brings improved code suggestions, documentation and code navigation for both SCSS and indented syntaxes. | https://github.com/wkillerud/some-sass | | `subscleaner` | Subscleaner is a Python script that removes advertisements from subtitle files. It's designed to help you enjoy your favorite shows and movies without the distraction of unwanted ads in the subtitles. | https://gitlab.com/rogs/subscleaner | | `trash-d` | A near drop-in replacement for `rm` that uses the [FreeDesktop trash bin](https://specifications.freedesktop.org/trash-spec/trashspec-latest.html). | https://github.com/rushsteve1/trash-d | -| `urllib3` | Powerful, sanity-friendly HTTP client for Python | https://github.com/shazow/urllib3 | +| `urllib3` | Powerful, sanity-friendly HTTP client for Python. | https://github.com/shazow/urllib3 | diff --git a/packages/gpu-screen-recorder/generic.nix b/packages/gpu-screen-recorder/generic.nix index 5cf94de9..493c3e23 100644 --- a/packages/gpu-screen-recorder/generic.nix +++ b/packages/gpu-screen-recorder/generic.nix @@ -1,23 +1,24 @@ { - # Params + # params pname, gpu-screen-recorder-src, isKmsServer ? false, - # Derivation deps + # nix build inputs lib, + stdenv, addDriverRunpath, + makeWrapper, + # deps dbus, ffmpeg, libdrm, libglvnd, libpulseaudio, libva, - makeWrapper, meson, ninja, pipewire, pkg-config, - stdenv, vulkan-headers, wayland, xorg, @@ -101,10 +102,13 @@ in ''; meta = { - description = "Screen recorder that has minimal impact on system performance by recording a window using the GPU only"; - homepage = "https://git.dec05eba.com/gpu-screen-recorder/about/"; + mainProgram = pname; license = lib.licenses.gpl3Only; platforms = ["x86_64-linux"]; - mainProgram = pname; + homepage = "https://git.dec05eba.com/gpu-screen-recorder/about/"; + description = '' + Screen recorder that has minimal impact on system performance by recording + a window using the GPU only + ''; }; } diff --git a/packages/homepage/default.nix b/packages/homepage/default.nix index 771bf226..a277a7fb 100644 --- a/packages/homepage/default.nix +++ b/packages/homepage/default.nix @@ -1,14 +1,17 @@ { + # params + enableLocalIcons ? true, + # nix build inputs + lib, + stdenv, buildNpmPackage, fetchFromGitHub, + # deps + cctools, + git, nodePackages, python3, - stdenv, - cctools, IOKit ? {}, - lib, - enableLocalIcons ? true, - git, }: let inherit (lib) optionals optionalString; @@ -86,10 +89,12 @@ in doDist = false; meta = { - description = "Highly customisable dashboard with Docker and service API integrations"; - changelog = "https://github.com/gethomepage/homepage/releases/tag/v${version}"; mainProgram = "homepage"; - homepage = "https://gethomepage.dev"; license = lib.licenses.gpl3; + homepage = "https://gethomepage.dev"; + changelog = "https://github.com/gethomepage/homepage/releases/tag/v${version}"; + description = '' + Highly customisable dashboard with Docker and service API integrations. + ''; }; } diff --git a/packages/jmusicbot/default.nix b/packages/jmusicbot/default.nix index c3fbc94b..aae939fe 100644 --- a/packages/jmusicbot/default.nix +++ b/packages/jmusicbot/default.nix @@ -1,6 +1,8 @@ { + # nix build inputs lib, fetchurl, + # deps jmusicbot, jdk11_headless, jre_minimal, diff --git a/packages/libratbag/default.nix b/packages/libratbag/default.nix index 5f55aee5..d1ee5706 100644 --- a/packages/libratbag/default.nix +++ b/packages/libratbag/default.nix @@ -1,6 +1,8 @@ { + # nix build inputs lib, libratbag-src, + # deps libratbag, ... }: let diff --git a/packages/librespot-auth/default.nix b/packages/librespot-auth/default.nix index 693b5e49..57c47d28 100644 --- a/packages/librespot-auth/default.nix +++ b/packages/librespot-auth/default.nix @@ -1,10 +1,12 @@ { + # nix build inputs lib, fetchFromGitHub, makeWrapper, + rustPlatform, + # deps openssl, pkg-config, - rustPlatform, ... }: rustPlatform.buildRustPackage rec { @@ -36,9 +38,12 @@ rustPlatform.buildRustPackage rec { ]; meta = { - description = "A simple program for populating a credentials.json via Spotify's zeroconf authentication."; mainProgram = pname; - homepage = "https://github.com/dspearson/librespot-auth"; license = with lib.licenses; [isc]; + homepage = "https://github.com/dspearson/librespot-auth"; + description = '' + A simple program for populating a credentials.json via Spotify's + zeroconf authentication. + ''; }; } diff --git a/packages/pam-fprint-grosshack/default.nix b/packages/pam-fprint-grosshack/default.nix index 0d2e1593..bebd6608 100644 --- a/packages/pam-fprint-grosshack/default.nix +++ b/packages/pam-fprint-grosshack/default.nix @@ -1,6 +1,9 @@ { + # nix build inputs lib, + stdenv, pam-fprint-grosshack-src, + # deps dbus, glib, libfprint, @@ -10,7 +13,6 @@ pam, pkg-config, polkit, - stdenv, systemd, ... }: let @@ -44,9 +46,11 @@ in ]; meta = { - description = "This is a fork of the pam module which implements the simultaneous -password and fingerprint behaviour present in pam_thinkfinger."; - homepage = "https://gitlab.com/mishakmak/pam-fprint-grosshack"; license = with lib.licenses; [gpl2Plus]; + homepage = "https://gitlab.com/mishakmak/pam-fprint-grosshack"; + description = '' + This is a fork of the pam module which implements the simultaneous password and + fingerprint behaviour present in pam_thinkfinger. + ''; }; } diff --git a/packages/piper/default.nix b/packages/piper/default.nix index 487a0a98..deb075d1 100644 --- a/packages/piper/default.nix +++ b/packages/piper/default.nix @@ -1,6 +1,8 @@ { + # nix build inputs lib, piper-src, + # deps piper, ... }: let diff --git a/packages/pokemon-colorscripts/default.nix b/packages/pokemon-colorscripts/default.nix index ea763aeb..b0025068 100644 --- a/packages/pokemon-colorscripts/default.nix +++ b/packages/pokemon-colorscripts/default.nix @@ -1,8 +1,10 @@ { + # nix build inputs mkVersion, stdenv, - python3Packages, pokemon-colorscripts-src, + # deps + python3Packages, ... }: stdenv.mkDerivation { @@ -27,7 +29,9 @@ stdenv.mkDerivation { ''; meta = { - description = "A script to print out images of pokemon to the terminal."; homepage = "https://gitlab.com/phoneybadger/pokemon-colorscripts"; + description = '' + A script to print out images of pokemon to the terminal. + ''; }; } diff --git a/packages/proton-ge-latest/default.nix b/packages/proton-ge-latest/default.nix index 2bfdaef1..f676b7cc 100644 --- a/packages/proton-ge-latest/default.nix +++ b/packages/proton-ge-latest/default.nix @@ -1,5 +1,7 @@ { + # nix build inputs lib, + # deps proton-ge-bin, rsync, ... @@ -27,4 +29,12 @@ in runHook postBuild ''; + + meta = o.meta // { + description = '' + ${o.meta.description} + This derivation overrides the Proton version in Steam so that games using the Proton + from nix keep using it after every version change. + ''; + }; }) diff --git a/packages/protonhax/default.nix b/packages/protonhax/default.nix index 6d9ee860..b336c84e 100644 --- a/packages/protonhax/default.nix +++ b/packages/protonhax/default.nix @@ -1,8 +1,9 @@ { + # nix build inputs lib, mkVersion, - protonhax-src, stdenv, + protonhax-src, ... }: stdenv.mkDerivation { @@ -16,8 +17,10 @@ stdenv.mkDerivation { ''; meta = { - description = "Tool to help running other programs (i.e. Cheat Engine) inside Steam's proton."; - homepage = "https://github.com/jcnils/protonhax"; license = with lib.licenses; [bsd3]; + homepage = "https://github.com/jcnils/protonhax"; + description = '' + Tool to help running other programs (i.e. Cheat Engine) inside Steam's proton. + ''; }; } diff --git a/packages/repl/default.nix b/packages/repl/default.nix index 83b6fad4..fd10c0cb 100644 --- a/packages/repl/default.nix +++ b/packages/repl/default.nix @@ -1,12 +1,14 @@ -# modified from https://github.com/fufexan/dotfiles/blob/main/pkgs/repl/default.nix { + # nix build inputs + writeShellApplication, + # deps coreutils, gnused, ncurses, - writeShellApplication, ... }: let repl = ./repl.nix; + example = command: desc: ''\n$(tput setaf 3) ${command}$(tput sgr0) - ${desc}''; in writeShellApplication { @@ -40,7 +42,11 @@ in ''; meta = { - description = "A simple program for populating a credentials.json via Spotify's zeroconf authentication."; homepage = "fork of https://github.com/fufexan/dotfiles/blob/main/pkgs/repl/default.nix"; + description = '' + A wrapper of `nix repl` with the flake located at `$FLAKE` loaded in. It also attempts + to load the current system's derivation for both `nixosConfigurations` and + `nixOnDroidConfigurations`. + ''; }; } diff --git a/packages/some-sass-language-server/default.nix b/packages/some-sass-language-server/default.nix index fdf950b9..481fe6d7 100644 --- a/packages/some-sass-language-server/default.nix +++ b/packages/some-sass-language-server/default.nix @@ -1,19 +1,23 @@ { + # nix build inputs lib, + buildNpmPackage, + makeWrapper, writeShellApplication, + # update script deps nodejs_latest, prefetch-npm-deps, jq, - buildNpmPackage, - makeWrapper, ... }: let - package = builtins.fromJSON (builtins.readFile ./package.json); + inherit (builtins) fromJSON readFile; + package = fromJSON (readFile ./package.json); + pname = "some-sass-language-server"; + version = package.dependencies.some-sass-language-server; in buildNpmPackage { - inherit pname; - version = package.dependencies.some-sass-language-server; + inherit pname version; src = ./.; dontNpmBuild = true; @@ -39,9 +43,14 @@ in }; meta = { - description = "Some Sass is a language server extension for Visual Studio Code and other editors with a language server protocol (LSP) client. It brings improved code suggestions, documentation and code navigation for both SCSS and indented syntaxes."; mainProgram = pname; - homepage = "https://github.com/wkillerud/some-sass"; license = with lib.licenses; [isc]; + homepage = "https://github.com/wkillerud/some-sass"; + description = '' + Some Sass is a language server extension for Visual Studio Code and + other editors with a language server protocol (LSP) client. It brings + improved code suggestions, documentation and code navigation for both + SCSS and indented syntaxes. + ''; }; } diff --git a/packages/subscleaner/default.nix b/packages/subscleaner/default.nix index 89ed6c81..cb8441c0 100644 --- a/packages/subscleaner/default.nix +++ b/packages/subscleaner/default.nix @@ -12,9 +12,13 @@ in preferWheels = true; meta = { - description = "Subscleaner is a Python script that removes advertisements from subtitle files. It's designed to help you enjoy your favorite shows and movies without the distraction of unwanted ads in the subtitles."; mainProgram = "subscleaner"; - homepage = "https://gitlab.com/rogs/subscleaner"; license = lib.licenses.gpl3Only; + homepage = "https://gitlab.com/rogs/subscleaner"; + description = '' + Subscleaner is a Python script that removes advertisements from subtitle files. + It's designed to help you enjoy your favorite shows and movies without the + distraction of unwanted ads in the subtitles. + ''; }; } diff --git a/packages/trash-d/default.nix b/packages/trash-d/default.nix index ba4c5f5f..b69d866e 100644 --- a/packages/trash-d/default.nix +++ b/packages/trash-d/default.nix @@ -1,19 +1,22 @@ { + # nix build inputs lib, + stdenv, + trash-d-src, + # deps dmd, dub, - trash-d-src, ronn, - stdenv, ... }: let inherit (builtins) fromJSON readFile; - tag = (fromJSON (readFile "${trash-d-src}/dub.json")).version; + + pname = "trash"; + version = "${tag}+${trash-d-src.shortRev}"; in stdenv.mkDerivation { - pname = "trash"; - version = "${tag}+${trash-d-src.shortRev}"; + inherit pname version; src = trash-d-src; @@ -37,15 +40,19 @@ in ronn --roff --pipe MANUAL.md > $out/man/man1/trash.1 ''; + meta = { mainProgram = "trash"; + license = with lib.licenses; [mit]; platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]; - description = "A near drop-in replacement for `rm` that uses the [FreeDesktop trash bin](https://specifications.freedesktop.org/trash-spec/trashspec-latest.html)."; homepage = "https://github.com/rushsteve1/trash-d"; - license = with lib.licenses; [mit]; + description = '' + A near drop-in replacement for `rm` that uses the + [FreeDesktop trash bin](https://specifications.freedesktop.org/trash-spec/trashspec-latest.html). + ''; }; } diff --git a/packages/urllib3/default.nix b/packages/urllib3/default.nix index 1780e00e..362b3568 100644 --- a/packages/urllib3/default.nix +++ b/packages/urllib3/default.nix @@ -1,7 +1,9 @@ # From nixpkgs 4c0061c983a2bcb888f5c478cfb7631ec1090c22 { + # nix build inputs lib, fetchPypi, + # deps python3Packages, }: python3Packages.buildPythonPackage rec { @@ -58,10 +60,12 @@ python3Packages.buildPythonPackage rec { ]; }; - meta = with lib; { - description = "Powerful, sanity-friendly HTTP client for Python"; + meta = { + license = lib.licenses.mit; homepage = "https://github.com/shazow/urllib3"; changelog = "https://github.com/urllib3/urllib3/blob/${version}/CHANGES.rst"; - license = licenses.mit; + description = '' + Powerful, sanity-friendly HTTP client for Python. + ''; }; }