-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding first ubuntu base with nix! (#1)
* adding first ubuntu base with nix! Signed-off-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
ARG ubuntu_version=22.04 | ||
FROM ubuntu:$ubuntu_version | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
ENV EDITOR=vim | ||
|
||
# docker build -t nix-base . | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
ca-certificates \ | ||
bash-completion \ | ||
build-essential \ | ||
curl \ | ||
cmake \ | ||
gnupg \ | ||
htop \ | ||
jq \ | ||
less \ | ||
lsb-release \ | ||
lsof \ | ||
man-db \ | ||
nano \ | ||
ssl-cert \ | ||
sudo \ | ||
unzip \ | ||
xz-utils \ | ||
zip | ||
|
||
# install nix | ||
RUN sh <(curl -L https://nixos.org/nix/install) --daemon | ||
|
||
RUN mkdir -p $HOME/.config/nix $HOME/.config/nixpkgs && \ | ||
echo 'sandbox = false' >> $HOME/.config/nix/nix.conf && \ | ||
echo "experimental-features = nix-command flakes" >> $HOME/.config/nix/nix.conf && \ | ||
echo '. $HOME/.nix-profile/etc/profile.d/nix.sh' >> $HOME/.bashrc | ||
|
||
# install docker and configure daemon to use vfs as GitHub codespaces requires vfs | ||
# https://github.com/moby/moby/issues/13742#issuecomment-725197223 | ||
RUN mkdir -p /etc/apt/keyrings && \ | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | ||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \ | ||
apt-get update && \ | ||
apt-get install --yes docker-ce docker-ce-cli containerd.io docker-compose-plugin && \ | ||
mkdir -p /etc/docker && \ | ||
echo '{"cgroup-parent":"/actions_job","storage-driver":"vfs"}' >> /etc/docker/daemon.json | ||
|
||
# Ensure we can use NUR (nix user repository) and allow unfree | ||
COPY nix-ubuntu/config.nix /root/.config/nixpkgs/config.nix | ||
|
||
# Install our packages, enter the container in the shell | ||
WORKDIR /code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Nix Ubuntu | ||
|
||
This will serve as a base container for nix environments (that should also | ||
work in VS Code). We use an ubuntu base since our user base isn't entirely | ||
comfortable with nix yet. | ||
|
||
## Example Usage | ||
|
||
**under development** | ||
|
||
```dockerfile | ||
FROM ghcr.io/rse-ops/nix-ubuntu:ubuntu-22.04 | ||
COPY shell.nix shell.nix | ||
RUN $HOME/.nix-profile/bin/nix-env -i -f shell.nix | ||
``` | ||
|
||
To install from the rseops Nix User Repository (!!): | ||
|
||
```bash | ||
$ nix-env -f '<nixpkgs>' -iA nur.repos.rseops.conduit | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
allowUnfree = true; | ||
packageOverrides = pkgs: { | ||
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { | ||
inherit pkgs; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dockerbuild: | ||
matrix: | ||
ubuntu_version: | ||
- "22.04" |