diff --git a/docs/usage.md b/docs/usage.md index 5e35d36..5d446ea 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -39,10 +39,24 @@ imports = [ ``` 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 -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 diff --git a/flake.nix b/flake.nix index 7e51ba8..c8dd403 100644 --- a/flake.nix +++ b/flake.nix @@ -64,6 +64,8 @@ ]; in { + inherit patches; + nixosModules.default = { config, ... }: { imports = allModules; };