I feel like I should be able to suss this out, but I can’t quite get my head around it.
I just created a derivation for a new pkg. I did this by cloning nixos and adding it to the repo locally. I have it building and installing. But it doesn’t execute properly because it’s tightly coupled to the versions of things that are in my system env (via configuration.nix).
It seems like some form of pinning is a potential answer to this. Can I just override nixpgs to be a local nixos directory?
Instead of having a local fork and apply changes there, have you considered using an overlay which you use from your configuration.nix?
Or directly use callPackage (import /path/to/your/default.nix) {} in your configs package list. (Actual syntax might slightly differ as this is from memory)
Overlays work perfectly fine for new packages as well.
I have not yet used one with configuratiin.nix, though the process should be similar as with home.nix. especially as nixpkgs.overlays exists in both places.
In my user config I have an overlay defined with some local packages, none of them is available in nixpkgs already as far as I remember.
I had the same problem the writer did. It did not automatically pick up my overlay via the environment variable. However, I prefer this anyway since it’s explicit.
diff --git a/configuration.nix b/configuration.nix
index 6289249..afa2422 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -5,6 +5,9 @@
{ config, pkgs, ... }:
{
+ nixpkgs.overlays = [
+ (import ./overlays/ams.nix)
+ ];
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@@ -207,6 +210,7 @@ menuentry "Windows 10 (on /dev/sda1)" --class windows --class os $menuentry_id_o
# synths and instruments
aeolus
+ ams
axoloti
# beast broken
dirt
diff --git a/overlays/ams.nix b/overlays/ams.nix
new file mode 100644
index 0000000..b898763
--- /dev/null
+++ b/overlays/ams.nix
@@ -0,0 +1,4 @@
+self: super:
+{
+ ams = super.callPackage /home2/nixos/nixpkgs/pkgs/applications/audio/ams {};
+}