29 Commits

Author SHA1 Message Date
17bd8483c7 chore(release): 1.2.0
Some checks failed
Build and Deploy / nix-check (push) Has been cancelled
Build and Deploy / build-deploy-ubuntu (push) Successful in 34m19s
2025-09-17 18:41:14 -05:00
6a2a9b8c91 no banner needed here 2025-09-17 18:37:23 -05:00
21b3f6dbae try better caching at least
Some checks failed
Build and Deploy / build-deploy-ubuntu (push) Has been cancelled
Build and Deploy / nix-check (push) Has been cancelled
2025-09-17 18:19:29 -05:00
f0360c3bf9 ci: whoops
Some checks failed
Build and Deploy / build-deploy-ubuntu (push) Has been cancelled
Build and Deploy / nix-check (push) Has been cancelled
2025-09-17 17:37:07 -05:00
43b7694554 ci: Try caching in the nix build 2025-09-17 17:23:01 -05:00
daeb844fdf update inputs
Some checks failed
Build and Deploy / nix-check (push) Failing after 22m27s
Build and Deploy / build-deploy-ubuntu (push) Failing after 22m50s
2025-09-17 17:12:14 -05:00
980fab8e80 adding terraform and aws
Some checks failed
Build and Deploy / nix-check (push) Failing after 5m28s
Build and Deploy / build-deploy-ubuntu (push) Has been cancelled
2025-09-17 16:34:14 -05:00
991e6dc2d3 feat: update flakes and fix dependencies with nixpkgs follows
All checks were successful
Build and Deploy / nix-check (push) Successful in 7m36s
Build and Deploy / build-deploy-ubuntu (push) Successful in 12m36s
2025-08-13 10:41:20 -05:00
9b412d6fe3 fix: try removing the always allow substitutes config
All checks were successful
Build and Deploy / nix-check (push) Successful in 3m33s
Build and Deploy / build-deploy-ubuntu (push) Successful in 5m26s
2025-03-26 11:52:03 -05:00
0a4d71da9a feat: adds findutils
All checks were successful
Build and Deploy / nix-check (push) Successful in 3m17s
Build and Deploy / build-deploy-ubuntu (push) Successful in 6m49s
2025-03-25 16:16:24 -05:00
c6b8dcb19c ci: go back to building on ubuntu but also add a logging of directory
All checks were successful
Build and Deploy / nix-check (push) Successful in 2m38s
Build and Deploy / build-deploy-ubuntu (push) Successful in 7m34s
2025-03-25 12:35:54 -05:00
c9f8fb171f ci: Eat our own tails
Some checks failed
Build and Deploy / nix-check (push) Successful in 3m9s
Build and Deploy / build-deploy-ubuntu (push) Failing after 4m25s
2025-03-25 12:24:02 -05:00
4e1ece0f3a chore(release): 1.1.0
Some checks failed
Build and Deploy / nix-check (push) Successful in 2m18s
Build and Deploy / build-deploy-ubuntu (push) Has been cancelled
2025-03-25 12:19:12 -05:00
96266b8c06 feat: adds zstd for cache 2025-03-25 12:19:04 -05:00
ca5a032088 feat: adds ssh to our image
All checks were successful
Build and Deploy / build-deploy-ubuntu (push) Successful in 5m13s
Build and Deploy / nix-check (push) Successful in 2m4s
2025-03-22 17:26:53 -05:00
aad15b8fd6 feat: Adds some default dockertools env setup guys
All checks were successful
Build and Deploy / build-deploy-ubuntu (push) Successful in 5m14s
Build and Deploy / nix-check (push) Successful in 1m48s
2025-03-22 17:14:30 -05:00
64f85962f7 chore(release): 1.0.0
All checks were successful
Build and Deploy / build-deploy-ubuntu (push) Successful in 5m9s
Build and Deploy / nix-check (push) Successful in 1m32s
2025-03-22 16:41:15 -05:00
cec1960063 fix: whoops fixing invalid entry
All checks were successful
Build and Deploy / build-deploy-ubuntu (push) Successful in 5m11s
Build and Deploy / nix-check (push) Successful in 1m48s
2025-03-22 16:23:08 -05:00
00fe99405f fmt: formatting update
Some checks failed
Build and Deploy / build-deploy-ubuntu (push) Successful in 5m15s
Build and Deploy / nix-check (push) Failing after 24s
2025-03-22 16:15:31 -05:00
15d2307839 feat: adds more to nix.conf
Some checks failed
Build and Deploy / nix-check (push) Waiting to run
Build and Deploy / build-deploy-ubuntu (push) Has been cancelled
2025-03-22 16:15:07 -05:00
f99f9723f8 fix: Better formatting for nix.conf
Some checks failed
Build and Deploy / build-deploy-ubuntu (push) Failing after 4m26s
Build and Deploy / nix-check (push) Failing after 1m48s
2025-03-22 16:03:13 -05:00
896d56129a chore: add justfile exec command to get into container 2025-03-22 16:03:03 -05:00
1605f96066 feat: adds nix conf for experimental features into image
Some checks failed
Build and Deploy / build-deploy-ubuntu (push) Successful in 5m16s
Build and Deploy / nix-check (push) Failing after 2m15s
2025-03-22 15:56:29 -05:00
4e461f5a2e ci: add a thing that uses own image
Some checks failed
Build and Deploy / build-deploy-ubuntu (push) Successful in 4m58s
Build and Deploy / nix-check (push) Failing after 38s
2025-03-22 15:19:06 -05:00
a0bf7e332a feat: adds attic-client to docker image
All checks were successful
Build and Deploy / nix-check (push) Successful in 5m41s
2025-03-22 15:12:29 -05:00
526c10f483 chore(release): 0.2.0
All checks were successful
Build and Deploy / nix-check (push) Successful in 4m58s
2025-03-22 15:00:09 -05:00
b343d4cf2f ci: trying out adding toolcache
All checks were successful
Build and Deploy / nix-check (push) Successful in 4m47s
2025-03-22 14:53:36 -05:00
41912b1008 feat: adds node and uv as common tools
Some checks failed
Build and Deploy / nix-check (push) Has been cancelled
2025-03-22 14:48:24 -05:00
4dbab5c8e2 chore(release): 0.1.0
All checks were successful
Build and Deploy / nix-check (push) Successful in 6m52s
2025-03-22 13:51:06 -05:00
11 changed files with 264 additions and 83 deletions

