From 23ee58d2d0a26124ec16f54653e58f485c167e01 Mon Sep 17 00:00:00 2001 From: Pacman99 Date: Thu, 29 Apr 2021 11:53:45 -0700 Subject: [PATCH] use __dontExport property for lib and overrides --- doc/concepts/overrides.md | 5 +++++ flake.lock | 8 ++++---- lib/flake.lock | 6 +++--- lib/mkFlake/default.nix | 8 +++++++- overlays/overrides.nix | 2 ++ 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/doc/concepts/overrides.md b/doc/concepts/overrides.md index 0eb1002..303108c 100644 --- a/doc/concepts/overrides.md +++ b/doc/concepts/overrides.md @@ -12,10 +12,15 @@ You can add overlays to any channel to override packages from other channels. Pulling the manix package from the `latest` channel: ```nix channels: final: prev: { + __dontExport = true; inherit (pkgs.latest) manix; } ``` +It is recommended to set the `__dontExport` property for override specific +overlays. `overlays/overrides.nix` is the best place to consolidate all package +overrides and the property is already set for you. + ## Modules You can also pull modules from other channels. All modules have access to the diff --git a/flake.lock b/flake.lock index f7770ee..27fecfb 100644 --- a/flake.lock +++ b/flake.lock @@ -79,7 +79,7 @@ "utils": "utils_2" }, "locked": { - "narHash": "sha256-hpvEXcpq85cDKi0F5UUsuMVISKlk8hgVJiz5FF29RwA=", + "narHash": "sha256-TQvd6TvSuT0sJCLlGsV65YjB+nIfDdDKZ1F94pCfkTw=", "path": "./lib", "type": "path" }, @@ -351,11 +351,11 @@ "flake-utils": "flake-utils" }, "locked": { - "lastModified": 1619532520, - "narHash": "sha256-+xIFAW5J0AcxwAflAX1gg/C8kfaqeZbS4XAZusCrZPY=", + "lastModified": 1619714004, + "narHash": "sha256-xoP81rWAM2cVpEFrQv9sUEIvNxGXAg4UH9kBt83a5u4=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "8eb7f9206713a528174c20c5133521dc37e2bfb1", + "rev": "0642ac572a87a0beb78a7c6ddce1267aa5817d05", "type": "github" }, "original": { diff --git a/lib/flake.lock b/lib/flake.lock index ebf5e6d..8156254 100644 --- a/lib/flake.lock +++ b/lib/flake.lock @@ -146,11 +146,11 @@ "flake-utils": "flake-utils" }, "locked": { - "lastModified": 1619532520, - "narHash": "sha256-+xIFAW5J0AcxwAflAX1gg/C8kfaqeZbS4XAZusCrZPY=", + "lastModified": 1619714004, + "narHash": "sha256-xoP81rWAM2cVpEFrQv9sUEIvNxGXAg4UH9kBt83a5u4=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "8eb7f9206713a528174c20c5133521dc37e2bfb1", + "rev": "0642ac572a87a0beb78a7c6ddce1267aa5817d05", "type": "github" }, "original": { diff --git a/lib/mkFlake/default.nix b/lib/mkFlake/default.nix index bf571ec..e5862d3 100644 --- a/lib/mkFlake/default.nix +++ b/lib/mkFlake/default.nix @@ -40,7 +40,7 @@ let hosts = lib.mapAttrs (_: stripHost) cfg.nixos.hosts; hostDefaults = stripHost cfg.nixos.hostDefaults; in -lib.systemFlake (lib.recursiveUpdate +lib.systemFlake (lib.mergeAny otherArguments { inherit self inputs hosts; @@ -55,6 +55,12 @@ lib.systemFlake (lib.recursiveUpdate ) cfg.channels; + sharedOverlays = [ + (final: prev: { + __dontExport = true; + devlib = lib; + }) + ]; hostDefaults = lib.mergeAny hostDefaults { specialArgs.suites = cfg.nixos.suites; modules = cfg.nixos.hostDefaults.externalModules ++ defaultModules; diff --git a/overlays/overrides.nix b/overlays/overrides.nix index bb3cf68..59516b3 100644 --- a/overlays/overrides.nix +++ b/overlays/overrides.nix @@ -1,5 +1,7 @@ channels: final: prev: { + __dontExport = true; # overrides clutter up actual creations + inherit (channels.latest) cachix dhall