From eedc1170ecf1398937065be842d8d528ddd80741 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 15 Jan 2023 04:27:42 +0000 Subject: [PATCH] fix: remove kiwix-tools patch & improve nixpatches sub-flake UX --- flake.lock | 5 +++-- flake.nix | 6 ++++++ nixpatches/flake.nix | 7 ++++--- nixpatches/list.nix | 6 ------ 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index 941ac945..529c76fd 100644 --- a/flake.lock +++ b/flake.lock @@ -56,11 +56,12 @@ "inputs": { "nixpkgs": [ "nixpkgs-unpatched" - ] + ], + "patches": [] }, "locked": { "lastModified": 1, - "narHash": "sha256-FaeqnQPm3MIXkQsNsGTB4A9lN82YKpLkmVHgdJyJNGg=", + "narHash": "sha256-9froWbTkSKX7cYSb0wh58TsftbHL0bNHay1yAW0Wiws=", "path": "nixpatches", "type": "path" }, diff --git a/flake.nix b/flake.nix index ac26eed5..3a0f6f49 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,9 @@ nixpkgs = { url = "path:nixpatches"; inputs.nixpkgs.follows = "nixpkgs-unpatched"; + # XXX: `path:` urls have poor UX in that they still get "locked" and require manual updates as if they were remote. + # by linking back to ourselves here, we can update `nixpatches/list.nix` *without* having to run `nix flake update` afterward. + inputs.patches.follows = ""; }; mobile-nixos = { # @@ -183,6 +186,9 @@ description = "python environment for data processing"; }; }; + + # unofficial output; used by inputs.nixpatches + nixpatches = import ./nixpatches/list.nix; }; } diff --git a/nixpatches/flake.nix b/nixpatches/flake.nix index 86fc9885..09957df6 100644 --- a/nixpatches/flake.nix +++ b/nixpatches/flake.nix @@ -1,13 +1,14 @@ { inputs = { - nixpkgs.url = "nixpkgs/nixos-22.11"; + nixpkgs = {}; + patches = {}; }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, patches }@inputs: let patchedPkgsFor = system: nixpkgs.legacyPackages.${system}.applyPatches { name = "nixpkgs-patched-uninsane"; src = nixpkgs; - patches = import ./list.nix { + patches = inputs.patches.nixpatches { inherit (nixpkgs.legacyPackages.${system}) fetchpatch; inherit (nixpkgs.lib) fakeHash; }; diff --git a/nixpatches/list.nix b/nixpatches/list.nix index 8b75b1a4..1d1bc801 100644 --- a/nixpatches/list.nix +++ b/nixpatches/list.nix @@ -13,12 +13,6 @@ sha256 = "sha256-t4sG+xLDaxbJ/mV5G18N4ag8EC3IXPgtN5FJGANh1Dc="; }) - # kiwix-tools: init at 3.4.0 - (fetchpatch { - url = "https://github.com/NixOS/nixpkgs/pull/206254.diff"; - sha256 = "sha256-Cendm7a23qj/YRBj5qVM8jhl9oTpztaDEkXcSG4dJys="; - }) - # whalebird: 4.6.5 -> 4.7.4 (fetchpatch { # url = "https://git.uninsane.org/colin/nixpkgs/compare/master...pr.whalebird-4.7.4.diff";