add modified nix image for use with jenkins

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-03-01 17:11:06 +01:00
parent 8ca6a70258
commit 534f84419c
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
4 changed files with 47 additions and 0 deletions

20
nix/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
ARG NIX_VERSION
FROM nixos/nix:${NIX_VERSION}
ARG JENKINS_UID
ARG JENKINS_GID
RUN addgroup -g ${JENKINS_GID} jenkins \
&& adduser -D -u ${JENKINS_UID} -G jenkins jenkins \
-s /nix/var/nix/profiles/default/bin/nix-shell \
&& chown jenkins:jenkins -R /nix
ADD nix.conf /home/jenkins/.config/nix/nix.conf
ADD default.nix home/jenkins/default.nix
WORKDIR /home/jenkins
USER jenkins
MAINTAINER Jakub Sokolowski "jakub@status.im"
LABEL description="Adjusted Nix Docker image for use with Jenkins"

16
nix/Makefile Normal file
View File

@ -0,0 +1,16 @@
NIX_VERSION = 2.2.1
JENKINS_UID = 1001
JENKINS_GID = 1001
IMAGE_TAG = jenkins
IMAGE_NAME = statusteam/nix:$(IMAGE_TAG)
build:
docker build --squash=true \
--build-arg="JENKINS_UID=$(JENKINS_UID)" \
--build-arg="JENKINS_GID=$(JENKINS_GID)" \
--build-arg="NIX_VERSION=$(NIX_VERSION)" \
-t $(IMAGE_NAME) .
push: build
docker push $(IMAGE_NAME)

9
nix/default.nix Normal file
View File

@ -0,0 +1,9 @@
with import <nixpkgs> { };
stdenv.mkDerivation rec {
name = "env";
env = buildEnv { name = name; paths = buildInputs; };
buildInputs = with pkgs; [
bash
wget
];
}

2
nix/nix.conf Normal file
View File

@ -0,0 +1,2 @@
extra-substituters = https://nix-cache.status.im
trusted-public-keys = nix-cache.status.im-1:x/93lOfLU+duPplwMSBR+OlY4+mo+dCN7n0mr4oPwgY= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=