switch formatting to nixpkgs-fmt

This commit is contained in:
Bryton Hall 2023-07-07 22:01:34 -04:00
parent 3598716c73
commit 2712e89716
65 changed files with 4839 additions and 5222 deletions

View file

@ -1,7 +1,7 @@
{kubenix ? import ../../../..}:
{ kubenix ? import ../../../.. }:
kubenix.evalModules.${builtins.currentSystem} {
module = {kubenix, ...}: {
imports = [./module.nix];
module = { kubenix, ... }: {
imports = [ ./module.nix ];
kubenix.project = "multi-namespace-example";
kubernetes.version = "1.24";

View file

@ -1,11 +1,5 @@
{
config,
lib,
pkgs,
kubenix,
...
}: {
imports = with kubenix.modules; [submodules k8s];
{ config, lib, pkgs, kubenix, ... }: {
imports = with kubenix.modules; [ submodules k8s ];
# Import submodule.
submodules.imports = [
@ -26,12 +20,10 @@
# Now we can set the args options defined in the submodule.
args.kubernetes.resources = {
services.nginx.spec = {
ports = [
{
name = "http";
port = 80;
}
];
ports = [{
name = "http";
port = 80;
}];
selector.app = "nginx";
};
};
@ -41,12 +33,10 @@
submodule = "namespaced";
args.kubernetes.resources = {
services.nginx.spec = {
ports = [
{
name = "https";
port = 443;
}
];
ports = [{
name = "https";
port = 443;
}];
selector.app = "nginx";
};
};

View file

@ -1,13 +1,12 @@
{
config,
kubenix,
lib,
# Name of submodule instance.
name,
# This is a shorthand for config.submodule.args and contains
{ config
, kubenix
, lib
, # Name of submodule instance.
name
, # This is a shorthand for config.submodule.args and contains
# final values of the args options.
args,
...
args
, ...
}: {
imports = with kubenix.modules; [
# This needs to be imported in order to define a submodule.
@ -25,7 +24,7 @@
# to set kubernetes options from the k8s module which are already
# precisely typed.
type = lib.types.attrs;
default = {};
default = { };
};
};
@ -54,9 +53,9 @@
kubernetes = lib.mkMerge [
# Use instance name as namespace
{namespace = name;}
{ namespace = name; }
# Create namespace object
{resources.namespaces.${name} = {};}
{ resources.namespaces.${name} = { }; }
# All resources defined here will use the above namespace
args.kubernetes
];