Skip to content

Commit f41294c

Browse files
drop nixpkgs patching from flake-parts-module example
1 parent ea46fc5 commit f41294c

2 files changed

Lines changed: 3 additions & 25 deletions

File tree

examples/flake-parts-module/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ can work seamlessly within the flake-parts ecosystem.
1111

1212
| FUP feature | flake-parts module equivalent |
1313
|---|---|
14-
| `channels` | `fup.channels` — declare multiple nixpkgs inputs with per-channel config, overlays, source patches |
14+
| `channels` | `fup.channels` — declare multiple nixpkgs inputs with per-channel config and overlays |
1515
| `sharedOverlays` | `fup.sharedOverlays` — overlays applied to every channel |
1616
| `hosts` / `hostDefaults` | `fup.hosts` — reverse-DNS hostnames, builder dispatch (NixOS/darwin) |
1717
| `nix.generateRegistryFromInputs` | `fup.autoRegistry` / `fup.autoNixPath` |

examples/flake-parts-module/fup-module.nix

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,6 @@ let
1616
# Helpers
1717
# ---------------------------------------------------------------------------
1818

19-
# Apply patches to a nixpkgs source tree. Same approach as FUP.
20-
patchNixpkgs = system: channelInput: patches:
21-
if patches == [ ] then channelInput
22-
else
23-
let
24-
bootstrapPkgs = import channelInput { inherit system; };
25-
patchedSrc = bootstrapPkgs.applyPatches {
26-
name = "nixpkgs-patched";
27-
src = channelInput;
28-
inherit patches;
29-
};
30-
in
31-
toString patchedSrc;
32-
3319
# Detect whether an input looks like nixpkgs (has x86_64-linux nix).
3420
isNixpkgsLike = name: value:
3521
value ? legacyPackages
@@ -110,11 +96,6 @@ in
11096
Receives every channel's evaluated pkgs for cross-channel references.
11197
'';
11298
};
113-
patches = mkOption {
114-
type = types.listOf types.path;
115-
default = [ ];
116-
description = "Patches to apply to nixpkgs source before importing.";
117-
};
11899
};
119100
});
120101
default = { };
@@ -236,10 +217,7 @@ in
236217
allPkgs = mapAttrs
237218
(name: ch:
238219
let
239-
src =
240-
if ch.patches == [ ] then ch.input
241-
else patchNixpkgs system ch.input ch.patches;
242-
pkgs = import src {
220+
pkgs = import ch.input {
243221
inherit system;
244222
overlays = cfg.sharedOverlays
245223
++ (if ch.overlaysBuilder != null
@@ -248,7 +226,7 @@ in
248226
config = cfg.channelsConfig // ch.config;
249227
};
250228
in
251-
pkgs // { inherit (ch) input patches; }
229+
pkgs // { inherit (ch) input; }
252230
)
253231
allChannels;
254232
in

0 commit comments

Comments
 (0)