]> git.scottworley.com Git - warn-nixpkgs/commitdiff
Wrap nixpkgs with a warning
authorScott Worley <scottworley@scottworley.com>
Mon, 23 Aug 2021 19:50:59 +0000 (12:50 -0700)
committerScott Worley <scottworley@scottworley.com>
Mon, 23 Aug 2021 19:50:59 +0000 (12:50 -0700)
README.md [new file with mode: 0644]
default.nix [new file with mode: 0644]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..574225d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,14 @@
+# warn-nixpkgs
+
+Wrap nixpkgs, but emit a warning if this one is ever accessed.
+
+The Nix world is gradually adopting flakes and moving toward a world
+where there are no longer `nix-update`-maintained channels.  During that
+transition, it's nice to have system channels that still work, but emit
+a warning when they are accessed to alert the user of of a gap in their
+move-to-flakes.
+
+This repo can be used as a drop-in replacement for the `nixpkgs` channel.
+This repo doesn't contain `nixpkgs` -- this is merely a thin wrapper.
+Configure the actual `nixpkgs` to forward to as a `nixpkgs-warned`
+channel.
diff --git a/default.nix b/default.nix
new file mode 100644 (file)
index 0000000..95c7a7e
--- /dev/null
@@ -0,0 +1,4 @@
+args@{ ... }:
+let actualNixpkgs = import <nixpkgs-warned> args;
+in actualNixpkgs.lib.warn
+("Using legacy channel nixpkgs from " + <nixpkgs-warned>) actualNixpkgs