Skip to content

Instantly share code, notes, and snippets.

@samuela
Created April 28, 2024 16:42
Show Gist options
  • Save samuela/347c7dbca6812377739769da97b0b672 to your computer and use it in GitHub Desktop.
Save samuela/347c7dbca6812377739769da97b0b672 to your computer and use it in GitHub Desktop.
FROM ubuntu:24.04
RUN apt-get update \
# curl: necessary for the nix-installer
&& apt-get install -y curl \
# build-essential: necessary for the `cc` linker, required by cargo/rustc
# libssl-dev, pkg-config: necessary for the openssl-sys rust crate
build-essential libssl-dev pkg-config rustup \
# We don't use nixpkgs's rust toolchain because of https://github.com/sfackler/rust-openssl/issues/2217.
&& rustup default stable \
&& cargo install cargo-watch
# As of 2024-04-11. Check https://status.nixos.org for the latest commit.
ENV NIXPKGS_COMMIT="d6b3ddd253c578a7ab98f8011e59990f21dc3932"
# See
# * https://github.com/DeterminateSystems/nix-installer?tab=readme-ov-file#in-a-container
# * https://github.com/DeterminateSystems/nix-installer/issues/822
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux --init none --no-confirm \
&& sed -i '/^extra-nix-path/s|=flake:nixpkgs$|=flake:nixpkgs/'"$NIXPKGS_COMMIT"'|' /etc/nix/nix.conf
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
RUN nix profile install \
nixpkgs#dua \
nixpkgs#file \
nixpkgs#git \
nixpkgs#htop \
nixpkgs#jq \
nixpkgs#nixfmt \
nixpkgs#ranger \
nixpkgs#openssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment