From 5b8971a0f4a2c0cc509d79b8a646ddca713912d1 Mon Sep 17 00:00:00 2001 From: Paul Haerle Date: Sun, 23 Jan 2022 19:06:41 +0100 Subject: [PATCH] eval.nix: expose nixosModules.deploymentOptions (#49) Allow flake users to import .#nixosModules.deploymentOptions into their flake, so that the same expression can be used for both, .#colmena.$host as well as .#nixosConfiguration.$host, without the latter complaining about undefined options in "deployment". --- flake.nix | 7 ++++--- src/nix/hive/eval.nix | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 122ffa1..98d39a4 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,9 @@ outputs = { self, nixpkgs, utils, nix-eval-jobs, ... }: let supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + evalNix = import ./src/nix/hive/eval.nix { + hermetic = true; + }; in utils.lib.eachSystem supportedSystems (system: let pkgs = import nixpkgs { inherit system; @@ -30,9 +33,6 @@ # Full user manual manual = let colmena = self.packages.${system}.colmena; - evalNix = import ./src/nix/hive/eval.nix { - hermetic = true; - }; deploymentOptionsMd = (pkgs.nixosOptionsDoc { options = evalNix.docs.deploymentOptions pkgs; }).optionsCommonMark; @@ -75,5 +75,6 @@ overlay = final: prev: { colmena = final.callPackage ./package.nix { }; }; + inherit (evalNix) nixosModules; }; } diff --git a/src/nix/hive/eval.nix b/src/nix/hive/eval.nix index 58b5fc6..9c886b3 100644 --- a/src/nix/hive/eval.nix +++ b/src/nix/hive/eval.nix @@ -524,6 +524,8 @@ in { meta = hive.meta; + nixosModules = { inherit deploymentOptions; }; + docs = { deploymentOptions = pkgs: let eval = pkgs.lib.evalModules {