diff --git a/doc/concepts/overrides.md b/doc/concepts/overrides.md index 78b50fd1..0eb1002e 100644 --- a/doc/concepts/overrides.md +++ b/doc/concepts/overrides.md @@ -2,30 +2,27 @@ Each NixOS host follows one channel. But many times it is useful to get packages or modules from different channels. -This is what the overrides are for. You can make use of the `overrides.nix` to -override specific packages to be pulled from other channels. Any overlay may get -`channels` as their first argument. +## Packages +You can make use of `overlays/overrides.nix` to override specific packages in the +default channel to be pulled from other channels. That file is simply an example +of how any overlay can get `channels` as their first argument. -## Example +You can add overlays to any channel to override packages from other channels. -### Packages -The override packages are defined as a regular overlay with an extra arguement -`channels`. This refers to all channels defined in `flake.nix`. - -Pulling the manix package from the latest flake: +Pulling the manix package from the `latest` channel: ```nix channels: final: prev: { inherit (pkgs.latest) manix; } ``` -### Modules +## Modules You can also pull modules from other channels. All modules have access to the `modulesPath` for each channel as `ModulesPath`. And you can use `disabledModules` to remove modules from the current channel. -Pulling the zsh module from the latest flake: +Pulling the zsh module from the `latest` channel: ```nix { latestModulesPath }: { modules = [ "${latestModulesPath}/programs/zsh/zsh.nix" ]; diff --git a/flake.nix b/flake.nix index c2a87add..5468f5a5 100644 --- a/flake.nix +++ b/flake.nix @@ -45,7 +45,6 @@ (devos.lib.pathsIn ./overlays) ./pkgs/default.nix pkgs.overlay # for `srcs` - ./overrides.nix # from "latest" channel nur.overlay ]; }; diff --git a/overrides.nix b/overlays/overrides.nix similarity index 100% rename from overrides.nix rename to overlays/overrides.nix