chore: add CI

This commit is contained in:
technofab 2025-09-17 14:30:50 +02:00
parent 9c1a29fa9b
commit 39af3af902
No known key found for this signature in database
6 changed files with 94 additions and 3 deletions

5
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,5 @@
# Generated by soonix, DO NOT EDIT
include:
- component: gitlab.com/TECHNOFAB/nix-gitlab-ci/nix-gitlab-ci@3.0.0-alpha.2
inputs:
version: 3.0.0-alpha.2

34
cells/repo/ci.nix Normal file
View 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";
}
];
};
};
};
}

View file

@ -1,7 +1,13 @@
{inputs, ...}: let
inherit (inputs) pkgs dslib treefmt;
{
inputs,
cell,
...
}: let
inherit (inputs) pkgs dslib soonix treefmt;
inherit (cell) ci;
in {
default = dslib.mkShell {
imports = [soonix.devshellModule];
packages = [
(treefmt.mkWrapper pkgs {
programs = {
@ -12,5 +18,6 @@ in {
})
];
enterShellCommands."ren".text = "echo Hello rensa!";
soonix.hooks.ci = ci.soonix;
};
}

37
cells/repo/flake.lock generated
View file

@ -17,6 +17,24 @@
"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",
@ -37,10 +55,29 @@
"root": {
"inputs": {
"devshell": "devshell",
"nix-gitlab-ci-lib": "nix-gitlab-ci-lib",
"nixmkdocs": "nixmkdocs",
"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": {

View file

@ -2,6 +2,8 @@
inputs = {
devshell.url = "gitlab:rensa-nix/devshell?dir=lib";
nixmkdocs.url = "gitlab:TECHNOFAB/nixmkdocs?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;
@ -13,6 +15,8 @@
// {
dslib = i.devshell.lib {inherit (i.parent) pkgs;};
doclib = i.nixmkdocs.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;};
treefmt = import i.treefmt-nix;
};
}

View file

@ -21,8 +21,12 @@
(simple "test")
(simple "devShells")
(simple "docs")
(simple "ci")
];
} {
packages = rensa.select inputs.self ["repo" "docs"];
packages = rensa.select inputs.self [
["repo" "docs"]
["repo" "ci" "packages"]
];
};
}