Compare commits

..

No commits in common. "0fa686f2758dca8e219cab05d34be95642a2f505" and "12925120e5007f975d35708812e43a3754f1c791" have entirely different histories.

17 changed files with 178 additions and 512 deletions

View file

@ -11,7 +11,6 @@ This is all that's needed:
```nix ```nix
(<nixlet>).mkDocs { (<nixlet>).mkDocs {
# Params: # Params:
# fullValues ? false,
# transformOptions ? opt: opt, # transformOptions ? opt: opt,
# filter ? _: true, # filter ? _: true,
# headingDepth ? 3, # headingDepth ? 3,
@ -37,18 +36,3 @@ string
"Hello world!" "Hello world!"
``` ```
```` ````
The `fullValues` param controls whether the docs should include dependency Nixlets.
For example, when defining `postgres` as a dependency, by default the docs would not
include these options. If it's `true`, everything is included.
Dependency Nixlets' options which you override from your own `values.nix` will show both
default values:
````md
**Overridden value**:
```nix
<the overridden value set in values.nix>
```
````

View file

@ -1,27 +0,0 @@
# Importing Nixlets
Nixlets can now define dependency Nixlets and handle them similarly to how nested
Helm Charts work.
## Importing
To define a dependency Nixlet, give it a name and pass the Nixlet as a value:
```nix title="default.nix of Nixlet"
nixlet.dependencies."postgres" = <any nixlet>;
```
`<any nixlet>` here could be stuff like `nixlet-lib.fetchNixletFromGitlab {...}`,
`nixlet-lib.fetchNixlet <url> <sha>`, etc.
## Defining Values
You can pre-define values for dependency Nixlets like this:
```nix title="values.nix of Nixlet"
options = {
# options for the current Nixlet
};
# overwriting the default of dependency Nixlets (the user can still overwrite this using mkForce for example)
config."postgres".replicaCount = 10;
```

View file

@ -1,3 +0,0 @@
# Options
{{ include_raw("options.md") }}

7
flake.lock generated
View file

@ -76,17 +76,16 @@
}, },
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"lastModified": 1775132170, "lastModified": 1768913456,
"narHash": "sha256-ZhXcliu8E1KXlaviFnMHQpb/VSIbsALSFZoeb9Z6bhc=", "narHash": "sha256-P+uWjzg09q57Ur2jWCkGwNvk1bMyU20kUIKHYj+kxK0=",
"owner": "rensa-nix", "owner": "rensa-nix",
"repo": "core", "repo": "core",
"rev": "bfdb2c1aa85cd4af286b0833b046e13a96d64d6a", "rev": "e5f47b57ae06f2fc1f888bcb56413baccb5d1062",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
"dir": "lib", "dir": "lib",
"owner": "rensa-nix", "owner": "rensa-nix",
"ref": "v0.2.0",
"repo": "core", "repo": "core",
"type": "gitlab" "type": "gitlab"
} }

View file

