mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-11 23:50:06 +01:00
fmt
This commit is contained in:
parent
a0ce293db8
commit
60592d3096
55 changed files with 23668 additions and 30925 deletions
75
flake.nix
75
flake.nix
|
|
@ -7,55 +7,59 @@
|
|||
devshell-flake.url = "github:numtide/devshell";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, devshell-flake }:
|
||||
|
||||
(flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
devshell-flake,
|
||||
}:
|
||||
(flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
self.overlay
|
||||
devshell-flake.overlay
|
||||
];
|
||||
config = { allowUnsupportedSystem = true; };
|
||||
config = {allowUnsupportedSystem = true;};
|
||||
};
|
||||
|
||||
lib = pkgs.lib;
|
||||
|
||||
kubenix = {
|
||||
lib = import ./lib { inherit lib pkgs; };
|
||||
lib = import ./lib {inherit lib pkgs;};
|
||||
evalModules = self.evalModules.${system};
|
||||
modules = self.modules;
|
||||
};
|
||||
|
||||
# evalModules with same interface as lib.evalModules and kubenix as
|
||||
# special argument
|
||||
evalModules = attrs@{ module ? null, modules ? [ module ], ... }:
|
||||
let
|
||||
lib' = lib.extend (lib: self: import ./lib/upstreamables.nix { inherit lib pkgs; });
|
||||
attrs' = builtins.removeAttrs attrs [ "module" ];
|
||||
in
|
||||
evalModules = attrs @ {
|
||||
module ? null,
|
||||
modules ? [module],
|
||||
...
|
||||
}: let
|
||||
lib' = lib.extend (lib: self: import ./lib/upstreamables.nix {inherit lib pkgs;});
|
||||
attrs' = builtins.removeAttrs attrs ["module"];
|
||||
in
|
||||
lib'.evalModules (lib.recursiveUpdate
|
||||
{
|
||||
inherit modules;
|
||||
specialArgs = { inherit kubenix; };
|
||||
specialArgs = {inherit kubenix;};
|
||||
args = {
|
||||
inherit pkgs;
|
||||
name = "default";
|
||||
};
|
||||
}
|
||||
attrs');
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
in {
|
||||
inherit evalModules;
|
||||
|
||||
jobs = import ./jobs { inherit pkgs; };
|
||||
jobs = import ./jobs {inherit pkgs;};
|
||||
|
||||
devShell = with pkgs; devshell.mkShell
|
||||
{ imports = [ (devshell.importTOML ./devshell.toml) ]; };
|
||||
devShell = with pkgs;
|
||||
devshell.mkShell
|
||||
{imports = [(devshell.importTOML ./devshell.toml)];};
|
||||
|
||||
packages = flake-utils.lib.flattenTree {
|
||||
inherit (pkgs) kubernetes kubectl;
|
||||
|
|
@ -66,31 +70,30 @@
|
|||
if suite.success == true
|
||||
then pkgs.runCommandNoCC "testing-suite-config-assertions-for-${suite.name}-succeeded" {} "echo success > $out"
|
||||
else pkgs.runCommandNoCC "testing-suite-config-assertions-for-${suite.name}-failed" {} "exit 1";
|
||||
mkExamples = attrs: (import ./examples { inherit evalModules; })
|
||||
({ registry = "docker.io/gatehub"; } // attrs);
|
||||
mkK8STests = attrs: (import ./tests { inherit evalModules; })
|
||||
({ registry = "docker.io/gatehub"; } // attrs);
|
||||
mkExamples = attrs:
|
||||
(import ./examples {inherit evalModules;})
|
||||
({registry = "docker.io/gatehub";} // attrs);
|
||||
mkK8STests = attrs:
|
||||
(import ./tests {inherit evalModules;})
|
||||
({registry = "docker.io/gatehub";} // attrs);
|
||||
in {
|
||||
# TODO: access "success" derivation with nice testing utils for nice output
|
||||
nginx-example = wasSuccess (mkExamples { }).nginx-deployment.config.testing;
|
||||
tests-k8s-1_19 = wasSuccess (mkK8STests { k8sVersion = "1.19"; });
|
||||
tests-k8s-1_20 = wasSuccess (mkK8STests { k8sVersion = "1.20"; });
|
||||
tests-k8s-1_21 = wasSuccess (mkK8STests { k8sVersion = "1.21"; });
|
||||
nginx-example = wasSuccess (mkExamples {}).nginx-deployment.config.testing;
|
||||
tests-k8s-1_19 = wasSuccess (mkK8STests {k8sVersion = "1.19";});
|
||||
tests-k8s-1_20 = wasSuccess (mkK8STests {k8sVersion = "1.20";});
|
||||
tests-k8s-1_21 = wasSuccess (mkK8STests {k8sVersion = "1.21";});
|
||||
};
|
||||
|
||||
}
|
||||
))
|
||||
|
||||
//
|
||||
|
||||
{
|
||||
// {
|
||||
modules = import ./modules;
|
||||
overlay = final: prev: {
|
||||
kubenix.evalModules = self.evalModules.${prev.system};
|
||||
# up to date versions of their nixpkgs equivalents
|
||||
kubernetes = prev.callPackage ./pkgs/applications/networking/cluster/kubernetes
|
||||
{ };
|
||||
kubectl = prev.callPackage ./pkgs/applications/networking/cluster/kubectl { };
|
||||
kubernetes =
|
||||
prev.callPackage ./pkgs/applications/networking/cluster/kubernetes
|
||||
{};
|
||||
kubectl = prev.callPackage ./pkgs/applications/networking/cluster/kubectl {};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue