We need a reference to the kitchen package

This commit is contained in:
Jeremy Wall 2022-02-28 17:18:55 -05:00
parent 2efbe2dacf
commit eef34ea7e5
2 changed files with 5 additions and 3 deletions

View File

@ -14,6 +14,7 @@
trunkGen = (import ./nix/trunk/default.nix); trunkGen = (import ./nix/trunk/default.nix);
kitchenWasmGen = (import ./nix/kitchenWasm/default.nix); kitchenWasmGen = (import ./nix/kitchenWasm/default.nix);
cargoVendorGen = (import ./nix/cargoVendorDeps/default.nix); cargoVendorGen = (import ./nix/cargoVendorDeps/default.nix);
moduleGen = (import ./nix/kitchen/module.nix);
version = "0.2.1"; version = "0.2.1";
in in
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
@ -33,6 +34,7 @@
# Because it's a workspace we need the other crates available as source # Because it's a workspace we need the other crates available as source
root = (pkgs.callPackage gitignore { }).gitignoreSource ./.; root = (pkgs.callPackage gitignore { }).gitignoreSource ./.;
}); });
module = moduleGen {inherit kitchen;};
in in
{ {
packages = { packages = {
@ -43,7 +45,7 @@
; ;
}; };
defaultPackage = kitchen; defaultPackage = kitchen;
nixosModules.kitchen = import ./nix/kitchen/module.nix; nixosModules.kitchen = module;
} }
); );
} }

View File

@ -1,3 +1,4 @@
{kitchen}:
{config, lib, pkgs, ...}: {config, lib, pkgs, ...}:
with lib; with lib;
{ {
@ -14,7 +15,6 @@ with lib;
config = mkIf config.services.kitchen.enable { config = mkIf config.services.kitchen.enable {
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
kitchen = (import ../packages/kitchen/package.nix) { inherit pkgs; };
recipes = (import ../packages/recipes/package.nix) { inherit pkgs; }; recipes = (import ../packages/recipes/package.nix) { inherit pkgs; };
}) })
]; ];
@ -25,7 +25,7 @@ with lib;
serviceConfig = { serviceConfig = {
restart = "on-failure"; restart = "on-failure";
restartSec = "10s"; restartSec = "10s";
ExecStart = "${self.packages."${system}".kitchen}/bin/kitchen serve --listen ${config.services.kitchen.listenSocket} --dir ${pkgs.recipes}"; ExecStart = "${kitchen}/bin/kitchen serve --listen ${config.services.kitchen.listenSocket} --dir ${pkgs.recipes}";
}; };
}; };
}; };