mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 00:03:55 +01:00
59f557a3e5
This change makes it possible to use this nix-config in all the different ways imaginable (containers, bare metal, tests, and as a separate flake input) *without* running into infinite recursion issues with self. It does this by using a trick similar to JavaScript in which `var self = this;`, thus enabling the usage of "this" (or self, in Nix's case) where it wouldn't otherwise be possible. Note that this *only* works if the input for this repository is named nix-config. This makes it impractical to combine with multiple configurations that employ the same strategy.
15 lines
307 B
Nix
15 lines
307 B
Nix
test: { pkgs, self }:
|
|
let
|
|
inherit (pkgs) lib;
|
|
nixos-lib = import (pkgs.path + "/nixos/lib") { };
|
|
in
|
|
(nixos-lib.runTest {
|
|
hostPkgs = pkgs;
|
|
defaults.documentation.enable = lib.mkDefault false;
|
|
node.specialArgs = {
|
|
inherit self;
|
|
nix-config = self;
|
|
};
|
|
imports = [ test ];
|
|
}).config.result
|