@ -1,7 +1,7 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
ren.url = "gitlab:rensa-nix/core/v0.2.0?dir=lib"; ren.url = "gitlab:rensa-nix/core?dir=lib";
kubenix = { kubenix = {
url = "github:TECHNOFAB11/kubenix"; url = "github:TECHNOFAB11/kubenix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -22,6 +22,15 @@
// { // {
pkgs = import i.nixpkgs {inherit system;}; pkgs = import i.nixpkgs {inherit system;};
}; };
cellBlocks = with ren.blocks; [
(simple "devShells")
(simple "ci")
(simple "docs")
(simple "soonix")
(simple "apps")
(simple "nixlets")
(simple "tests")
];
} }
{ {
packages = ren.select self [ packages = ren.select self [

View file

@ -2,68 +2,25 @@
lib, lib,
kubenix, kubenix,
... ...
} @ attrs: let } @ attrs:
inherit (lib) mkOption types evalModules concatMapStringsSep assertMsg; with lib; rec {
nixlet-lib = rec { evalValues = file: {rawValues, ...} @ args: (lib.evalModules {
nixletModule = ./nixletModule.nix; specialArgs = {
evalValues = file: {
rawValues,
dependencies,
args,
check ? true,
...
}: let
moduleArgs =
args
// {
utils = import ./utils.nix attrs; utils = import ./utils.nix attrs;
}; };
# get the values from the dependencies, then import them nested modules = [
# (so you can set postgres.replicaCount in values.nix for example when adding "postgres" as dependency)
extraModules = map (depName: {
options.${depName} = mkOption {
type = types.submodule {
imports = ["${dependencies.${depName}.path}/values.nix"];
_module.args =
moduleArgs
// {
# make sure that dependencies see their own name and version etc.
nixlet = {
inherit (dependencies.${depName}) name version description;
inherit (moduleArgs.nixlet) project;
};
};
};
default = {};
description = let
n = dependencies.${depName};
in ''
Imported Nixlet as a dependency:
|Name|Version|Description|
|----|-------|-----------|
|${n.name}|${n.version}|${n.description}|
'';
};
}) (builtins.attrNames dependencies);
in
builtins.addErrorContext "[nixlets] while evaluating values" (
evalModules {
modules =
[
file file
{ (_: {
_module = { # pass through all args to the values.nix module
args = moduleArgs; config =
inherit check; rawValues
// {
_module.args = args;
}; };
} })
{config = rawValues;} ];
] });
++ extraModules; mkValues = file: args: (evalValues file args).config;
}
);
# wraps mkNixletInner to allow passing either a path or an attrset # wraps mkNixletInner to allow passing either a path or an attrset
mkNixlet = arg: mkNixlet = arg:
@ -93,24 +50,10 @@
project = defaultProject; project = defaultProject;
}; };
nixlet = { nixlet = {
_type = "nixlet";
inherit name version description path; inherit name version description path;
# just values of the current nixlet (lighweight)
values = evalValues "${path}/values.nix" { values = evalValues "${path}/values.nix" {
rawValues = {}; rawValues = {};
dependencies = {}; nixlet = baseNixletArg;
# no checking since this doesn't include dependencies
check = false;
args.nixlet = baseNixletArg;
};
# full values, including dependencies etc. (complex)
fullValues = args: let
evaled = nixlet.eval args;
in
evalValues "${path}/values.nix" {
rawValues = {};
inherit (evaled.config.nixlet) dependencies;
args.nixlet = baseNixletArg;
}; };
mkDocs = opts: mkDocs (opts // {inherit nixlet;}); mkDocs = opts: mkDocs (opts // {inherit nixlet;});
eval = { eval = {
@ -119,47 +62,35 @@
overrides ? (_: {}), overrides ? (_: {}),
values ? {}, values ? {},
}: }:
assert assertMsg (project != null) "No default project set, please pass a project to the eval/render method"; let assert lib.assertMsg (project != null) "No default project set, please pass a project to the render method"; let
nixletArg = baseNixletArg // {inherit project;}; nixletArg = baseNixletArg // {inherit project;};
in in
builtins.addErrorContext "[nixlets] while evaluating nixlet ${name}" (
kubenix.evalModules.${system} { kubenix.evalModules.${system} {
module = { module = {kubenix, ...}: {
config,
kubenix,
...
}: {
imports = with kubenix.modules; [ imports = with kubenix.modules; [
k8s k8s
helm helm
docker docker
files files
./secretsModule.nix ./secretsModule.nix
./nixletModule.nix (_: let
(let finalValues = mkValues "${path}/values.nix" {
finalValues =
(evalValues "${path}/values.nix" {
rawValues = values; rawValues = values;
inherit (config.nixlet) dependencies; nixlet = nixletArg;
args.nixlet = nixletArg; };
}).config;
in { in {
imports = [path]; imports = [path];
_module.args = { _module.args.nixlet =
nixlet =
{ {
values = finalValues; values = finalValues;
} }
// nixletArg; // nixletArg;
inherit nixlet-lib system;
};
}) })
overrides overrides
]; ];
kubenix.project = project; kubenix.project = project;
}; };
} };
);
render = { render = {
system, system,
project ? defaultProject, project ? defaultProject,
@ -202,8 +133,8 @@
exit 1 exit 1
fi fi
'' ''
+ concatMapStringsSep "\n" + lib.concatStringsSep "\n" (
(nixlet: builtins.map (nixlet:
with nixlet; '' with nixlet; ''
URL="https://gitlab.com/api/v4/projects/${projectId}/packages/generic/${name}/${version}/${name}.tar.gz" URL="https://gitlab.com/api/v4/projects/${projectId}/packages/generic/${name}/${version}/${name}.tar.gz"
if ${pkgs.curl}/bin/curl --output /dev/null --silent --head --fail --header "$AUTH_HEADER" $URL; then if ${pkgs.curl}/bin/curl --output /dev/null --silent --head --fail --header "$AUTH_HEADER" $URL; then
@ -217,10 +148,9 @@
fi fi
'') '')
nixlets nixlets
)
); );
mkDocs = opts: mkDocs = opts:
import ./valuesDocs.nix (opts // {inherit lib;}); import ./valuesDocs.nix (opts // {inherit lib;});
}; }
in
nixlet-lib

View file

@ -1,75 +0,0 @@
{
lib,
config,
nixlet,
system,
...
}: let
inherit (lib) mkOption types mkOptionType isType mkMerge mapAttrs mkIf literalExpression;
cfg = config.nixlet;
nixletType = mkOptionType {
name = "nixlet";
description = "reference";
descriptionClass = "noun";
check = isType "nixlet";
};
in {
imports = [
{
# shortcut, allows accessing deps a bit shorter/more easily
_module.args.deps = cfg.deps;
}
];
options.nixlet = {
dependencies = mkOption {
type = types.attrsOf nixletType;
default = {};
description = ''
Import other nixlets as dependencies. Works similar to Helm, specify values for these
Nixlets by using their name as a prefix. Like `postgres.replicaCount` in `values.nix` for example.
'';
example = literalExpression ''
{
"postgres" = nixlet-lib.mkNixlet <path>;
"mongodb" = nixlet-lib.fetchNixlet ...; # etc.
}
'';
};
deps = mkOption {
readOnly = true;
type = types.attrsOf types.attrs;
default = mapAttrs (name: val:
builtins.addErrorContext "[nixlets] while evaluating dependency ${name}"
(val.eval {
inherit system;
inherit (config.kubenix) project;
values = nixlet.values.${name};
}).config)
cfg.dependencies;
description = ''
Evaluated dependency nixlets. Allows accessing their resources like for example:
```nix
config.nixlet.deps."<name>".kubernetes.resources
```
'';
};
depAutoMerge = mkOption {
type = types.bool;
default = true;
description = ''
Whether to automatically merge dependency nixlets' configs
with the current nixlet. If disabled, you can access dependency outputs via:
```nix
config.nixlet.deps."<name>".kubernetes.resources
```
'';
};
};
config = mkIf cfg.depAutoMerge {
kubernetes.resources = mkMerge (map (dep: dep.kubernetes.resources) (builtins.attrValues cfg.deps));
};
}

View file

@ -1,8 +1,6 @@
{ {
lib, lib,
nixlet, nixlet,
# whether to generate docs for the full values, including dependencies
fullValues ? false,
transformOptions ? opt: opt, transformOptions ? opt: opt,
filter ? _: true, filter ? _: true,
headingDepth ? 3, headingDepth ? 3,
@ -15,12 +13,7 @@
mapAttrsToList mapAttrsToList
concatStrings concatStrings
replicate replicate
optionalString
optionAttrSetToDocList
attrByPath
generators
; ;
inherit (generators) toPretty;
_transformOptions = opt: _transformOptions = opt:
transformOptions (opt transformOptions (opt
@ -32,12 +25,7 @@
name = lib.removePrefix "config." opt.name; name = lib.removePrefix "config." opt.name;
}); });
valueSource = rawOpts = lib.optionAttrSetToDocList nixlet.values.options;
if fullValues
# TODO: get rid of system, just here cuz of kubenix
then (nixlet.fullValues {system = "x86_64-linux";})
else nixlet.values;
rawOpts = optionAttrSetToDocList valueSource.options;
transformedOpts = map _transformOptions rawOpts; transformedOpts = map _transformOptions rawOpts;
filteredOpts = lib.filter (opt: opt.visible && !opt.internal) transformedOpts; filteredOpts = lib.filter (opt: opt.visible && !opt.internal) transformedOpts;
@ -70,20 +58,7 @@
${opt.type} ${opt.type}
``` ```
'' ''
# used to show what changes a nixlet did to values of dependencies + (lib.optionalString (opt ? default && opt.default != null) ''
+ (let
val = toPretty {} (attrByPath opt.loc "_not found_" valueSource.config);
default = removeSuffix "\n" opt.default.text;
in
optionalString (opt.type != "submodule" && val != default)
''
**Overridden value**:
```nix
${val}
```
'')
+ (optionalString (opt ? default && opt.default != null) ''
**Default value**: **Default value**:
@ -91,7 +66,7 @@
${removeSuffix "\n" opt.default.text} ${removeSuffix "\n" opt.default.text}
``` ```
'') '')
+ (optionalString (opt ? example) '' + (lib.optionalString (opt ? example) ''
**Example value**: **Example value**:

View file

@ -3,67 +3,27 @@
inputs, inputs,
... ...
}: let }: let
inherit (inputs) pkgs devshell treefmt devtools-lib; inherit (inputs) pkgs devshell treefmt;
inherit (cell) soonix; inherit (cell) soonix;
treefmtWrapper = treefmt.mkWrapper pkgs { in {
projectRootFile = "flake.nix"; default = devshell.mkShell {
imports = [soonix.devshellModule];
packages = [
pkgs.nil
(treefmt.mkWrapper pkgs {
programs = { programs = {
alejandra.enable = true; alejandra.enable = true;
deadnix.enable = true; deadnix.enable = true;
statix.enable = true; statix.enable = true;
mdformat.enable = true; mdformat.enable = true;
}; };
settings.formatter.mdformat = { settings.formatter.mdformat.command = let
excludes = ["CHANGELOG.md"];
command = let
pkg = pkgs.python3.withPackages (p: [ pkg = pkgs.python3.withPackages (p: [
p.mdformat p.mdformat
p.mdformat-mkdocs p.mdformat-mkdocs
]); ]);
in "${pkg}/bin/mdformat"; in "${pkg}/bin/mdformat";
}; })
};
in {
default = devshell.mkShell {
imports = [soonix.devshellModule devtools-lib.devshellModule];
packages = [
pkgs.nil
treefmtWrapper
]; ];
lefthook.config = {
"pre-commit" = {
parallel = true;
jobs = [
{
name = "treefmt";
stage_fixed = true;
run = "${treefmtWrapper}/bin/treefmt";
env.TERM = "dumb";
}
{
name = "soonix";
stage_fixed = true;
run = "nix run .#soonix:update";
}
];
};
};
cocogitto.config = {
tag_prefix = "v";
ignore_merge_commits = true;
changelog = {
authors = [
{
username = "TECHNOFAB";
signature = "technofab";
}
];
path = "CHANGELOG.md";
template = "remote";
remote = "gitlab.com";
repository = "nixlets";
owner = "TECHNOFAB";
};
};
}; };
} }

View file

@ -3,22 +3,8 @@
cell, cell,
... ...
}: let }: let
inherit (inputs) pkgs doclib nixlet-lib; inherit (inputs) doclib;
inherit (cell) nixlets; inherit (cell) nixlets;
optionsDoc = doclib.mkOptionDocs {
module = nixlet-lib.nixletModule;
roots = [
{
url = "https://gitlab.com/TECHNOFAB/nixlets/-/blob/main/lib";
path = "${inputs.self}/lib";
}
];
};
optionsDocs = pkgs.runCommand "options-docs" {} ''
mkdir -p $out
ln -s ${optionsDoc} $out/options.md
'';
in in
(doclib.mkDocs { (doclib.mkDocs {
docs."default" = { docs."default" = {
@ -37,13 +23,9 @@ in
domains = ["nixlets.projects.tf"]; domains = ["nixlets.projects.tf"];
}; };
}; };
macros = {
enable = true;
includeDir = toString optionsDocs;
};
dynamic-nav = { dynamic-nav = {
enable = true; enable = true;
files."Nixlets Values" = builtins.map (val: {${val.name} = val.mkDocs {fullValues = true;};}) (builtins.attrValues nixlets); files."Nixlets Values" = builtins.map (val: {${val.name} = val.mkDocs {};}) (builtins.attrValues nixlets);
}; };
config = { config = {
site_name = "Nixlets"; site_name = "Nixlets";
@ -61,10 +43,8 @@ in
{"Creating Nixlets" = "creation.md";} {"Creating Nixlets" = "creation.md";}
{"Packaging" = "packaging.md";} {"Packaging" = "packaging.md";}
{"Usage" = "usage.md";} {"Usage" = "usage.md";}
{"Importing" = "importing.md";}
{"Generating Docs" = "generating_docs.md";} {"Generating Docs" = "generating_docs.md";}
{"Secrets" = "secrets.md";} {"Secrets" = "secrets.md";}
{"Options" = "options.md";}
]; ];
markdown_extensions = [ markdown_extensions = [
{ {

41
nix/repo/flake.lock generated
View file

@ -3,39 +3,20 @@
"devshell-lib": { "devshell-lib": {
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"lastModified": 1767218348, "lastModified": 1767274074,
"narHash": "sha256-8MJqwH9sRMuHH+RsB7iqWyWD30TgmpiYKEvegAULggs=", "narHash": "sha256-h2grM9qoSnYdqN7K8+taeMuWC2umaN/c2FCBu48frlo=",
"owner": "rensa-nix", "owner": "rensa-nix",
"repo": "devshell", "repo": "devshell",
"rev": "7a9b7e5d9f162a1fa3edfdc0169cdc29d3a67f8e", "rev": "5508ced269ee40ff7f5261ee3b5bf5597f7cad5d",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
"dir": "lib", "dir": "lib",
"owner": "rensa-nix", "owner": "rensa-nix",
"ref": "v0.1.0",
"repo": "devshell", "repo": "devshell",
"type": "gitlab" "type": "gitlab"
} }
}, },
"devtools-lib": {
"locked": {
"dir": "lib",
"lastModified": 1767214272,
"narHash": "sha256-gvW7flZ60xdv3Z3Ksec5jcRjW2sqRHsGoJdwsNWQVPk=",
"owner": "rensa-nix",
"repo": "devtools",
"rev": "f40e59c32c48cdbf4cbc621c2f0f11e7bb80dbd3",
"type": "gitlab"
},
"original": {
"dir": "lib",
"owner": "rensa-nix",
"ref": "v0.1.0",
"repo": "devtools",
"type": "gitlab"
}
},
"nix-gitlab-ci-lib": { "nix-gitlab-ci-lib": {
"locked": { "locked": {
"dir": "lib", "dir": "lib",
@ -67,7 +48,6 @@
"original": { "original": {
"dir": "lib", "dir": "lib",
"owner": "TECHNOFAB", "owner": "TECHNOFAB",
"ref": "v1.1.0",
"repo": "nixmkdocs", "repo": "nixmkdocs",
"type": "gitlab" "type": "gitlab"
} }
@ -75,17 +55,16 @@
"nixtest-lib": { "nixtest-lib": {
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"lastModified": 1775133683, "lastModified": 1769441055,
"narHash": "sha256-06jKKes7NjBQClKXTZTmo7GiGJhe1j5ZMW6jle8Vr1o=", "narHash": "sha256-SrHLnM3UMzpj5/o52yf3lFOVpsIGEU5nAFUkdeJO1bM=",
"owner": "TECHNOFAB", "owner": "TECHNOFAB",
"repo": "nixtest", "repo": "nixtest",
"rev": "143921cad9e6076700a45cdb7ff47c91f9801225", "rev": "9f9fcb85349003edb554574d0e3f623811866f50",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
"dir": "lib", "dir": "lib",
"owner": "TECHNOFAB", "owner": "TECHNOFAB",
"ref": "v1.3.0",
"repo": "nixtest", "repo": "nixtest",
"type": "gitlab" "type": "gitlab"
} }
@ -93,7 +72,6 @@
"root": { "root": {
"inputs": { "inputs": {
"devshell-lib": "devshell-lib", "devshell-lib": "devshell-lib",
"devtools-lib": "devtools-lib",
"nix-gitlab-ci-lib": "nix-gitlab-ci-lib", "nix-gitlab-ci-lib": "nix-gitlab-ci-lib",
"nixmkdocs-lib": "nixmkdocs-lib", "nixmkdocs-lib": "nixmkdocs-lib",
"nixtest-lib": "nixtest-lib", "nixtest-lib": "nixtest-lib",
@ -104,17 +82,16 @@
"soonix-lib": { "soonix-lib": {
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"lastModified": 1767647496, "lastModified": 1769607658,
"narHash": "sha256-1kvCEp7PJnKTcnAjN+Me6swiygeMgJInsZsRQ5bdpH8=", "narHash": "sha256-gF9/QmmaNRgqkC5cqSGgwWvGXj9Mj4qMDkvvF/5BlSA=",
"owner": "TECHNOFAB", "owner": "TECHNOFAB",
"repo": "soonix", "repo": "soonix",
"rev": "5e479f3662db1c338679cdb3fd080cf06e4c67d4", "rev": "19a88a0c2681bbc85bc2cbe4f2860316d50fe957",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
"dir": "lib", "dir": "lib",
"owner": "TECHNOFAB", "owner": "TECHNOFAB",
"ref": "v0.1.0",
"repo": "soonix", "repo": "soonix",
"type": "gitlab" "type": "gitlab"
} }

View file

@ -1,10 +1,9 @@
{ {
inputs = { inputs = {
devshell-lib.url = "gitlab:rensa-nix/devshell/v0.1.0?dir=lib"; devshell-lib.url = "gitlab:rensa-nix/devshell?dir=lib";
devtools-lib.url = "gitlab:rensa-nix/devtools/v0.1.0?dir=lib"; nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib";
nixtest-lib.url = "gitlab:TECHNOFAB/nixtest/v1.3.0?dir=lib"; soonix-lib.url = "gitlab:TECHNOFAB/soonix?dir=lib";
soonix-lib.url = "gitlab:TECHNOFAB/soonix/v0.1.0?dir=lib"; nixmkdocs-lib.url = "gitlab:TECHNOFAB/nixmkdocs?dir=lib";
nixmkdocs-lib.url = "gitlab:TECHNOFAB/nixmkdocs/v1.1.0?dir=lib";
nix-gitlab-ci-lib.url = "gitlab:TECHNOFAB/nix-gitlab-ci/3.1.2?dir=lib"; nix-gitlab-ci-lib.url = "gitlab:TECHNOFAB/nix-gitlab-ci/3.1.2?dir=lib";
treefmt-nix = { treefmt-nix = {
url = "github:numtide/treefmt-nix"; url = "github:numtide/treefmt-nix";

View file

@ -1,3 +0,0 @@
{nixlet-lib, ...}: {
config.nixlet.dependencies."example" = nixlet-lib.mkNixlet ../example;
}

View file

@ -1,6 +0,0 @@
{
name = "dep";
version = "0.0.1";
description = "hello world";
defaultProject = "dep";
}

View file

@ -1,5 +0,0 @@
_: {
options = {};
config."example".example = "Hello dependency!";
}

View file

@ -1,4 +0,0 @@
{nixlet, ...}:
with nixlet; {
kubernetes.resources.configMaps."test".data."test" = values.example;
}

View file

@ -3,14 +3,11 @@
ntlib, ntlib,
nixlet-lib, nixlet-lib,
... ...
}: let }: {
inherit (pkgs.lib) mkForce;
in {
suites."Lib Tests" = { suites."Lib Tests" = {
pos = __curPos; pos = __curPos;
tests = let tests = let
nixlet = nixlet-lib.mkNixlet ./fixtures/example; nixlet = nixlet-lib.mkNixlet ./fixtures/example;
depNixlet = nixlet-lib.mkNixlet ./fixtures/dependency;
in [ in [
{ {
name = "mkNixlet fail on nonexistant nixlet.nix"; name = "mkNixlet fail on nonexistant nixlet.nix";
@ -45,27 +42,6 @@ in {
assert_file_contains "${docs}" '"Hello world!"' assert_file_contains "${docs}" '"Hello world!"'
''; '';
} }
{
name = "Nixlet dependencies";
expected = "Hello dependency!";
actual = let
evaled = depNixlet.eval {inherit (pkgs.stdenv.hostPlatform) system;};
in
evaled.config.kubernetes.resources.configMaps."test".data."test";
}
{
name = "Nixlet dependency value override";
expected = "Hello override!";
actual = let
evaled = depNixlet.eval {
inherit (pkgs.stdenv.hostPlatform) system;
values = {
"example".example = mkForce "Hello override!";
};
};
in
evaled.config.kubernetes.resources.configMaps."test".data."test";
}
]; ];
}; };
} }