View File

@@ -0,0 +1,107 @@
name: Build and Deploy
on:
push:
branches: [master]
# pull_request:
# branches: [master]
tags:
- '*.*.*'
jobs:
build-deploy-ubuntu:
# Is it a risk to Ouroboros this?
# Really want this to be able to run on ubuntu but it is a slow run.
runs-on: ubuntu-latest
# runs-on: nix-runner
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for tags
- name: Install Nix
uses: cachix/install-nix-action@7be5dee1421f63d07e71ce6e0a9f8a4b07c2a487
- name: "Cache Nix store"
uses: actions/cache@v4
id: nix-cache
with:
path: /tmp/nixcache
key: nix-${{ runner.os }}-nix-builder-image-${{ hashFiles('**/package.json', 'package-lock.json', '**/*.nix', '**/flake.lock') }}
restore-keys: |
nix-${{ runner.os }}-nix-builder-image
- name: Setup Attic Cache
uses: ryanccn/attic-action@3354ae812cb672e1381be4c7914204c44db53866
with:
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
cache: ${{ secrets.ATTIC_CACHE }}
token: ${{ secrets.ATTIC_TOKEN }}
- name: "Import Nix store cache"
continue-on-error: true
# if: "steps.nix-cache.outputs.cache-hit == 'true'"
run: bash scripts/restore_cache.sh
- name: Build container
run: nix build .#act-runner-image
- name: Check Nix flake
run: nix flake check
id: flake-check
- name: Build Docker image if flake check fails
if: steps.flake-check.outcome == 'failure'
run: |
just build
echo "::warning::Nix flake check failed, but Docker image build succeeded as fallback"
- name: Set deployment variables
id: vars
run: |
# Check if this is a tag build
if [[ ${{ github.ref_type }} == 'tag' ]]; then
echo "TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT
echo "BRANCH=master" >> $GITHUB_OUTPUT
else
echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Deploy Docker image
env:
REGISTRY: gitea.deepak.science
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
REPOSITORY: ${{ github.repository }}
TAG: ${{ steps.vars.outputs.TAG }}
BRANCH: ${{ steps.vars.outputs.BRANCH }}
run: |
nix develop -c bash scripts/deploy.sh
- name: "Export Nix store cache"
if: always()
# if: "steps.nix-cache.outputs.cache-hit != 'true'"
run: bash scripts/populate_cache.sh
nix-check:
runs-on: nix-runner
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for tags
- name: "Cache Nix store"
uses: actions/cache@v4
id: nix-cache
with:
path: /tmp/nixcache
key: nix-${{ runner.os }}-nix-builder-image-${{ hashFiles('**/package.json', 'package-lock.json', '**/*.nix', '**/flake.lock') }}
restore-keys: |
nix-${{ runner.os }}-nix-builder-image
- name: Setup Attic Cache
uses: ryanccn/attic-action@3354ae812cb672e1381be4c7914204c44db53866
with:
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
cache: ${{ secrets.ATTIC_CACHE }}
token: ${{ secrets.ATTIC_TOKEN }}
- name: "Import Nix store cache"
continue-on-error: true
# if: "steps.nix-cache.outputs.cache-hit == 'true'"
run: bash scripts/restore_cache.sh
- name: Build container
run: nix build .#act-runner-image
- name: Check Nix flake
run: nix flake check
id: flake-check
- name: "Export Nix store cache"
if: always()
# if: "steps.nix-cache.outputs.cache-hit != 'true'"
run: bash scripts/populate_cache.sh

