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".
This commit is contained in:
Paul Haerle 2022-01-23 19:06:41 +01:00 committed by GitHub
parent f4896aad39
commit 5b8971a0f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -16,6 +16,9 @@
outputs = { self, nixpkgs, utils, nix-eval-jobs, ... }: let outputs = { self, nixpkgs, utils, nix-eval-jobs, ... }: let
supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; 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 in utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
@ -30,9 +33,6 @@
# Full user manual # Full user manual
manual = let manual = let
colmena = self.packages.${system}.colmena; colmena = self.packages.${system}.colmena;
evalNix = import ./src/nix/hive/eval.nix {
hermetic = true;
};
deploymentOptionsMd = (pkgs.nixosOptionsDoc { deploymentOptionsMd = (pkgs.nixosOptionsDoc {
options = evalNix.docs.deploymentOptions pkgs; options = evalNix.docs.deploymentOptions pkgs;
}).optionsCommonMark; }).optionsCommonMark;
@ -75,5 +75,6 @@
overlay = final: prev: { overlay = final: prev: {
colmena = final.callPackage ./package.nix { }; colmena = final.callPackage ./package.nix { };
}; };
inherit (evalNix) nixosModules;
}; };
} }

View file

@ -524,6 +524,8 @@ in {
meta = hive.meta; meta = hive.meta;
nixosModules = { inherit deploymentOptions; };
docs = { docs = {
deploymentOptions = pkgs: let deploymentOptions = pkgs: let
eval = pkgs.lib.evalModules { eval = pkgs.lib.evalModules {