From 0b248d82ca51238c6c97bd85917be7d4852926e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 16:53:59 +0200 Subject: [PATCH 01/18] packages: create indirection --- nix/packages/default.nix | 100 +------------------------------------ nix/packages/top-level.nix | 99 ++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 98 deletions(-) create mode 100644 nix/packages/top-level.nix diff --git a/nix/packages/default.nix b/nix/packages/default.nix index 6261bded..646d5138 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -1,99 +1,3 @@ -{ - sources ? import ../sources.nix, - pkgs ? import sources.nixpkgs {}, - ... -}: let - inherit (pkgs) lib; +args: - mkHaskellPackage = { - src, - name, - apply ? lib.id, - }: let - drv = pkgs.haskellPackages.callCabal2nix name src {}; - in - lib.pipe drv [ - apply - pkgs.haskell.lib.dontHaddock - pkgs.haskell.lib.justStaticExecutables - ]; - - infuse-lib = import sources.infuse { - inherit lib; - sugars = infuse-lib.v1.default-sugars; - }; - - infuse = lib.flip infuse-lib.v1.infuse; - - iosevka-pin = import sources.pin-iosevka {}; - mkNerdFont = iosevka-pin.callPackage ../lib/mkNerdFont.nix {}; -in rec { - # fonts - altiosevka = iosevka-pin.callPackage ./altiosevka {}; - altiosevka-nerd-font-mono = mkNerdFont { - font = altiosevka; - extraArgs = [ - "--name {/.}-NFM" - "--use-single-width-glyphs" - ]; - }; - # static version of noto-fonts cjk serif - noto-fonts-cjk-serif' = pkgs.callPackage ./noto-fonts-cjk-serif.nix {}; - - necrolib = pkgs.callPackage ./necrolib.nix {}; - - maeel = pkgs.callPackage ./maeel.nix {}; - tokei = pkgs.callPackage ./tokei {}; # alpha tokei with typst, skel, hledger - typst-mutilate = pkgs.callPackage ./typst-mutilate.nix {}; - webtoon_downloader = pkgs.callPackage ./webtoon_downloader.nix {}; - - xbrightness = pkgs.callPackage ./xbrightness.nix {}; - ffgun = pkgs.callPackage ./ffgun.nix {}; - easyscan = pkgs.callPackage ./easyscan.nix {}; - - baguette-sharp = pkgs.callPackage ./baguette-sharp.nix {}; - - # TODO: remove when channel update - ltex-ls-plus = pkgs.callPackage ./ltex-ls-plus.nix {}; - - # my repositories - hbrainfuck = mkHaskellPackage { - name = "hbrainfuck"; - src = sources.hbrainfuck; - apply = infuse { - __output.nativeBuildInputs.__append = [pkgs.installShellFiles]; - __output.postInstall.__append = '' - installShellCompletion --cmd hbrainfuck \ - --bash <("$out/bin/hbrainfuck" --bash-completion-script "$out/bin/hbrainfuck") \ - --fish <("$out/bin/hbrainfuck" --fish-completion-script "$out/bin/hbrainfuck") \ - --zsh <("$out/bin/hbrainfuck" --zsh-completion-script "$out/bin/hbrainfuck") - ''; - }; - }; - - prop-solveur = mkHaskellPackage { - name = "prop-solveur"; - src = sources.prop_solveur; - apply = infuse { - __output.nativeBuildInputs.__append = [pkgs.installShellFiles]; - __output.postInstall.__append = '' - installShellCompletion --cmd prop-solveur \ - --bash <("$out/bin/prop-solveur" --bash-completion-script "$out/bin/prop-solveur") \ - --fish <("$out/bin/prop-solveur" --fish-completion-script "$out/bin/prop-solveur") \ - --zsh <("$out/bin/prop-solveur" --zsh-completion-script "$out/bin/prop-solveur") - ''; - }; - }; - - hutils = mkHaskellPackage { - name = "hutils"; - src = sources.hutils; - }; - - audio-lint = pkgs.rustPlatform.buildRustPackage rec { - pname = "audio-lint"; - version = lib.substring 0 8 sources.audio-lint.rev; - src = sources.audio-lint; - cargoLock.lockFile = "${src}/Cargo.lock"; - }; -} +import ./top-level.nix args diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix new file mode 100644 index 00000000..6261bded --- /dev/null +++ b/nix/packages/top-level.nix @@ -0,0 +1,99 @@ +{ + sources ? import ../sources.nix, + pkgs ? import sources.nixpkgs {}, + ... +}: let + inherit (pkgs) lib; + + mkHaskellPackage = { + src, + name, + apply ? lib.id, + }: let + drv = pkgs.haskellPackages.callCabal2nix name src {}; + in + lib.pipe drv [ + apply + pkgs.haskell.lib.dontHaddock + pkgs.haskell.lib.justStaticExecutables + ]; + + infuse-lib = import sources.infuse { + inherit lib; + sugars = infuse-lib.v1.default-sugars; + }; + + infuse = lib.flip infuse-lib.v1.infuse; + + iosevka-pin = import sources.pin-iosevka {}; + mkNerdFont = iosevka-pin.callPackage ../lib/mkNerdFont.nix {}; +in rec { + # fonts + altiosevka = iosevka-pin.callPackage ./altiosevka {}; + altiosevka-nerd-font-mono = mkNerdFont { + font = altiosevka; + extraArgs = [ + "--name {/.}-NFM" + "--use-single-width-glyphs" + ]; + }; + # static version of noto-fonts cjk serif + noto-fonts-cjk-serif' = pkgs.callPackage ./noto-fonts-cjk-serif.nix {}; + + necrolib = pkgs.callPackage ./necrolib.nix {}; + + maeel = pkgs.callPackage ./maeel.nix {}; + tokei = pkgs.callPackage ./tokei {}; # alpha tokei with typst, skel, hledger + typst-mutilate = pkgs.callPackage ./typst-mutilate.nix {}; + webtoon_downloader = pkgs.callPackage ./webtoon_downloader.nix {}; + + xbrightness = pkgs.callPackage ./xbrightness.nix {}; + ffgun = pkgs.callPackage ./ffgun.nix {}; + easyscan = pkgs.callPackage ./easyscan.nix {}; + + baguette-sharp = pkgs.callPackage ./baguette-sharp.nix {}; + + # TODO: remove when channel update + ltex-ls-plus = pkgs.callPackage ./ltex-ls-plus.nix {}; + + # my repositories + hbrainfuck = mkHaskellPackage { + name = "hbrainfuck"; + src = sources.hbrainfuck; + apply = infuse { + __output.nativeBuildInputs.__append = [pkgs.installShellFiles]; + __output.postInstall.__append = '' + installShellCompletion --cmd hbrainfuck \ + --bash <("$out/bin/hbrainfuck" --bash-completion-script "$out/bin/hbrainfuck") \ + --fish <("$out/bin/hbrainfuck" --fish-completion-script "$out/bin/hbrainfuck") \ + --zsh <("$out/bin/hbrainfuck" --zsh-completion-script "$out/bin/hbrainfuck") + ''; + }; + }; + + prop-solveur = mkHaskellPackage { + name = "prop-solveur"; + src = sources.prop_solveur; + apply = infuse { + __output.nativeBuildInputs.__append = [pkgs.installShellFiles]; + __output.postInstall.__append = '' + installShellCompletion --cmd prop-solveur \ + --bash <("$out/bin/prop-solveur" --bash-completion-script "$out/bin/prop-solveur") \ + --fish <("$out/bin/prop-solveur" --fish-completion-script "$out/bin/prop-solveur") \ + --zsh <("$out/bin/prop-solveur" --zsh-completion-script "$out/bin/prop-solveur") + ''; + }; + }; + + hutils = mkHaskellPackage { + name = "hutils"; + src = sources.hutils; + }; + + audio-lint = pkgs.rustPlatform.buildRustPackage rec { + pname = "audio-lint"; + version = lib.substring 0 8 sources.audio-lint.rev; + src = sources.audio-lint; + cargoLock.lockFile = "${src}/Cargo.lock"; + }; +} From bd9049f90a808ede1c50101942e2c4fb1e800b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:02:16 +0200 Subject: [PATCH 02/18] packages: create by-name system --- nix/packages/by-name.nix | 11 +++++++++++ nix/packages/default.nix | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 nix/packages/by-name.nix diff --git a/nix/packages/by-name.nix b/nix/packages/by-name.nix new file mode 100644 index 00000000..04883288 --- /dev/null +++ b/nix/packages/by-name.nix @@ -0,0 +1,11 @@ +{ + sources ? import ../sources.nix, + pkgs ? import sources.nixpkgs {}, +}: let + inherit (pkgs) lib; +in + lib.mapAttrs + (name: _: pkgs.callPackage (./by-name + "/${name}/package.nix") {}) + ( + lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./by-name) + ) diff --git a/nix/packages/default.nix b/nix/packages/default.nix index 646d5138..49124173 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -1,3 +1,3 @@ args: - import ./top-level.nix args +// import ./by-name.nix args From 254dce933bac32896b7b948d52756c557ca28ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:05:59 +0200 Subject: [PATCH 03/18] tokei: migrate to by-name --- nix/packages/{tokei/default.nix => by-name/tokei/package.nix} | 0 nix/packages/{ => by-name}/tokei/skel.patch | 0 nix/packages/{ => by-name}/tokei/why3.patch | 0 nix/packages/top-level.nix | 1 - 4 files changed, 1 deletion(-) rename nix/packages/{tokei/default.nix => by-name/tokei/package.nix} (100%) rename nix/packages/{ => by-name}/tokei/skel.patch (100%) rename nix/packages/{ => by-name}/tokei/why3.patch (100%) diff --git a/nix/packages/tokei/default.nix b/nix/packages/by-name/tokei/package.nix similarity index 100% rename from nix/packages/tokei/default.nix rename to nix/packages/by-name/tokei/package.nix diff --git a/nix/packages/tokei/skel.patch b/nix/packages/by-name/tokei/skel.patch similarity index 100% rename from nix/packages/tokei/skel.patch rename to nix/packages/by-name/tokei/skel.patch diff --git a/nix/packages/tokei/why3.patch b/nix/packages/by-name/tokei/why3.patch similarity index 100% rename from nix/packages/tokei/why3.patch rename to nix/packages/by-name/tokei/why3.patch diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 6261bded..af3954ba 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -43,7 +43,6 @@ in rec { necrolib = pkgs.callPackage ./necrolib.nix {}; maeel = pkgs.callPackage ./maeel.nix {}; - tokei = pkgs.callPackage ./tokei {}; # alpha tokei with typst, skel, hledger typst-mutilate = pkgs.callPackage ./typst-mutilate.nix {}; webtoon_downloader = pkgs.callPackage ./webtoon_downloader.nix {}; From c7012e7cb63f26d798e4f1979ce64d9521088d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:06:51 +0200 Subject: [PATCH 04/18] necrolib: migrate to by-name --- nix/packages/{necrolib.nix => by-name/necrolib/package.nix} | 0 nix/packages/top-level.nix | 2 -- 2 files changed, 2 deletions(-) rename nix/packages/{necrolib.nix => by-name/necrolib/package.nix} (100%) diff --git a/nix/packages/necrolib.nix b/nix/packages/by-name/necrolib/package.nix similarity index 100% rename from nix/packages/necrolib.nix rename to nix/packages/by-name/necrolib/package.nix diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index af3954ba..4889f8aa 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -40,8 +40,6 @@ in rec { # static version of noto-fonts cjk serif noto-fonts-cjk-serif' = pkgs.callPackage ./noto-fonts-cjk-serif.nix {}; - necrolib = pkgs.callPackage ./necrolib.nix {}; - maeel = pkgs.callPackage ./maeel.nix {}; typst-mutilate = pkgs.callPackage ./typst-mutilate.nix {}; webtoon_downloader = pkgs.callPackage ./webtoon_downloader.nix {}; From cd080548a7e270ce53d1d81372a94734c71af636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:07:46 +0200 Subject: [PATCH 05/18] noto-fonts-cjk-serif': migrate to by-name --- .../noto-fonts-cjk-serif'/package.nix} | 1 + nix/packages/top-level.nix | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) rename nix/packages/{noto-fonts-cjk-serif.nix => by-name/noto-fonts-cjk-serif'/package.nix} (91%) diff --git a/nix/packages/noto-fonts-cjk-serif.nix b/nix/packages/by-name/noto-fonts-cjk-serif'/package.nix similarity index 91% rename from nix/packages/noto-fonts-cjk-serif.nix rename to nix/packages/by-name/noto-fonts-cjk-serif'/package.nix index 1da4ac2c..4fa774b8 100644 --- a/nix/packages/noto-fonts-cjk-serif.nix +++ b/nix/packages/by-name/noto-fonts-cjk-serif'/package.nix @@ -1,3 +1,4 @@ +# static version of noto-fonts cjk serif { stdenvNoCC, fetchFromGitHub, diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 4889f8aa..e9f74b01 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -37,8 +37,6 @@ in rec { "--use-single-width-glyphs" ]; }; - # static version of noto-fonts cjk serif - noto-fonts-cjk-serif' = pkgs.callPackage ./noto-fonts-cjk-serif.nix {}; maeel = pkgs.callPackage ./maeel.nix {}; typst-mutilate = pkgs.callPackage ./typst-mutilate.nix {}; From 4f91815f5f482c64a23905c5102c8b0f3b5081eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:08:14 +0200 Subject: [PATCH 06/18] maeel: migrate to by-name --- nix/packages/{maeel.nix => by-name/maeel/package.nix} | 0 nix/packages/top-level.nix | 1 - 2 files changed, 1 deletion(-) rename nix/packages/{maeel.nix => by-name/maeel/package.nix} (100%) diff --git a/nix/packages/maeel.nix b/nix/packages/by-name/maeel/package.nix similarity index 100% rename from nix/packages/maeel.nix rename to nix/packages/by-name/maeel/package.nix diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index e9f74b01..bf3d6547 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -38,7 +38,6 @@ in rec { ]; }; - maeel = pkgs.callPackage ./maeel.nix {}; typst-mutilate = pkgs.callPackage ./typst-mutilate.nix {}; webtoon_downloader = pkgs.callPackage ./webtoon_downloader.nix {}; From c8aa9c7834cac63a13d2e0d8f2fab55938477e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:08:57 +0200 Subject: [PATCH 07/18] baguette-sharp: migrate to by-name --- .../{baguette-sharp.nix => by-name/baguette-sharp/package.nix} | 0 nix/packages/top-level.nix | 2 -- 2 files changed, 2 deletions(-) rename nix/packages/{baguette-sharp.nix => by-name/baguette-sharp/package.nix} (100%) diff --git a/nix/packages/baguette-sharp.nix b/nix/packages/by-name/baguette-sharp/package.nix similarity index 100% rename from nix/packages/baguette-sharp.nix rename to nix/packages/by-name/baguette-sharp/package.nix diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index bf3d6547..1a75204c 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -45,8 +45,6 @@ in rec { ffgun = pkgs.callPackage ./ffgun.nix {}; easyscan = pkgs.callPackage ./easyscan.nix {}; - baguette-sharp = pkgs.callPackage ./baguette-sharp.nix {}; - # TODO: remove when channel update ltex-ls-plus = pkgs.callPackage ./ltex-ls-plus.nix {}; From d9ec2e805c6467684cc4e957fdce6a8d24f3bc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:09:24 +0200 Subject: [PATCH 08/18] webtoon_downloader: migrate to by-name --- .../webtoon_downloader/package.nix} | 0 nix/packages/top-level.nix | 1 - 2 files changed, 1 deletion(-) rename nix/packages/{webtoon_downloader.nix => by-name/webtoon_downloader/package.nix} (100%) diff --git a/nix/packages/webtoon_downloader.nix b/nix/packages/by-name/webtoon_downloader/package.nix similarity index 100% rename from nix/packages/webtoon_downloader.nix rename to nix/packages/by-name/webtoon_downloader/package.nix diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 1a75204c..663d9d2b 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -39,7 +39,6 @@ in rec { }; typst-mutilate = pkgs.callPackage ./typst-mutilate.nix {}; - webtoon_downloader = pkgs.callPackage ./webtoon_downloader.nix {}; xbrightness = pkgs.callPackage ./xbrightness.nix {}; ffgun = pkgs.callPackage ./ffgun.nix {}; From e238e5f49baa84349b1893ded35c5316242c48ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:10:17 +0200 Subject: [PATCH 09/18] typst-mutilate: migrate to by-name --- .../{typst-mutilate.nix => by-name/typst-mutilate/package.nix} | 0 nix/packages/top-level.nix | 2 -- 2 files changed, 2 deletions(-) rename nix/packages/{typst-mutilate.nix => by-name/typst-mutilate/package.nix} (100%) diff --git a/nix/packages/typst-mutilate.nix b/nix/packages/by-name/typst-mutilate/package.nix similarity index 100% rename from nix/packages/typst-mutilate.nix rename to nix/packages/by-name/typst-mutilate/package.nix diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 663d9d2b..f30cea5e 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -38,8 +38,6 @@ in rec { ]; }; - typst-mutilate = pkgs.callPackage ./typst-mutilate.nix {}; - xbrightness = pkgs.callPackage ./xbrightness.nix {}; ffgun = pkgs.callPackage ./ffgun.nix {}; easyscan = pkgs.callPackage ./easyscan.nix {}; From e8d40e36ed6f90e8281206715853e7e9d1a08af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:10:37 +0200 Subject: [PATCH 10/18] easyscan: migrate to by-name --- nix/packages/{easyscan.nix => by-name/easyscan/package.nix} | 0 nix/packages/top-level.nix | 1 - 2 files changed, 1 deletion(-) rename nix/packages/{easyscan.nix => by-name/easyscan/package.nix} (100%) diff --git a/nix/packages/easyscan.nix b/nix/packages/by-name/easyscan/package.nix similarity index 100% rename from nix/packages/easyscan.nix rename to nix/packages/by-name/easyscan/package.nix diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index f30cea5e..b81e103f 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -40,7 +40,6 @@ in rec { xbrightness = pkgs.callPackage ./xbrightness.nix {}; ffgun = pkgs.callPackage ./ffgun.nix {}; - easyscan = pkgs.callPackage ./easyscan.nix {}; # TODO: remove when channel update ltex-ls-plus = pkgs.callPackage ./ltex-ls-plus.nix {}; From a67f69e126040a4edc196ead98f11e501f1923f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:14:38 +0200 Subject: [PATCH 11/18] xbrightness: migrate to by-name --- .../{xbrightness.nix => by-name/xbrightness/package.nix} | 0 nix/packages/top-level.nix | 1 - 2 files changed, 1 deletion(-) rename nix/packages/{xbrightness.nix => by-name/xbrightness/package.nix} (100%) diff --git a/nix/packages/xbrightness.nix b/nix/packages/by-name/xbrightness/package.nix similarity index 100% rename from nix/packages/xbrightness.nix rename to nix/packages/by-name/xbrightness/package.nix diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index b81e103f..f539af63 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -38,7 +38,6 @@ in rec { ]; }; - xbrightness = pkgs.callPackage ./xbrightness.nix {}; ffgun = pkgs.callPackage ./ffgun.nix {}; # TODO: remove when channel update From f928058457c16045e2bf07c23a38783773a4d592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:14:47 +0200 Subject: [PATCH 12/18] ffgun: migrate to by-name --- nix/packages/{ffgun.nix => by-name/ffgun/package.nix} | 0 nix/packages/top-level.nix | 2 -- 2 files changed, 2 deletions(-) rename nix/packages/{ffgun.nix => by-name/ffgun/package.nix} (100%) diff --git a/nix/packages/ffgun.nix b/nix/packages/by-name/ffgun/package.nix similarity index 100% rename from nix/packages/ffgun.nix rename to nix/packages/by-name/ffgun/package.nix diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index f539af63..c96e48eb 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -38,8 +38,6 @@ in rec { ]; }; - ffgun = pkgs.callPackage ./ffgun.nix {}; - # TODO: remove when channel update ltex-ls-plus = pkgs.callPackage ./ltex-ls-plus.nix {}; From 2cc3e6e0fd76b275581c8defe26cf6d12402ce50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:15:45 +0200 Subject: [PATCH 13/18] ltex-ls-plus: migrate to by-name --- .../{ltex-ls-plus.nix => by-name/ltex-ls-plus/package.nix} | 0 nix/packages/top-level.nix | 3 --- 2 files changed, 3 deletions(-) rename nix/packages/{ltex-ls-plus.nix => by-name/ltex-ls-plus/package.nix} (100%) diff --git a/nix/packages/ltex-ls-plus.nix b/nix/packages/by-name/ltex-ls-plus/package.nix similarity index 100% rename from nix/packages/ltex-ls-plus.nix rename to nix/packages/by-name/ltex-ls-plus/package.nix diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index c96e48eb..8fb9cfe8 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -38,9 +38,6 @@ in rec { ]; }; - # TODO: remove when channel update - ltex-ls-plus = pkgs.callPackage ./ltex-ls-plus.nix {}; - # my repositories hbrainfuck = mkHaskellPackage { name = "hbrainfuck"; From e17698a07d0f74679bab831c10409fd07c21e889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:27:18 +0200 Subject: [PATCH 14/18] hbrainfuck: migrate to by-name --- nix/packages/by-name/hbrainfuck/package.nix | 33 +++++++++++++++++++++ nix/packages/top-level.nix | 15 ---------- 2 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 nix/packages/by-name/hbrainfuck/package.nix diff --git a/nix/packages/by-name/hbrainfuck/package.nix b/nix/packages/by-name/hbrainfuck/package.nix new file mode 100644 index 00000000..0e8f9204 --- /dev/null +++ b/nix/packages/by-name/hbrainfuck/package.nix @@ -0,0 +1,33 @@ +{ + haskellPackages, + haskell, + fetchFromGitea, + installShellFiles, +}: let + inherit (haskell.lib.compose) justStaticExecutables overrideCabal; + + drv = + haskellPackages.callCabal2nix "hbrainfuck" + (fetchFromGitea { + domain = "git.confusedcompiler.org"; + owner = "leana8959"; + repo = "hbrainfuck"; + rev = "796aae9bdb222e8e0431627eb11a3e3a71c1ffef"; + hash = "sha256-4OQ//QGzuPeOe1Zi9IjttUu4vLKufPCWXJzBk9v5zXc="; + }) + {}; + + cabalOverrides = o: { + buildTools = o.buildTools or [] ++ [installShellFiles]; + postInstall = + o.postInstall or "" + + '' + installShellCompletion --cmd hbrainfuck \ + --bash <("$out/bin/hbf" --bash-completion-script "$out/bin/hbf") \ + --fish <("$out/bin/hbf" --fish-completion-script "$out/bin/hbf") \ + --zsh <("$out/bin/hbf" --zsh-completion-script "$out/bin/hbf") + ''; + }; +in + justStaticExecutables + (overrideCabal cabalOverrides drv) diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 8fb9cfe8..22c34116 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -38,21 +38,6 @@ in rec { ]; }; - # my repositories - hbrainfuck = mkHaskellPackage { - name = "hbrainfuck"; - src = sources.hbrainfuck; - apply = infuse { - __output.nativeBuildInputs.__append = [pkgs.installShellFiles]; - __output.postInstall.__append = '' - installShellCompletion --cmd hbrainfuck \ - --bash <("$out/bin/hbrainfuck" --bash-completion-script "$out/bin/hbrainfuck") \ - --fish <("$out/bin/hbrainfuck" --fish-completion-script "$out/bin/hbrainfuck") \ - --zsh <("$out/bin/hbrainfuck" --zsh-completion-script "$out/bin/hbrainfuck") - ''; - }; - }; - prop-solveur = mkHaskellPackage { name = "prop-solveur"; src = sources.prop_solveur; From 53378b51a430f917a848ce541d94bfcfc0f7e134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:30:00 +0200 Subject: [PATCH 15/18] hutils: migrate to by-name --- nix/packages/by-name/hutils/package.nix | 19 +++++++++++++++++++ nix/packages/top-level.nix | 5 ----- 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 nix/packages/by-name/hutils/package.nix diff --git a/nix/packages/by-name/hutils/package.nix b/nix/packages/by-name/hutils/package.nix new file mode 100644 index 00000000..547c3ab3 --- /dev/null +++ b/nix/packages/by-name/hutils/package.nix @@ -0,0 +1,19 @@ +{ + haskellPackages, + haskell, + fetchFromGitea, +}: let + inherit (haskell.lib.compose) justStaticExecutables; + + drv = + haskellPackages.callCabal2nix "hutils" + (fetchFromGitea { + domain = "git.confusedcompiler.org"; + owner = "leana8959"; + repo = "hutils"; + rev = "ee04ec425af81e762362bc2c4bcd5d89ad50ddc8"; + hash = "sha256-e22agWHNftl7zlXnPpzNyE3iJKPHxcE7tH1XRYfG+4Q="; + }) + {}; +in + justStaticExecutables drv diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 22c34116..0380fc96 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -52,11 +52,6 @@ in rec { }; }; - hutils = mkHaskellPackage { - name = "hutils"; - src = sources.hutils; - }; - audio-lint = pkgs.rustPlatform.buildRustPackage rec { pname = "audio-lint"; version = lib.substring 0 8 sources.audio-lint.rev; From 5a34373cca022ab37ec05da678a5debb655228a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:32:13 +0200 Subject: [PATCH 16/18] prop-solveur: migrate to by-name --- nix/packages/by-name/prop-solveur/package.nix | 33 +++++++++++++++++++ nix/packages/top-level.nix | 14 -------- 2 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 nix/packages/by-name/prop-solveur/package.nix diff --git a/nix/packages/by-name/prop-solveur/package.nix b/nix/packages/by-name/prop-solveur/package.nix new file mode 100644 index 00000000..c9200357 --- /dev/null +++ b/nix/packages/by-name/prop-solveur/package.nix @@ -0,0 +1,33 @@ +{ + haskellPackages, + haskell, + fetchFromGitea, + installShellFiles, +}: let + inherit (haskell.lib.compose) justStaticExecutables overrideCabal; + + drv = + haskellPackages.callCabal2nix "prop-solveur" + (fetchFromGitea { + domain = "git.confusedcompiler.org"; + owner = "leana8959"; + repo = "prop_solveur"; + rev = "cc2430dc5a396b01d02bd925070ce5d009d05bc4"; + hash = "sha256-jwNfRBytf/w0d2CWczXp+rVRXYNzptkuFE3OKSdOhLc="; + }) + {}; + + cabalOverrides = o: { + buildTools = o.buildTools or [] ++ [installShellFiles]; + postInstall = + o.postInstall or "" + + '' + installShellCompletion --cmd prop-solveur \ + --bash <("$out/bin/prop-solveur" --bash-completion-script "$out/bin/prop-solveur") \ + --fish <("$out/bin/prop-solveur" --fish-completion-script "$out/bin/prop-solveur") \ + --zsh <("$out/bin/prop-solveur" --zsh-completion-script "$out/bin/prop-solveur") + ''; + }; +in + justStaticExecutables + (overrideCabal cabalOverrides drv) diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 0380fc96..19215c1f 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -38,20 +38,6 @@ in rec { ]; }; - prop-solveur = mkHaskellPackage { - name = "prop-solveur"; - src = sources.prop_solveur; - apply = infuse { - __output.nativeBuildInputs.__append = [pkgs.installShellFiles]; - __output.postInstall.__append = '' - installShellCompletion --cmd prop-solveur \ - --bash <("$out/bin/prop-solveur" --bash-completion-script "$out/bin/prop-solveur") \ - --fish <("$out/bin/prop-solveur" --fish-completion-script "$out/bin/prop-solveur") \ - --zsh <("$out/bin/prop-solveur" --zsh-completion-script "$out/bin/prop-solveur") - ''; - }; - }; - audio-lint = pkgs.rustPlatform.buildRustPackage rec { pname = "audio-lint"; version = lib.substring 0 8 sources.audio-lint.rev; From 0ef714129a963c94b07fea2d0766a3d98b16af2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:35:28 +0200 Subject: [PATCH 17/18] audio-lint: migrate to by-name --- nix/packages/by-name/audio-lint/package.nix | 19 +++++++++++++++++++ nix/packages/top-level.nix | 7 ------- 2 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 nix/packages/by-name/audio-lint/package.nix diff --git a/nix/packages/by-name/audio-lint/package.nix b/nix/packages/by-name/audio-lint/package.nix new file mode 100644 index 00000000..117c8185 --- /dev/null +++ b/nix/packages/by-name/audio-lint/package.nix @@ -0,0 +1,19 @@ +{ + lib, + rustPlatform, + fetchFromGitea, +}: +rustPlatform.buildRustPackage (finalAttrs: { + name = "audio-lint"; + version = lib.substring 0 8 finalAttrs.src.rev; + + src = fetchFromGitea { + domain = "git.confusedcompiler.org"; + owner = "leana8959"; + repo = "audio-lint"; + rev = "3ea38c85c5f6135958e51ad4ff13a96ccd68a21c"; + hash = "sha256-h1SnWAh3FPL5GweOXVXXtp+swZApgecYaWjy7rM/J+w="; + }; + + cargoHash = "sha256-hsFUeGPvo3n6/Z35ui3N4qefa4odM0yo1rVBhzL3fLU="; +}) diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index 19215c1f..bea7312a 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -37,11 +37,4 @@ in rec { "--use-single-width-glyphs" ]; }; - - audio-lint = pkgs.rustPlatform.buildRustPackage rec { - pname = "audio-lint"; - version = lib.substring 0 8 sources.audio-lint.rev; - src = sources.audio-lint; - cargoLock.lockFile = "${src}/Cargo.lock"; - }; } From dcb2efd91b2f054221fcb53ffa99f4eca476a3e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Tue, 20 May 2025 17:36:04 +0200 Subject: [PATCH 18/18] packages: remove unused binding --- nix/packages/top-level.nix | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix index bea7312a..a7af20ea 100644 --- a/nix/packages/top-level.nix +++ b/nix/packages/top-level.nix @@ -3,28 +3,6 @@ pkgs ? import sources.nixpkgs {}, ... }: let - inherit (pkgs) lib; - - mkHaskellPackage = { - src, - name, - apply ? lib.id, - }: let - drv = pkgs.haskellPackages.callCabal2nix name src {}; - in - lib.pipe drv [ - apply - pkgs.haskell.lib.dontHaddock - pkgs.haskell.lib.justStaticExecutables - ]; - - infuse-lib = import sources.infuse { - inherit lib; - sugars = infuse-lib.v1.default-sugars; - }; - - infuse = lib.flip infuse-lib.v1.infuse; - iosevka-pin = import sources.pin-iosevka {}; mkNerdFont = iosevka-pin.callPackage ../lib/mkNerdFont.nix {}; in rec {