View File

@@ -1,55 +0,0 @@
name: Build and Deploy
on:
push:
branches: [master]
# pull_request:
# branches: [master]
tags:
- '*.*.*'
jobs:
nix-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for tags
- name: Install Nix
uses: cachix/install-nix-action@v31
- name: Setup Attic Cache
uses: ryanccn/attic-action@3354ae812cb672e1381be4c7914204c44db53866
with:
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
cache: ${{ secrets.ATTIC_CACHE }}
token: ${{ secrets.ATTIC_TOKEN }}
- name: Build container
run: nix build .#act-runner-image
- name: Check Nix flake
run: nix flake check
continue-on-error: true
id: flake-check
- name: Build Docker image if flake check fails
if: steps.flake-check.outcome == 'failure'
run: |
just build
echo "::warning::Nix flake check failed, but Docker image build succeeded as fallback"
- name: Set deployment variables
id: vars
run: |
# Check if this is a tag build
if [[ ${{ github.ref_type }} == 'tag' ]]; then
echo "TAG=${{ github.ref_name }}" >> $GITHUB_OUTPUT
echo "BRANCH=master" >> $GITHUB_OUTPUT
else
echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Deploy Docker image
env:
REGISTRY: gitea.deepak.science
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
REPOSITORY: ${{ github.repository }}
TAG: ${{ steps.vars.outputs.TAG }}
BRANCH: ${{ steps.vars.outputs.BRANCH }}
run: |
nix develop -c bash scripts/deploy.sh

View File

