1
0
Fork 0

add documentation on how to get patched nixpkgs

This commit is contained in:
ibizaman 2024-06-10 16:20:19 -07:00 committed by Pierre Penninckx
parent 7dfabe6f17
commit 21ac10946a
2 changed files with 18 additions and 2 deletions

View file

@ -39,10 +39,24 @@ imports = [
``` ```
Self Host Blocks provides its own `nixpkgs` input so both can be updated in lock step, ensuring Self Host Blocks provides its own `nixpkgs` input so both can be updated in lock step, ensuring
maximum compatibility. It is recommended to use the following `nixpkgs` as input for your deployments: maximum compatibility. It is recommended to use the following `nixpkgs` as input for your
deployments. Also, patches can be applied by Self Host Blocks. To handle all this, you need the
following code instead wherever you import `nixpkgs`:
```nix ```nix
inputs.selfhostblocks.inputs.nixpkgs let
system = "x86_64-linux";
originPkgs = selfhostblocks.inputs.nixpkgs;
nixpkgs' = originPkgs.legacyPackages.${system}.applyPatches {
name = "nixpkgs-patched";
src = originPkgs;
patches = selfhostblocks.patches.${system};
};
in
nixpkgs = import nixpkgs' {
inherit system;
};
``` ```
Advanced users can if they wish use a version of `nixpkgs` of their choosing but then we cannot Advanced users can if they wish use a version of `nixpkgs` of their choosing but then we cannot

View file

@ -64,6 +64,8 @@
]; ];
in in
{ {
inherit patches;
nixosModules.default = { config, ... }: { nixosModules.default = { config, ... }: {
imports = allModules; imports = allModules;
}; };