Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created October 12, 2019 14:57
Show Gist options
  • Save cleverca22/a0722abf36a1cfc5cadf8e39c356fba5 to your computer and use it in GitHub Desktop.
Save cleverca22/a0722abf36a1cfc5cadf8e39c356fba5 to your computer and use it in GitHub Desktop.
FROM ubuntu
RUN apt-get update
RUN apt-get install -y sudo bzip2 curl git man software-properties-common
RUN useradd -ms /bin/bash user
RUN apt-get update
RUN mkdir /nix && chown user /nix
RUN mkdir -p /etc/nix
USER user
# The nix install script needs USER to be set
ENV USER user
COPY nix.conf /home/user/.config/nix/nix.conf
RUN curl https://nixos.org/nix/install | sh
ENV PATH /home/user/.nix-profile/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WORKDIR /home/user
COPY repro.nix /home/user
RUN . ~/.nix-profile/etc/profile.d/nix.sh && nix-build repro.nix --option sandbox true
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.nixos.org/ https://hydra.iohk.io/
with import <nixpkgs> {};
runCommand "repro" {} ''
echo topdir is $NIX_BUILD_TOP
ls -lh $NIX_BUILD_TOP
touch $out
''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment