Skip to content

a small flake that allows adding patches to nixpkgs conditionally

Notifications You must be signed in to change notification settings

mgit-at/patches4nixpkgs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

patches4nixpkgs

a small flake that allows adding patches to nixpkgs conditionally

Usage:

Add this to each flake

{
  patches4nixpkgs = nixpkgs: [
    [(condition) ./patch-file.patch]
  ];
}

e.g.:

{
  patches4nixpkgs = nixpkgs: [
    [(! builtins.pathExists "${nixpkgs}/my-file") ./add-my-file.patch]
  ];
}

Then patch nixpkgs

{
  inputs.nixpkgs...

  outputs = { self, flake, other-flake, ... }@inputs: {

  let
    patchPkgs = patches4nixpkgs.patch inputs.nixpkgs [
      flake
      other-flake
      self
    ];
    nixpkgs = patches4nixpkgs.eval patchPkgs; # evaluate flake.nix like it wasn't patched
  in
  {
    ...
  };
}

About

a small flake that allows adding patches to nixpkgs conditionally

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages