chore: initial commit

This commit is contained in:
technofab 2025-07-31 12:37:19 +02:00
commit fbacfc149b
No known key found for this signature in database
21 changed files with 748 additions and 0 deletions

19
.nix/repo/benchmark.nix Normal file
View file

@ -0,0 +1,19 @@
{
inputs,
cell,
}: {
bench = inputs.nixpkgs.writeShellApplication {
name = "benchmark";
runtimeInputs = [inputs.nixpkgs.hyperfine];
text = ''
echo "Comparison cases first:"
hyperfine -w 3 \
'nix-instantiate ${inputs.self}/benchmark/shared.nix' \
'nix-instantiate ${inputs.self}/benchmark/empty.nix'
echo "Now real benchmark:"
hyperfine -w 3 \
'nix-instantiate ${inputs.self}/benchmark/nixpkgs-shell.nix' \
'nix-instantiate ${inputs.self}/benchmark/devshell.nix'
'';
};
}

17
.nix/repo/devShells.nix Normal file
View file

@ -0,0 +1,17 @@
{
inputs,
cell,
}: let
devshell = import "${inputs.self}/lib" {
pkgs = inputs.nixpkgs;
};
in {
default = devshell.mkShell {
packages = [inputs.nixpkgs.alejandra];
env."HELLO".value = "world!";
enterShellCommands.test = {
text = "echo Hello $HELLO";
deps = ["env"];
};
};
}

28
.nix/repo/flake.lock generated Normal file
View file

@ -0,0 +1,28 @@
{
"nodes": {
"nixtest-lib": {
"locked": {
"dir": "lib",
"lastModified": 1753957623,
"narHash": "sha256-kdImwKx57N0QL8HPUUb5ADwXFgSjaNOk39b/eKlzyTo=",
"owner": "TECHNOFAB",
"repo": "nixtest",
"rev": "22b43c9fe83be73c3f0648bbb54bc3c1cf7f96df",
"type": "gitlab"
},
"original": {
"dir": "lib",
"owner": "TECHNOFAB",
"repo": "nixtest",
"type": "gitlab"
}
},
"root": {
"inputs": {
"nixtest-lib": "nixtest-lib"
}
}
},
"root": "root",
"version": 7
}

6
.nix/repo/flake.nix Normal file
View file

@ -0,0 +1,6 @@
{
inputs = {
nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib";
};
outputs = i: i;
}

15
.nix/repo/tests.nix Normal file
View file

@ -0,0 +1,15 @@
{
inputs,
cell,
}: let
pkgs = inputs.nixpkgs;
ntlib = inputs.nixtest-lib.lib {inherit pkgs;};
devshell = import "${inputs.self}/lib" {inherit pkgs;};
in {
tests = ntlib.mkNixtest {
modules = ntlib.autodiscover {dir = "${inputs.self}/tests";};
args = {
inherit ntlib devshell pkgs;
};
};
}