Nixpkgs/Patching Nixpkgs: Difference between revisions

m Fix indenting in code example
m fix indent of example code
(One intermediate revision by one other user not shown)
Line 16: Line 16:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
inputs = {
inputs = {
    # ...
  # ...
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
  nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
    # ...
  # ...
};
};
</syntaxHighlight>
</syntaxHighlight>
Line 29: Line 29:


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
    let
let
        pkgs-unstable' =
  pkgs-unstable' =
        (import nixpkgs-unstable {
    (import nixpkgs-unstable {
            system = "x86_64-linux";
      system = "x86_64-linux";
        }).applyPatches
    }).applyPatches
            {
      {
                name = "nixpkgs-unstable-patched";
        name = "nixpkgs-unstable-patched";
                src = inputs.nixpkgs-unstable;
        src = inputs.nixpkgs-unstable;
                patches = [
        patches = [
                    (builtins.fetchurl {
          (builtins.fetchurl {
                    url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/344917.patch";
            url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/344917.patch";
                    sha256 = "sha256-aws9J5ZNUyz4Z2RqPVEovBTNng4AdhzS03Bqg8jejWQ=";
            sha256 = "sha256-aws9J5ZNUyz4Z2RqPVEovBTNng4AdhzS03Bqg8jejWQ=";
                    })
          })
                ];
        ];
            };
      };
        pkgs-unstable = import pkgs-unstable' {
  pkgs-unstable = import pkgs-unstable' {
            system = "x86_64-linux";
    system = "x86_64-linux";
        };
  };
    # ...
# ...
</syntaxHighlight>
</syntaxHighlight>


Line 58: Line 58:
The following are resources that go into more depth on this topic.
The following are resources that go into more depth on this topic.


# [https://ertt.ca/nix/patch-nixpkgs/ Patching <nixpkgs>]
* [https://ertt.ca/nix/patch-nixpkgs/ Patching <nixpkgs>]