@@ -2,6 +2,52 @@
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
## [1.2.0](https://gitea.deepak.science:2222/deepak/nix-builder-image/compare/1.1.0...1.2.0) (2025-09-17)
### Features
* adds findutils ([0a4d71d](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/0a4d71da9ad96da975744b6598e341abddcc075b))
* update flakes and fix dependencies with nixpkgs follows ([991e6dc](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/991e6dc2d3090f7cd07ec18fd2a7a72009f49d32))
### Bug Fixes
* try removing the always allow substitutes config ([9b412d6](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/9b412d6fe3c1a7b90e78a96b95e9910c047bf24c))
## [1.1.0](https://gitea.deepak.science:2222/deepak/nix-builder-image/compare/1.0.0...1.1.0) (2025-03-25)
### Features
* Adds some default dockertools env setup guys ([aad15b8](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/aad15b8fd664061cba0cd0bf564edfbd411c656e))
* adds ssh to our image ([ca5a032](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/ca5a03208862b4296b3fd9a4f89d9e62128bb5f4))
* adds zstd for cache ([96266b8](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/96266b8c066d7265429493467bb4c2c5ed046254))
## [1.0.0](https://gitea.deepak.science:2222/deepak/nix-builder-image/compare/0.2.0...1.0.0) (2025-03-22)
### Features
* adds attic-client to docker image ([a0bf7e3](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/a0bf7e332a1ec0aef658a4d6559831086a6e8b47))
* adds more to nix.conf ([15d2307](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/15d230783910b794e9075b5b15817f8aebf0902d))
* adds nix conf for experimental features into image ([1605f96](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/1605f960660c5bc32af82ccf9c3db6c47305ee17))
### Bug Fixes
* Better formatting for nix.conf ([f99f972](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/f99f9723f86ebf16aabd6f31093a6a795b5a8fa8))
* whoops fixing invalid entry ([cec1960](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/cec19600630a28eef566c50216cdb21fc68f9221))
## [0.2.0](https://gitea.deepak.science:2222/deepak/nix-builder-image/compare/0.1.0...0.2.0) (2025-03-22)
### Features
* adds node and uv as common tools ([41912b1](https://gitea.deepak.science:2222/deepak/nix-builder-image/commit/41912b100884d3c04e333beaf7cbebf58fb429be))
## [0.1.0](https://gitea.deepak.science:2222/deepak/nix-builder-image/compare/0.0.4...0.1.0) (2025-03-22)
## [0.0.4](https://gitea.deepak.science:2222/deepak/nix-builder-image/compare/0.0.3...0.0.4) (2025-03-22)
## [0.0.3](https://gitea.deepak.science:2222/deepak/nix-builder-image/compare/0.0.2...0.0.3) (2025-03-22)

32
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1742422364,
"narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=",
"lastModified": 1757745802,
"narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc",
"rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
"type": "github"
},
"original": {
@@ -16,22 +16,6 @@
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1735554305,
"narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0e82ab234249d8eee3e8c91437802b32c74bb3fd",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
@@ -40,14 +24,16 @@
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_2"
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1742370146,
"narHash": "sha256-XRE8hL4vKIQyVMDXykFh4ceo3KSpuJF3ts8GKwh5bIU=",
"lastModified": 1756662192,
"narHash": "sha256-F1oFfV51AE259I85av+MAia221XwMHCOtZCMcZLK2Jk=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "adc195eef5da3606891cedf80c0d9ce2d3190808",
"rev": "1aabc6c05ccbcbf4a635fb7a90400e44282f61c4",
"type": "github"
},
"original": {

View File

@@ -3,7 +3,10 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@@ -12,8 +15,14 @@
supportedSystems = [ "x86_64-linux" ];
pkgsFor =
system:
nixpkgs.legacyPackages.${system}.extend (
nixpkgs.lib.composeManyExtensions ([ dockerOverlay ])
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
pkgs.extend (
pkgs.lib.composeManyExtensions [ dockerOverlay ]
# nixpkgs.lib.composeManyExtensions ([ ] ++ builtins.attrValues self.overlays)
);
eachSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f (pkgsFor system));
@@ -56,10 +65,25 @@
# fromImage = "ghcr.io/catthehacker/ubuntu:runner-latest";
contents = [
# some stuff that dockertools provides?
pkgs.dockerTools.usrBinEnv
pkgs.dockerTools.binSh
pkgs.dockerTools.caCertificates
pkgs.dockerTools.fakeNss
# Get nix in there
pkgs.nix
(pkgs.writeTextDir "etc/nix/nix.conf" ''
experimental-features = nix-command flakes
build-users-group =
'')
# Base packages
pkgs.bash
pkgs.coreutils
pkgs.nix
# for the actions/cache need the find command
pkgs.findutils
pkgs.cacert
pkgs.curl
pkgs.gitReallyMinimal
@@ -67,6 +91,14 @@
pkgs.gzip
pkgs.gnused
pkgs.gnugrep
pkgs.attic-client
pkgs.openssh
# zstd needed for cache-nix-action I believe
pkgs.zstd
# Tools we need to get some common actions running
pkgs.nodejs
pkgs.uv
# runner
pkgs.gitea-actions-runner
@@ -75,6 +107,8 @@
# pkgs.docker
# pkgs.docker-compose
pkgs.jq
pkgs.terraform
pkgs.awscli2
];
config = {

View File

@@ -56,3 +56,9 @@ release version="":
else
./scripts/release.sh
fi
# Exec into the most recently built version
exec:
#!/usr/bin/env bash
set -euxo pipefail
docker run -it nix-gitea-act-runner /bin/bash

View File

@@ -15,6 +15,9 @@ banner() {
echo "========================================================"
}
echo "List what we start with"
ls -alh
banner "Deploying Docker image to registry"
# Check if result file exists

38
scripts/populate_cache.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -Eeuox pipefail
CACHE_PATH=${CACHE_PATH:-"/tmp/nixcache"}
banner() {
echo "========================================================"
echo " $*"
echo "========================================================"
}
banner "List what we start with"
nix-store --query --requisites --include-outputs "$(nix eval .\#devShells.x86_64-linux.default.drvPath --raw)" >dependencies.txt
nix-store --query --requisites --include-outputs "$(nix eval .\#packages.x86_64-linux.default.drvPath --raw)" >>dependencies.txt
# nix-store --query --requisites --include-outputs "$(nix eval .\#checks.x86_64-linux.formatting.drvPath --raw)" >>dependencies.txt
# nix-store --query --requisites --include-outputs "$(nix eval .\#checks.x86_64-linux.test-check.drvPath --raw)" >>dependencies.txt
nix-store --query --requisites --include-outputs "$(nix eval .\#formatter.x86_64-linux.drvPath --raw)" >>dependencies.txt
sort -o dependencies.txt -u dependencies.txt
banner "list obtained paths to cache"
wc -l dependencies.txt
banner "filter out our matches"
echo "Using filter"
cat scripts/populate_cache_exclude_patterns.txt
grep -vf scripts/populate_cache_exclude_patterns.txt dependencies.txt >filtered_dependencies.txt
echo "Count our filtered"
wc -l filtered_dependencies.txt
xargs <filtered_dependencies.txt -r nix copy --to "file://${CACHE_PATH}" --no-substitute
banner "done with populating cache"

16
scripts/restore_cache.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -Eeuo pipefail
CACHE_PATH=${CACHE_PATH:-"/tmp/nixcache"}
banner() {
echo "========================================================"
echo " $*"
echo "========================================================"
}
# banner "List what we start with"
# ls -alh "${CACHE_PATH}"
banner "Copy time"
nix copy --from "file://${CACHE_PATH}" --no-check-sigs --all

View File

@@ -1 +1 @@
0.0.4
1.2.0