Skip to content

Commit 971cd63

Browse files
author
CI Bot
committed
chore: add GitHub Actions workflows, Dockerfile, and update docs
1 parent 1e34595 commit 971cd63

File tree

4 files changed

+90
-1
lines changed

4 files changed

+90
-1
lines changed

.github/workflows/docker-test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Docker Build & Test'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
10+
jobs:
11+
docker:
12+
name: Build and Run Docker Container
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Build Docker image
20+
run: |
21+
docker build -t nix-shell-env .
22+
23+
- name: Run Docker container to verify
24+
run: |
25+
docker run --rm nix-shell-env echo "Docker container is working"

.github/workflows/nix-build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Nix Build"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
name: Build Nix Package
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Install Nix
20+
uses: cachix/install-nix-action@v14
21+
with:
22+
nix_path: nixpkgs=channel:nixos-unstable
23+
24+
- name: Build package
25+
run: |
26+
nix-build shell.nix --no-out-link

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Use Ubuntu as base image
2+
FROM ubuntu:latest
3+
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
6+
# Install prerequisites
7+
RUN apt-get update \
8+
&& apt-get install -y curl git ca-certificates \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
# Create Nix builder users
12+
RUN groupadd -r nixbld \
13+
&& for i in $(seq 1 10); do \
14+
useradd -r -g nixbld -G nixbld -M -N -s /bin/false nixbld$i; \
15+
done \
16+
&& mkdir -m 0755 /nix && chown root /nix
17+
18+
# Install Nix (single-user)
19+
RUN curl -L https://nixos.org/nix/install | sh
20+
21+
# Ensure nix binaries are on PATH
22+
ENV PATH=/root/.nix-profile/bin:${PATH}
23+
24+
# Clone this repository and enter nix-shell
25+
RUN cd /root/ \
26+
&& git clone https://github.com/walidbr/nix-shell-environment.git \
27+
&& cd nix-shell-environment \
28+
&& nix-shell --run "echo 'Nix shell OK'"
29+
30+
# Default to an interactive shell
31+
CMD ["nix-shell"]

readme.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ exit
6565
```
6666

6767
---
68+
## ▶️ Usage via Docker
69+
70+
Build and run using Docker:
71+
```bash
72+
docker build -t nix-shell-env .
73+
docker run --rm -it nix-shell-env
74+
```
6875

6976
## 📦 What’s Inside?
7077

@@ -85,6 +92,7 @@ exit
8592
| `neofetch`| System info |
8693
| `rustup` | Rust installer (if needed) |
8794
| `tmux` | Terminal multiplexer |
95+
| `yazi` | Interactive CLI productivity tool |
8896

8997
---
9098

@@ -112,4 +120,3 @@ For faster startup and evaluation caching, consider switching to [`nix develop`
112120
## 📄 License
113121

114122
MIT — do whatever you want.
115-

0 commit comments

Comments
 (0)