File tree Expand file tree Collapse file tree
examples/flake-parts-module Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ` |
Original file line number Diff line number Diff line change 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
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 = { } ;
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
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
You can’t perform that action at this time.
0 commit comments