diff options
Diffstat (limited to 'pkgs/by-name')
-rw-r--r-- | pkgs/by-name/README.md | 16 | ||||
-rw-r--r-- | pkgs/by-name/qu/quicktype/package.nix | 31 | ||||
-rw-r--r-- | pkgs/by-name/sl/sleek-grub-theme/package.nix | 39 |
3 files changed, 86 insertions, 0 deletions
diff --git a/pkgs/by-name/README.md b/pkgs/by-name/README.md index fbdcfd7ecb7..ba1bd8cb986 100644 --- a/pkgs/by-name/README.md +++ b/pkgs/by-name/README.md @@ -72,6 +72,22 @@ libfoo = callPackage ../by-name/so/some-package/package.nix { }; ``` +## Manual migration guidelines + +Most packages are still defined in `all-packages.nix` and the [category hierarchy](../README.md#category-hierarchy). +Please hold off migrating your maintained packages to this directory. + +1. An automated migration for the majority of packages [is being worked on](https://github.com/NixOS/nixpkgs/pull/211832). + In order to save on contributor and reviewer time, packages should only be migrated manually afterwards if they couldn't be migrated automatically. + +1. Manual migrations should only be lightly encouraged if the relevant code is being worked on anyways. + For example with a package update or refactoring. + +1. Manual migrations should not remove definitions from `all-packages.nix` with custom arguments. + That is a backwards-incompatible change because it changes the `.override` interface. + Such packages may still be moved to `pkgs/by-name` however, while keeping the definition in `all-packages.nix`. + See also [changing implicit attribute defaults](#changing-implicit-attribute-defaults). + ## Limitations There's some limitations as to which packages can be defined using this structure: diff --git a/pkgs/by-name/qu/quicktype/package.nix b/pkgs/by-name/qu/quicktype/package.nix new file mode 100644 index 00000000000..20ce7b39fb3 --- /dev/null +++ b/pkgs/by-name/qu/quicktype/package.nix @@ -0,0 +1,31 @@ +{ lib, buildNpmPackage, fetchFromGitHub, jq }: + +buildNpmPackage rec { + pname = "quicktype"; + version = "23.0.75"; # version from https://npm.im/quicktype + + src = fetchFromGitHub { + owner = "quicktype"; + repo = "quicktype"; + rev = "9b570a73a896306778940c793c0037a38815304a"; # version not tagged + hash = "sha256-boCBgIoM2GECipZTJlp9IaeXT24aR8tawS1X8CFDDqw="; + }; + + postPatch = '' + cat <<< $(${jq}/bin/jq '.version = "${version}"' package.json) > package.json + ''; + + npmDepsHash = "sha256-RA4HVQfB/ge1aIKl9HiUT7vUM5n+Ro6N2D6xj1dgSu8="; + + postInstall = '' + mv packages/ $out/lib/node_modules/quicktype/ + ''; + + meta = with lib; { + description = "Generate types and converters from JSON, Schema, and GraphQL"; + homepage = "https://quicktype.io/"; + license = licenses.asl20; + maintainers = [ maintainers.marsam ]; + mainProgram = "quicktype"; + }; +} diff --git a/pkgs/by-name/sl/sleek-grub-theme/package.nix b/pkgs/by-name/sl/sleek-grub-theme/package.nix new file mode 100644 index 00000000000..efeb01e4d81 --- /dev/null +++ b/pkgs/by-name/sl/sleek-grub-theme/package.nix @@ -0,0 +1,39 @@ +{ lib +, stdenv +, fetchFromGitHub +, withBanner ? "Grub Bootloader" # use override to specify your own banner text +, withStyle ? "white" # use override to specify one of "dark" / "orange" / "bigSur" +}: + +assert builtins.any (s: withStyle == s) ["white" "dark" "orange" "bigSur"]; + +stdenv.mkDerivation { + pname = "sleek-grub-theme"; + version = "unstable-2022-06-04"; + + src = fetchFromGitHub ({ + owner = "sandesh236"; + repo = "sleek--themes"; + rev = "981326a8e35985dc23f1b066fdbe66ff09df2371"; + hash = "sha256-yD4JuoFGTXE/aI76EtP4rEWCc5UdFGi7Ojys6Yp8Z58="; + }); + + installPhase = '' + runHook preInstall + + mkdir -p $out/ + + cp -r 'Sleek theme-${withStyle}'/sleek/* $out/ + sed -i "s/Grub Bootloader/${withBanner}/" $out/theme.txt + + runHook postInstall + ''; + + meta = { + description = "Grub bootloader themes, contains light/dark/orange/bigSur styles"; + homepage = "https://github.com/sandesh236/sleek--themes"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ luochen1990 ]; + }; +} |