add CI images to repo
This commit is contained in:
parent
abce966b76
commit
5b1b13dcfb
7 changed files with 75 additions and 1 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
|
||||
16
.forgejo/workflows/images.yaml
Normal file
16
.forgejo/workflows/images.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
on: [push]
|
||||
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
|
||||
|
|
@ -13,7 +13,8 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
- name: check
|
||||
- uses: DeterminateSystems/flakehub-cache-action@main
|
||||
- name: nix flake check
|
||||
run: nix flake check
|
||||
- name: Run `nix bundle`
|
||||
if: github.ref == 'refs/heads/main'
|
||||
|
|
|
|||
|
|
@ -7,5 +7,6 @@
|
|||
nativeBuildInputs = [ pkgs.jujutsu ];
|
||||
doCheck = false;
|
||||
};
|
||||
nix-with-node = import ./nix-with-node { inherit pkgs; };
|
||||
}
|
||||
// import ./nvim { inherit inputs pkgs; }
|
||||
|
|
|
|||
38
pkgs/nix-with-node/default.nix
Normal file
38
pkgs/nix-with-node/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ pkgs, ... }:
|
||||
pkgs.dockerTools.buildLayeredImage {
|
||||
name = "nix-with-node";
|
||||
contents = with pkgs; [
|
||||
./root
|
||||
bashInteractive
|
||||
cacert
|
||||
coreutils
|
||||
git
|
||||
gnutar
|
||||
gzip
|
||||
jq
|
||||
nix
|
||||
nodejs
|
||||
openssh
|
||||
shadow
|
||||
xz
|
||||
];
|
||||
|
||||
config = {
|
||||
Cmd = [ "/bin/bash" ];
|
||||
WorkingDir = "/home/nixbld";
|
||||
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 nixbld
|
||||
'';
|
||||
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