Added nixpkgs patches documentation

This commit is contained in:
Emmet 2023-09-09 06:18:41 -05:00
parent 87ab124681
commit 4108b4eb0e
3 changed files with 34 additions and 0 deletions

View file

@ -38,6 +38,26 @@ I have my modules separated into two groups:
More detailed information on these specific modules are in the [[./system][system directory]] and [[./user][user directory]] respectively. More detailed information on these specific modules are in the [[./system][system directory]] and [[./user][user directory]] respectively.
** Patches
In some cases, since I use =nixpgs-unstable=, I must patch nixpkgs. This can be done inside of a flake via:
#+BEGIN_SRC nix
nixpkgs-patched = (import nixpkgs { inherit system; }).applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches = [ ./example-patch.nix ];
};
# configure pkgs
pkgs = import nixpkgs-patched { inherit system; };
# configure lib
lib = nixpkgs.lib;
#+END_SRC
Patches can either be local or remote, so you can even import unmerged pull requests by using =fetchpatch= and the raw patch url, i.e: https://github.com/NixOS/nixpkgs/pull/example.patch.
I currently curate patches local to this repo in the [[./patches][patches]] directory.
** Profiles ** Profiles
I separate my configurations into [[./profiles][profiles]] (essentially system templates), i.e: I separate my configurations into [[./profiles][profiles]] (essentially system templates), i.e:
- [[./profiles/personal][Personal]] - What I would run on a personal laptop/desktop - [[./profiles/personal][Personal]] - What I would run on a personal laptop/desktop

View file

@ -31,6 +31,7 @@
spawnEditor = if (editor == "emacsclient") then "emacsclient -c -a 'emacs'" spawnEditor = if (editor == "emacsclient") then "emacsclient -c -a 'emacs'"
else (if (editor == ("vim" || "nvim" || "nano")) then "$TERM -e $EDITOR" else editor); else (if (editor == ("vim" || "nvim" || "nano")) then "$TERM -e $EDITOR" else editor);
# create patched nixpkgs
nixpkgs-patched = (import nixpkgs { inherit system; }).applyPatches { nixpkgs-patched = (import nixpkgs { inherit system; }).applyPatches {
name = "nixpkgs-patched"; name = "nixpkgs-patched";
src = nixpkgs; src = nixpkgs;

13
patches/README.org Normal file
View file

@ -0,0 +1,13 @@
#+title: I never thought I'd have to do this, but here we are
#+author: Emmet
Since I use =nixpkgs-unstable= (I am an Arch user by heart), there are some cases where certain packages will break or fail to build (usually due to my extremely customized, non-standard system).
With Nix, I /could/ just rollback everything and wait to update until an upstream patch fixes things, but if it's a quick fix, I'd rather just patch it in immediately so that everything else can stay up to date.
** List of Patches
Here is a list of patches in this directory, along with a more detailed description of why it's necessary:
| Patch | Reason |
|------------------------------+----------------------------------------------------------------------------------------------|
| [[./emacs-no-version-check.patch][emacs-no-version-check.patch]] | [[https://github.com/NixOS/nixpkgs/commit/35ccb9db3f4f0872f05d175cf53d0e1f87ff09ea][35ccb9d]] breaks my nix-doom-emacs install by preventing home-manager from building. This patches undoes this commit. |