From 8ea65c3f21c393350c92617a9c62a83518888eeb Mon Sep 17 00:00:00 2001 From: iofq Date: Sat, 27 Sep 2025 14:44:02 -0500 Subject: [PATCH] init --- .forgejo/workflows/main.yaml | 12 ++++++++++ .gitignore | 1 + flake.lock | 25 ++++++++++++++++++++ flake.nix | 45 ++++++++++++++++++++++++++++++++++++ pkgs/nix-with-node.nix | 10 ++++++++ result | 1 + tags.txt | 1 + 7 files changed, 95 insertions(+) create mode 100644 .forgejo/workflows/main.yaml create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 pkgs/nix-with-node.nix create mode 120000 result create mode 100644 tags.txt diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml new file mode 100644 index 0000000..f7abaf1 --- /dev/null +++ b/.forgejo/workflows/main.yaml @@ -0,0 +1,12 @@ +on: [push] +jobs: + check: + runs-on: nix-upstream-latest + steps: + - run: nix develop + - uses: actions/checkout@v4 + - run: |- + for line in tags.txt; do + IFS=: read -r pkg tag <<< $line + skopeo copy --dst-creds="${{ secrets.FJ_USER }}:${{ secrets.FJ_PASS }}" docker-image://$(nix-build -A $pkg --no-out-link) docker://git.10110110.xyz/ci/$tag + done diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..41e7259 --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1758791193, + "narHash": "sha256-F8WmEwFoHsnix7rt290R0rFXNJiMbClMZyIC/e+HYf0=", + "rev": "25e53aa156d47bad5082ff7618f5feb1f5e02d01", + "revCount": 810395, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.810395%2Brev-25e53aa156d47bad5082ff7618f5feb1f5e02d01/01998694-ad17-7fa8-8c3a-c8bc31d19657/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2aa0493 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "git.10110110.xyz forgejo actions"; + inputs = { + nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0"; + }; + outputs = + { self, ... }@inputs: + let + supportedSystems = [ + "x86_64-linux" # 64-bit Intel/AMD Linux + ]; + + forEachSupportedSystem = + f: + inputs.nixpkgs.lib.genAttrs supportedSystems ( + system: + f { + pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + }; + } + ); + + in + { + packages = forEachSupportedSystem ( + { pkgs }: + { + nix-with-node = (import ./pkgs/nix-with-node.nix { inherit pkgs; }); + } + ); + devShells = forEachSupportedSystem ( + { pkgs }: + { + default = pkgs.mkShell { + packages = with pkgs; [ + skopeo + nodejs + ]; + }; + } + ); + }; +} diff --git a/pkgs/nix-with-node.nix b/pkgs/nix-with-node.nix new file mode 100644 index 0000000..64343ea --- /dev/null +++ b/pkgs/nix-with-node.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +pkgs.dockerTools.buildLayeredImage { + name = "nix-with-node"; + contents = with pkgs; [ + nix + nodejs + bash + git + ]; +} diff --git a/result b/result new file mode 120000 index 0000000..fc9069d --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/mi761m6y1gg54xj0nb1k1h9x18qxvsw1-nix-with-node.tar.gz \ No newline at end of file diff --git a/tags.txt b/tags.txt new file mode 100644 index 0000000..67a8c8a --- /dev/null +++ b/tags.txt @@ -0,0 +1 @@ +nix-with-node:nix-ci