on master help sign in
Add c script for container init/start
commitb1aa805d7f1038e7295352f8ad1dbbf8931c5527 authoriko <mail@iko.soy> dateSat 27 Jun 2026, 20:00 (3 months ago) parent04eac96
1 file changed+16
c+16
cnew file+16
@@ -0,0 +1,16 @@
1+#!/usr/bin/env fish
2+# Manage a container named after the current directory.
3+# c init [extra create args] create it (e.g. c init -v $PWD:/work)
4+# c start start it and attach
5+
6+set -l name (path basename $PWD)
7+
8+switch $argv[1]
9+ case init
10+ container create --name $name --ssh -it $argv[2..-1] nixos-container:latest
11+ case start
12+ container start -ai $name
13+ case '*'
14+ echo "usage: c init|start" >&2
15+ exit 1
16+end