on master help sign in
Rename per-project package file to container.nix
commit3ca3816559873151571d305f0224bcd08b385089 authoriko <mail@iko.soy> dateSat 27 Jun 2026, 21:04 (3 months ago) parent0937aa7
3 files changed+8−8
README.md+2−2 c+3−3 flake.nix+3−3
README.md+2−2
@@ -91,11 +91,11 @@ nix run github:ilyakooo0/nix-container#image -- docker-daemon:nix-container:late
9191
9292The image ships a curated tool set (`defaultPackages` in
9393[`flake.nix`](./flake.nix)). To use your own set **without forking**, drop a
94−`nix-container.nix` in the directory you run `init` from — a `pkgs`-function
94+`container.nix` in the directory you run `init` from — a `pkgs`-function
9595returning the package list:
9696
9797```nix
98−# ./nix-container.nix
98+# ./container.nix
9999pkgs: with pkgs; [
100100 fish # the default cmd is /bin/fish, so include it (or change config.cmd)
101101 coreutils
c+3−3
@@ -1,7 +1,7 @@
11#!/usr/bin/env fish
22# Manage a container named after the current directory.
33# c init [extra create args] build + load the image, then create the container
4−# (uses ./nix-container.nix for packages if present)
4+# (uses ./container.nix for packages if present)
55# c start start it and attach
66
77set -l name (path basename $PWD)
@@ -15,9 +15,9 @@ switch $argv[1]
1515 set -l archive $tmp/image.tar.gz
1616 set -l rc 0
1717
18− if test -e nix-container.nix
18+ if test -e container.nix
1919 # Per-project package set: build an image with exactly these packages.
20− set -lx NIX_CONTAINER_PKGS (path resolve nix-container.nix)
20+ set -lx NIX_CONTAINER_PKGS (path resolve container.nix)
2121 set -l expr "(builtins.getFlake \"$flake\").lib.\${builtins.currentSystem}.copyWith (import (/. + builtins.getEnv \"NIX_CONTAINER_PKGS\"))"
2222 set -l copyer (nix build --impure --no-link --print-out-paths --expr "$expr")
2323 set rc $status
flake.nix+3−3
@@ -110,7 +110,7 @@
110110 cp ${fishConfig} "$out/root/.config/fish/config.fish"
111111 '';
112112
113− # The curated tool set baked into the image. Drop a `nix-container.nix`
113+ # The curated tool set baked into the image. Drop a `container.nix`
114114 # (`pkgs: [ ... ]`) next to where you run `c init` to replace this with
115115 # your own list — see README.
116116 defaultPackages =
@@ -216,9 +216,9 @@
216216 };
217217
218218 # Build helpers. `c init` uses `copyWith` to honour a per-project
219− # `nix-container.nix`:
219+ # `container.nix`:
220220 # (builtins.getFlake "github:…/nix-container")
221− # .lib.<system>.copyWith (import ./nix-container.nix)
221+ # .lib.<system>.copyWith (import ./container.nix)
222222 lib = {
223223 inherit mkImage;
224224 # skopeo copy app (`skopeo copy nix:<image> "$@"`) for an image built