From d5276195f77d1a821454a267bd8b774a8cf896b3 Mon Sep 17 00:00:00 2001 From: Pacman99 Date: Tue, 27 Apr 2021 09:38:20 -0700 Subject: [PATCH] move overrides.nix to overlays also update overrides docs it is a pure devos overlay now, it makes sense to go in overlays --- doc/concepts/overrides.md | 19 ++++++++----------- flake.nix | 1 - overrides.nix => overlays/overrides.nix | 0 3 files changed, 8 insertions(+), 12 deletions(-) rename overrides.nix => overlays/overrides.nix (100%) diff --git a/doc/concepts/overrides.md b/doc/concepts/overrides.md index 78b50fd..0eb1002 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 c2a87ad..5468f5a 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