add CI images to repo
This commit is contained in:
parent
abce966b76
commit
66aab336ee
8 changed files with 108 additions and 10 deletions
14
.forgejo/default-policy.json
Normal file
14
.forgejo/default-policy.json
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"default": [
|
||||||
|
{
|
||||||
|
"type": "insecureAcceptAnything"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transports":
|
||||||
|
{
|
||||||
|
"docker-daemon":
|
||||||
|
{
|
||||||
|
"": [{"type":"insecureAcceptAnything"}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1
.forgejo/tags.txt
Normal file
1
.forgejo/tags.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
nix-with-node:nix
|
||||||
21
.forgejo/workflows/images.yaml
Normal file
21
.forgejo/workflows/images.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * 0"
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: nix-upstream-latest
|
||||||
|
steps:
|
||||||
|
- run: echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
||||||
|
- run: nix-env -i nodejs skopeo # bootstrap
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: mkdir -p /etc/containers && cp .forgejo/default-policy.json /etc/containers/policy.json
|
||||||
|
- run: |-
|
||||||
|
for line in $(cat .forgejo/tags.txt); do
|
||||||
|
IFS=: read -r pkg tag <<< $line
|
||||||
|
cp $(nix build .#$pkg --print-out-paths) /tmp/img.tar.gz
|
||||||
|
gunzip /tmp/img.tar.gz
|
||||||
|
skopeo copy --dest-creds="${{ secrets.FJ_USER }}:${{ secrets.FJ_PASS }}" docker-archive:///tmp/img.tar docker://git.10110110.xyz/ci/$tag:latest
|
||||||
|
done
|
||||||
|
|
@ -2,23 +2,22 @@ name: build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [main]
|
||||||
- main
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
nvim-bundle:
|
||||||
runs-on: nix-latest
|
runs-on: nix-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
package_name: ["nvim"]
|
package_name: ["nvim"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
- name: nix flake check
|
||||||
- name: check
|
|
||||||
run: nix flake check
|
run: nix flake check
|
||||||
- name: Run `nix bundle`
|
- name: Run `nix bundle`
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
|
groups nixbld1
|
||||||
nix bundle \
|
nix bundle \
|
||||||
-o ${{ matrix.package_name }}.AppImage \
|
-o ${{ matrix.package_name }}.AppImage \
|
||||||
--bundler github:ralismark/nix-appimage \
|
--bundler github:ralismark/nix-appimage \
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
{ host, config, pkgs, ... }:
|
{
|
||||||
|
host,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
@ -21,17 +26,32 @@
|
||||||
25565 # mc
|
25565 # mc
|
||||||
25566 # mc
|
25566 # mc
|
||||||
];
|
];
|
||||||
|
interfaces."podman+" = {
|
||||||
|
allowedTCPPorts = [ 33393 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
virtualisation.docker = {
|
};
|
||||||
|
virtualisation.podman = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraOptions = "--dns 1.1.1.1";
|
|
||||||
};
|
};
|
||||||
services.gitea-actions-runner = {
|
services.gitea-actions-runner = {
|
||||||
package = pkgs.forgejo-runner;
|
package = pkgs.forgejo-runner;
|
||||||
instances.default = {
|
instances.default = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = host.hostName;
|
name = host.hostName;
|
||||||
|
settings = {
|
||||||
|
runner = {
|
||||||
|
capacity = 3;
|
||||||
|
};
|
||||||
|
cache = {
|
||||||
|
enable = true;
|
||||||
|
host = "host.containers.internal";
|
||||||
|
port = 33393;
|
||||||
|
};
|
||||||
|
container = {
|
||||||
|
force_pull = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
url = "https://git.10110110.xyz";
|
url = "https://git.10110110.xyz";
|
||||||
tokenFile = config.sops.secrets.forgejo-runner.path;
|
tokenFile = config.sops.secrets.forgejo-runner.path;
|
||||||
labels = [
|
labels = [
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,6 @@
|
||||||
nativeBuildInputs = [ pkgs.jujutsu ];
|
nativeBuildInputs = [ pkgs.jujutsu ];
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
};
|
};
|
||||||
|
nix-with-node = import ./nix-with-node { inherit pkgs; };
|
||||||
}
|
}
|
||||||
// import ./nvim { inherit inputs pkgs; }
|
// import ./nvim { inherit inputs pkgs; }
|
||||||
|
|
|
||||||
39
pkgs/nix-with-node/default.nix
Normal file
39
pkgs/nix-with-node/default.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
pkgs.dockerTools.buildLayeredImage {
|
||||||
|
name = "nix-with-node";
|
||||||
|
contents = with pkgs; [
|
||||||
|
./root
|
||||||
|
bashInteractive
|
||||||
|
cacert
|
||||||
|
coreutils
|
||||||
|
git
|
||||||
|
gnutar
|
||||||
|
gzip
|
||||||
|
jq
|
||||||
|
nix
|
||||||
|
nodejs
|
||||||
|
openssh
|
||||||
|
shadow
|
||||||
|
xz
|
||||||
|
pkgs.dockerTools.fakeNss
|
||||||
|
];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
Cmd = [ "/bin/bash" ];
|
||||||
|
WorkingDir = "/home/nixbld1";
|
||||||
|
Env = [
|
||||||
|
"ENV=/etc/profile.d/nix.sh"
|
||||||
|
"NIX_BUILD_SHELL=/bin/bash"
|
||||||
|
"PATH=/usr/bin:/bin"
|
||||||
|
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||||
|
"USER=root"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
fakeRootCommands = ''
|
||||||
|
${pkgs.dockerTools.shadowSetup}
|
||||||
|
groupadd -r nixbld
|
||||||
|
useradd -r -g nixbld nixbld1
|
||||||
|
'';
|
||||||
|
enableFakechroot = true;
|
||||||
|
}
|
||||||
3
pkgs/nix-with-node/root/etc/nix/nix.conf
Normal file
3
pkgs/nix-with-node/root/etc/nix/nix.conf
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
accept-flake-config = true
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
max-jobs = auto
|
||||||
Loading…
Add table
Add a link
Reference in a new issue