mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-11 01:30:08 +01:00
chore: add examples for flake-parts and rensa-nix
This commit is contained in:
parent
537d5c7c87
commit
46bb4fe455
7 changed files with 283 additions and 0 deletions
95
examples/flake-parts/flake.lock
generated
Normal file
95
examples/flake-parts/flake.lock
generated
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1756770412,
|
||||
"narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "4524271976b625a4a605beefd893f270620fd751",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-gitlab-ci": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1752052838,
|
||||
"narHash": "sha256-EqP4xB8YTVXWPCCchnVtQbuq0bKa79TUEcPF3hjuX/k=",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nix-gitlab-ci",
|
||||
"rev": "0c6949f585a2c1ea2cf85fc01445496f7c75faae",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nix-gitlab-ci",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1756696532,
|
||||
"narHash": "sha256-6FWagzm0b7I/IGigOv9pr6LL7NQ86mextfE8g8Q6HBg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "58dcbf1ec551914c3756c267b8b9c8c86baa1b2f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1754788789,
|
||||
"narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "a73b9c743612e4244d865a2fdee11865283c04e6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nix-gitlab-ci": "nix-gitlab-ci",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1689347949,
|
||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
39
examples/flake-parts/flake.nix
Normal file
39
examples/flake-parts/flake.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
outputs = {
|
||||
flake-parts,
|
||||
systems,
|
||||
...
|
||||
} @ inputs:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
imports = [
|
||||
inputs.nix-gitlab-ci.flakeModule
|
||||
];
|
||||
systems = import systems;
|
||||
flake = {};
|
||||
perSystem = _: {
|
||||
ci = {
|
||||
pipelines = {
|
||||
"default" = {
|
||||
stages = ["example"];
|
||||
jobs."example" = {
|
||||
stage = "example";
|
||||
script = ["echo hello world"];
|
||||
};
|
||||
};
|
||||
"test".jobs."example" = {
|
||||
stage = ".pre";
|
||||
script = ["echo hello world"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
systems.url = "github:nix-systems/default-linux";
|
||||
# NOTE: better pin to a version
|
||||
nix-gitlab-ci.url = "gitlab:TECHNOFAB/nix-gitlab-ci?dir=lib";
|
||||
};
|
||||
}
|
||||
63
examples/rensa-nix/flake.lock
generated
Normal file
63
examples/rensa-nix/flake.lock
generated
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1756542300,
|
||||
"narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d7600c775f877cd87b4f5a831c28aa94137377aa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1754184128,
|
||||
"narHash": "sha256-AjhoyBL4eSyXf01Bmc6DiuaMrJRNdWopmdnMY0Pa/M0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "02e72200e6d56494f4a7c0da8118760736e41b60",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ren": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1756370106,
|
||||
"narHash": "sha256-l84ojcHuQWBwn4BRxQsMMfQpcq/Az/sHh/hSqFgVtyg=",
|
||||
"owner": "rensa-nix",
|
||||
"repo": "core",
|
||||
"rev": "9c1a29fa9ba7cbbb78b9e47eb8afbcd29303a3b4",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "rensa-nix",
|
||||
"repo": "core",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"ren": "ren"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
30
examples/rensa-nix/flake.nix
Normal file
30
examples/rensa-nix/flake.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
ren.url = "gitlab:rensa-nix/core?dir=lib";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
ren,
|
||||
...
|
||||
} @ inputs:
|
||||
ren.buildWith
|
||||
{
|
||||
inherit inputs;
|
||||
cellsFrom = ./nix;
|
||||
transformInputs = system: i:
|
||||
i
|
||||
// {
|
||||
pkgs = import i.nixpkgs {inherit system;};
|
||||
};
|
||||
cellBlocks = with ren.blocks; [
|
||||
(simple "ci")
|
||||
];
|
||||
}
|
||||
{
|
||||
packages = ren.select self [
|
||||
["repo" "ci" "packages"]
|
||||
];
|
||||
};
|
||||
}
|
||||
18
examples/rensa-nix/nix/repo/ci.nix
Normal file
18
examples/rensa-nix/nix/repo/ci.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs) cilib;
|
||||
in
|
||||
cilib.mkCI {
|
||||
pipelines = {
|
||||
"default" = {
|
||||
stages = ["example"];
|
||||
jobs."example" = {
|
||||
stage = "example";
|
||||
script = ["echo hello world"];
|
||||
};
|
||||
};
|
||||
"test".jobs."example" = {
|
||||
stage = ".pre";
|
||||
script = ["echo hello world"];
|
||||
};
|
||||
};
|
||||
}
|
||||
28
examples/rensa-nix/nix/repo/flake.lock
generated
Normal file
28
examples/rensa-nix/nix/repo/flake.lock
generated
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nix-gitlab-ci-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1752052838,
|
||||
"narHash": "sha256-EqP4xB8YTVXWPCCchnVtQbuq0bKa79TUEcPF3hjuX/k=",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nix-gitlab-ci",
|
||||
"rev": "0c6949f585a2c1ea2cf85fc01445496f7c75faae",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nix-gitlab-ci",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nix-gitlab-ci-lib": "nix-gitlab-ci-lib"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
10
examples/rensa-nix/nix/repo/flake.nix
Normal file
10
examples/rensa-nix/nix/repo/flake.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
inputs = {
|
||||
nix-gitlab-ci-lib.url = "gitlab:TECHNOFAB/nix-gitlab-ci?dir=lib";
|
||||
};
|
||||
outputs = i:
|
||||
i
|
||||
// {
|
||||
cilib = i.nix-gitlab-ci-lib.lib {inherit (i.parent) pkgs;};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue