-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8f5043
commit a414dd2
Showing
4 changed files
with
44 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.movement | ||
.etc | ||
target |
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,28 @@ | ||
# Nix builder | ||
FROM nixos/nix:latest AS builder | ||
|
||
# Copy our source and setup our working dir. | ||
COPY . /tmp/build | ||
WORKDIR /tmp/build | ||
|
||
# Build our Nix environment | ||
RUN nix \ | ||
--extra-experimental-features "nix-command flakes" \ | ||
--option filter-syscalls false \ | ||
build | ||
|
||
# Copy the Nix store closure into a directory. The Nix store closure is the | ||
# entire set of Nix store values that we need for our build. | ||
RUN mkdir /tmp/nix-store-closure | ||
RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure | ||
|
||
# Final image is based on scratch. We copy a bunch of Nix dependencies | ||
# but they're fully self-contained so we don't need Nix anymore. | ||
FROM scratch | ||
|
||
WORKDIR /app | ||
|
||
# Copy /nix/store | ||
COPY --from=builder /tmp/nix-store-closure /nix/store | ||
COPY --from=builder /tmp/build/result /app | ||
CMD ["/app/bin/app"] |
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,11 @@ | ||
# Use the latest Nix image | ||
FROM nixos/nix:latest | ||
|
||
# Set up working directory where the flake will be copied | ||
WORKDIR /app | ||
|
||
# Copy the flake files into the container | ||
COPY . /app | ||
|
||
# Set the entrypoint to use `nix develop` to execute commands within the Nix environment | ||
ENTRYPOINT ["nix", "develop", "--command", "bash", "-c"] |
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