chore: move .nix -> nix, remove unused flake input

This commit is contained in:
technofab 2025-09-15 10:48:33 +02:00
parent 695d36a457
commit 9cb2d2bef6
No known key found for this signature in database
8 changed files with 2 additions and 193 deletions

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

@ -0,0 +1,18 @@
{inputs, ...}: let
inherit (inputs) pkgs;
in {
bench = pkgs.writeShellApplication {
name = "benchmark";
runtimeInputs = [pkgs.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'
'';
};
}

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

@ -0,0 +1,14 @@
{inputs, ...}: let
inherit (inputs) pkgs devshell;
in {
default = devshell.mkShell {
packages = [
pkgs.alejandra
];
env."HELLO".value = "world!";
enterShellCommands.test = {
text = "echo Hello $HELLO";
deps = ["env"];
};
};
}

68
nix/repo/docs.nix Normal file
View file

@ -0,0 +1,68 @@
{inputs, ...}: let
inherit (inputs) pkgs devshell doclib;
roots = [
{
url = "https://gitlab.com/rensa-nix/devshell/-/blob/main/lib";
path = "${inputs.self}/lib";
}
];
optionsDoc = doclib.mkOptionDocs {
module = devshell.modules;
inherit roots;
};
optionsDocs = pkgs.runCommand "options-docs" {} ''
mkdir -p $out
ln -s ${optionsDoc} $out/options.md
'';
in
(doclib.mkDocs {
docs."default" = {
base = "${inputs.self}";
path = "${inputs.self}/docs";
material = {
enable = true;
colors = {
primary = "aqua";
accent = "blue";
};
umami = {
enable = false;
src = "https://analytics.tf/umami";
siteId = "";
domains = ["devshell.rensa.projects.tf"];
};
};
macros = {
enable = true;
includeDir = toString optionsDocs;
};
config = {
site_name = "Devshell";
repo_name = "rensa-nix/devshell";
repo_url = "https://gitlab.com/rensa-nix/devshell";
theme = {
logo = "images/logo.png";
icon.repo = "simple/gitlab";
favicon = "images/favicon.png";
};
nav = [
{"Introduction" = "index.md";}
{"Options" = "options.md";}
];
markdown_extensions = [
{
"pymdownx.highlight".pygments_lang_class = true;
}
"pymdownx.inlinehilite"
"pymdownx.snippets"
"pymdownx.superfences"
"pymdownx.escapeall"
"fenced_code"
];
};
};
}).packages
// {
inherit optionsDocs;
}

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

@ -0,0 +1,62 @@
{
"nodes": {
"mkdocs-material-umami": {
"locked": {
"lastModified": 1745840856,
"narHash": "sha256-1Ad1JTMQMP6YsoIKAA+SBCE15qWrYkGue9/lXOLnu9I=",
"owner": "technofab",
"repo": "mkdocs-material-umami",
"rev": "3ac9b194450f6b779c37b8d16fec640198e5cd0a",
"type": "gitlab"
},
"original": {
"owner": "technofab",
"repo": "mkdocs-material-umami",
"type": "gitlab"
}
},
"nixmkdocs": {
"locked": {
"dir": "lib",
"lastModified": 1755783537,
"narHash": "sha256-78lWSC3UzkpWYsnyncqbrE37gEIWLzejOeDyoBb6h5o=",
"owner": "TECHNOFAB",
"repo": "nixmkdocs",
"rev": "4fd5a351c54e005c4e8df7e23a8e4eec9d3b8cd1",
"type": "gitlab"
},
"original": {
"dir": "lib",
"owner": "TECHNOFAB",
"repo": "nixmkdocs",
"type": "gitlab"
}
},
"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": {
"mkdocs-material-umami": "mkdocs-material-umami",
"nixmkdocs": "nixmkdocs",
"nixtest-lib": "nixtest-lib"
}
}
},
"root": "root",
"version": 7
}

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

@ -0,0 +1,17 @@
{
inputs = {
nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib";
nixmkdocs.url = "gitlab:TECHNOFAB/nixmkdocs?dir=lib";
mkdocs-material-umami.url = "gitlab:technofab/mkdocs-material-umami";
};
outputs = i:
i
// {
ntlib = i.nixtest-lib.lib {inherit (i.parent) pkgs;};
doclib = i.nixmkdocs.lib {
inherit (i.parent) pkgs;
inherit (i.parent.pkgs) lib;
};
devshell = import "${i.parent.self}/lib" {inherit (i.parent) pkgs;};
};
}

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

@ -0,0 +1,10 @@
{inputs, ...}: let
inherit (inputs) pkgs ntlib devshell;
in {
tests = ntlib.mkNixtest {
modules = ntlib.autodiscover {dir = "${inputs.self}/tests";};
args = {
inherit ntlib devshell pkgs;
};
};
}