mirror of
https://gitlab.com/rensa-nix/devtools.git
synced 2025-12-12 14:20:08 +01:00
chore: initial commit
This commit is contained in:
commit
db488d8f41
26 changed files with 1077 additions and 0 deletions
34
nix/repo/ci.nix
Normal file
34
nix/repo/ci.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs) cilib;
|
||||
in
|
||||
cilib.mkCI {
|
||||
pipelines."default" = {
|
||||
stages = ["build" "deploy"];
|
||||
jobs = {
|
||||
"docs" = {
|
||||
stage = "build";
|
||||
script = [
|
||||
# sh
|
||||
''
|
||||
nix build .#docs:default
|
||||
mkdir -p public
|
||||
cp -r result/. public/
|
||||
''
|
||||
];
|
||||
artifacts.paths = ["public"];
|
||||
};
|
||||
"pages" = {
|
||||
nix.enable = false;
|
||||
image = "alpine:latest";
|
||||
stage = "deploy";
|
||||
script = ["true"];
|
||||
artifacts.paths = ["public"];
|
||||
rules = [
|
||||
{
|
||||
"if" = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
60
nix/repo/devShells.nix
Normal file
60
nix/repo/devShells.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
inputs,
|
||||
cell,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs) self pkgs devshell soonix treefmt;
|
||||
inherit (cell) ci;
|
||||
|
||||
treefmtWrapper = treefmt.mkWrapper pkgs {
|
||||
programs = {
|
||||
alejandra.enable = true;
|
||||
deadnix.enable = true;
|
||||
statix.enable = true;
|
||||
mdformat.enable = true;
|
||||
};
|
||||
};
|
||||
in {
|
||||
default = devshell.mkShell {
|
||||
imports = [
|
||||
"${self}/lib/modules"
|
||||
soonix.devshellModule
|
||||
];
|
||||
soonix.hooks.ci = ci.soonix;
|
||||
packages = [
|
||||
pkgs.hello
|
||||
treefmtWrapper
|
||||
];
|
||||
|
||||
task = {
|
||||
alias = ",";
|
||||
tasks = {
|
||||
"hello" = {
|
||||
cmd = "echo world!";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lefthook.config = {
|
||||
skip_output = ["meta" "execution_out"];
|
||||
"pre-commit" = {
|
||||
parallel = true;
|
||||
jobs = [
|
||||
{
|
||||
name = "treefmt";
|
||||
stage_fixed = true;
|
||||
run = "${treefmtWrapper}/bin/treefmt";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
cocogitto.config.changelog = {
|
||||
path = "CHANGELOG.md";
|
||||
template = "remote";
|
||||
remote = "gitlab.com";
|
||||
repository = "devtools";
|
||||
owner = "rensa-nix";
|
||||
};
|
||||
};
|
||||
}
|
||||
68
nix/repo/docs.nix
Normal file
68
nix/repo/docs.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs) pkgs devtools doclib;
|
||||
|
||||
optionsDoc = doclib.mkOptionDocs {
|
||||
module = devtools.devshellModule;
|
||||
roots = [
|
||||
{
|
||||
url = "https://gitlab.com/rensa-nix/devtools/-/blob/main/lib";
|
||||
path = "${inputs.self}/lib";
|
||||
}
|
||||
];
|
||||
};
|
||||
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 = "red";
|
||||
accent = "red";
|
||||
};
|
||||
umami = {
|
||||
enable = true;
|
||||
src = "https://analytics.tf/umami";
|
||||
siteId = "db90861a-0b7f-4654-b7ca-f45ce80c44b3";
|
||||
domains = ["devtools.rensa.projects.tf"];
|
||||
};
|
||||
};
|
||||
macros = {
|
||||
enable = true;
|
||||
includeDir = toString optionsDocs;
|
||||
};
|
||||
config = {
|
||||
site_name = "Devtools";
|
||||
repo_name = "rensa-nix/devtools";
|
||||
repo_url = "https://gitlab.com/rensa-nix/devtools";
|
||||
extra_css = ["style.css"];
|
||||
theme = {
|
||||
logo = "images/logo.svg";
|
||||
icon.repo = "simple/gitlab";
|
||||
favicon = "images/logo.svg";
|
||||
};
|
||||
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;
|
||||
}
|
||||
118
nix/repo/flake.lock
generated
Normal file
118
nix/repo/flake.lock
generated
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
{
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1755673398,
|
||||
"narHash": "sha256-51MmR+Eo1+bKDd/Ss77wwTqi4yAR2xgmyCSEbKWSpj0=",
|
||||
"owner": "rensa-nix",
|
||||
"repo": "devshell",
|
||||
"rev": "e76bef387e8a4574f9b6d37b1a424e706491af08",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "rensa-nix",
|
||||
"repo": "devshell",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"nix-gitlab-ci-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1756974596,
|
||||
"narHash": "sha256-KxQj76sUqvPNtrqzNWMZeOWqTitc0aFCYj7UZzToiEA=",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nix-gitlab-ci",
|
||||
"rev": "00cf5b83c6c46698fba12a54b9cc15c6d4e5a4dd",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "TECHNOFAB",
|
||||
"ref": "3.0.0-alpha.2",
|
||||
"repo": "nix-gitlab-ci",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"nixmkdocs": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1757055638,
|
||||
"narHash": "sha256-KHYSkEreFe4meXzSdEbknC/HwaQSNClQkc8vzHlAsMM=",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nixmkdocs",
|
||||
"rev": "7840a5febdbeaf2da90babf6c94b3d0929d2bf74",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nixmkdocs",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"nixtest-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1756812148,
|
||||
"narHash": "sha256-0g8KNk4zoLApA51PBHOWqPLRYpprjrQuSzNCjfBQgu8=",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nixtest",
|
||||
"rev": "5741109cc9ec2b6d41b56abd3f5bc51ed7a9a228",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nixtest",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"nix-gitlab-ci-lib": "nix-gitlab-ci-lib",
|
||||
"nixmkdocs": "nixmkdocs",
|
||||
"nixtest-lib": "nixtest-lib",
|
||||
"soonix-lib": "soonix-lib",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
}
|
||||
},
|
||||
"soonix-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1757424411,
|
||||
"narHash": "sha256-x99obZwqDAhUB+VUhAV9sKH00NnsVi481n/8bdvZCUY=",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "soonix",
|
||||
"rev": "add807ef8980197bbd06652a36d937b93b2a31c7",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "soonix",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1756662192,
|
||||
"narHash": "sha256-F1oFfV51AE259I85av+MAia221XwMHCOtZCMcZLK2Jk=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "1aabc6c05ccbcbf4a635fb7a90400e44282f61c4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
24
nix/repo/flake.nix
Normal file
24
nix/repo/flake.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
inputs = {
|
||||
nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib";
|
||||
nixmkdocs.url = "gitlab:TECHNOFAB/nixmkdocs?dir=lib";
|
||||
devshell.url = "gitlab:rensa-nix/devshell?dir=lib";
|
||||
soonix-lib.url = "gitlab:TECHNOFAB/soonix?dir=lib";
|
||||
nix-gitlab-ci-lib.url = "gitlab:TECHNOFAB/nix-gitlab-ci/3.0.0-alpha.2?dir=lib";
|
||||
treefmt-nix = {
|
||||
url = "github:numtide/treefmt-nix";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
outputs = i:
|
||||
i
|
||||
// {
|
||||
ntlib = i.nixtest-lib.lib {inherit (i.parent) pkgs;};
|
||||
doclib = i.nixmkdocs.lib {inherit (i.parent) pkgs;};
|
||||
devshell = i.devshell.lib {inherit (i.parent) pkgs;};
|
||||
soonix = i.soonix-lib.lib {inherit (i.parent) pkgs;};
|
||||
cilib = i.nix-gitlab-ci-lib.lib {inherit (i.parent) pkgs;};
|
||||
devtools = import "${i.parent.self}/lib" {inherit (i.parent) pkgs;};
|
||||
treefmt = import i.treefmt-nix;
|
||||
};
|
||||
}
|
||||
10
nix/repo/tests.nix
Normal file
10
nix/repo/tests.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs) pkgs ntlib devshell;
|
||||
in {
|
||||
tests = ntlib.mkNixtest {
|
||||
modules = ntlib.autodiscover {dir = "${inputs.self}/lib/modules";};
|
||||
args = {
|
||||
inherit ntlib devshell pkgs;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue