Skip to content

Commit e4c899e

Browse files
committed
Add dapper support
1 parent ccd883e commit e4c899e

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/target
22

33
/result-bin
4+
5+
/bin

Dockerfile.dapper

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM nixos/nix
2+
3+
RUN echo experimental-features = \
4+
flakes \
5+
nix-command \
6+
>> /etc/nix/nix.conf
7+
8+
RUN echo substituters = \
9+
https://cache.nixos.org \
10+
https://whslabs.cachix.org \
11+
>> /etc/nix/nix.conf
12+
13+
RUN echo trusted-public-keys = \
14+
cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= \
15+
whslabs.cachix.org-1:lIS0YQWf2C+ZsDcUs4CgXScgghEqQ85gOjonfNMg7n0= \
16+
>> /etc/nix/nix.conf
17+
18+
ARG CACHIX_AUTH_TOKEN
19+
20+
ENV CACHIX_AUTH_TOKEN $CACHIX_AUTH_TOKEN
21+
ENV SHELL /bin/sh
22+
RUN nix-env -iA cachix -f https://cachix.org/api/v1/install
23+
WORKDIR /source/
24+
25+
ENTRYPOINT ["./dapper.sh"]

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
bin/dapper:
2+
$(eval t := $(shell mktemp))
3+
@curl -Lso $(t) https://releases.rancher.com/dapper/latest/dapper-$$(uname -s)-$$(uname -m)
4+
@chmod +x $(t)
5+
@mkdir -p bin/
6+
@mv $(t) bin/dapper
7+
8+
.DEFAULT_GOAL :=
9+
10+
all: bin/dapper
11+
@bin/dapper
12+
13+
s shell: bin/dapper
14+
@bin/dapper \
15+
-m bind \
16+
-s \
17+
;

dapper.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /bin/sh
2+
3+
nix-env -i jq
4+
5+
nix build --json \
6+
| jq -r '.[].outputs | to_entries[].value' \
7+
| cachix push whslabs

0 commit comments

Comments
 (0)