diff --git a/.gitea/workflows/build-stable.yml b/.gitea/workflows/build-stable.yml new file mode 100644 index 0000000..6234786 --- /dev/null +++ b/.gitea/workflows/build-stable.yml @@ -0,0 +1,30 @@ +name: nix docker build stable + +on: + push: + branches: [main] + pull_request: + types: [opened, reopened, synchronize] + +jobs: + amd64: + runs-on: [ nix-flakes, amd64-builder ] + steps: + - name: System Info + run: uname -m + + - name: Setup + run: | + apt update -y + apt install -y curl gnupg + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt install -y nodejs + + - name: Checkout + uses: actions/checkout@v5 + + - name: Build + run: | + cd stable-with-flakes + nix build .#nixos-stable + cd .. diff --git a/.gitea/workflows/build-unstable.yml b/.gitea/workflows/build-unstable.yml new file mode 100644 index 0000000..4b39b94 --- /dev/null +++ b/.gitea/workflows/build-unstable.yml @@ -0,0 +1,30 @@ +name: nix docker build unstable + +on: + push: + branches: [main] + pull_request: + types: [opened, reopened, synchronize] + +jobs: + amd64: + runs-on: [ nix-flakes, amd64-builder ] + steps: + - name: System Info + run: uname -m + + - name: Setup + run: | + apt update -y + apt install -y curl gnupg + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt install -y nodejs + + - name: Checkout + uses: actions/checkout@v5 + + - name: Build + run: | + cd unstable-with-flakes + nix build .#nixos-unstable + cd .. diff --git a/stable-with-flakes/flake.lock b/stable-with-flakes/flake.lock new file mode 100644 index 0000000..6c592f5 --- /dev/null +++ b/stable-with-flakes/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1769205177, + "narHash": "sha256-pN5H8TLUiUlnEHr/vbR/jTnBPrgEXYYDSrSQZkBm0EU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0a76d26c26ad7d63ac32ae910a5ca15003a4ec80", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/stable-with-flakes/flake.nix b/stable-with-flakes/flake.nix new file mode 100644 index 0000000..0cc300c --- /dev/null +++ b/stable-with-flakes/flake.nix @@ -0,0 +1,31 @@ +{ + description = "Simple Nix Docker image based on a stable release"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/release-25.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.nixos-stable = pkgs.dockerTools.buildImage { + name = "nixos-stable"; + tag = "0.1.0"; + + config = { + Cmd = [ + "${pkgs.hello}/bin/hello" + ]; + Env = [ + "NIX_CONFIG=extra-experimental-features = nix-command flakes" + ]; + }; + created = "now"; + }; + + devShells.default = + pkgs.mkShell { buildInputs = with pkgs; [ hello ]; }; + }); +} diff --git a/unstable-with-flakes/flake.lock b/unstable-with-flakes/flake.lock new file mode 100644 index 0000000..57216d5 --- /dev/null +++ b/unstable-with-flakes/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1769018530, + "narHash": "sha256-MJ27Cy2NtBEV5tsK+YraYr2g851f3Fl1LpNHDzDX15c=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "88d3861acdd3d2f0e361767018218e51810df8a1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/unstable-with-flakes/flake.nix b/unstable-with-flakes/flake.nix new file mode 100644 index 0000000..713703f --- /dev/null +++ b/unstable-with-flakes/flake.nix @@ -0,0 +1,31 @@ +{ + description = "Simple Nix Docker image based on unstable"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.nixos-unstable = pkgs.dockerTools.buildImage { + name = "nixos-unstable"; + tag = "0.1.0"; + + config = { + Cmd = [ + "${pkgs.hello}/bin/hello" + ]; + Env = [ + "NIX_CONFIG=extra-experimental-features = nix-command flakes" + ]; + }; + created = "now"; + }; + + devShells.default = + pkgs.mkShell { buildInputs = with pkgs; [ hello ]; }; + }); +}