@@ -76,44 +76,9 @@
7676 imageName = "nix-container";
7777 imageTag = "latest";
7878
79− # Fish prompt config, installed at /root/.config/fish/config.fish
80− # (fish reads $HOME/.config/fish).
81− fishConfig = pkgsLinux.writeText "config.fish" ''
82− # No welcome banner.
83− set -g fish_greeting
84−
85− # Define the prompt as a function so fish renders it before every
86− # command; at top level it would run once at startup and be ignored.
87− function fish_prompt
88− set -l nix_shell_info
89− if set -q IN_NIX_SHELL; or set -q IN_NIX_RUN
90− set nix_shell_info ' ❄️'
91− end
92−
93− set -l cwd (prompt_pwd)
94−
95− set -l bookmark_info
96− if jj root 2>/dev/null >/dev/null
97− set -l jj_bookmark (jj log -r 'heads(::@ & bookmarks())' -T 'local_bookmarks ++ "\n"' --no-graph 2>/dev/null | tail -1)
98− if test -n "$jj_bookmark"
99− set bookmark_info ' ' (set_color brmagenta) $jj_bookmark (set_color normal)
100− end
101− end
102−
103− echo -n -s (set_color $fish_color_cwd) $cwd (set_color normal) $bookmark_info ' 🏗️' $nix_shell_info '> '
104− end
105− '';
106−
107− # Lay the config out at the path fish reads.
108− fishRoot = pkgsLinux.runCommand "fish-config-root" { } ''
109− mkdir -p "$out/root/.config/fish"
110− cp ${fishConfig} "$out/root/.config/fish/config.fish"
111− '';
112−
11379 # Build the OCI image from a `{ pkgs, nur }: [ ... ]` package function.
114− # The fish prompt config is always added; the default `cmd` is
115− # /bin/fish, so the package set should include `fish` (warned about
116− # below if missing) or override `config.cmd`.
80+ # The default `cmd` is /bin/fish, so the package set should include
81+ # `fish` (warned about below if missing) or override `config.cmd`.
11782 mkImage =
11883 packages:
11984 let
@@ -133,11 +98,8 @@
13398 # A plain, single-process root filesystem. No NixOS, no systemd.
13499 copyToRoot = pkgsLinux.buildEnv {
135100 name = "root";
136− paths = pkgList ++ [ fishRoot ];
137− pathsToLink = [
138− "/bin"
139− "/root"
140− ];
101+ paths = pkgList;
102+ pathsToLink = [ "/bin" ];
141103 };
142104
143105 initializeNixDatabase = true;
@@ -150,7 +112,6 @@
150112 cmd = [ "/bin/fish" ];
151113 env = [
152114 "PATH=/bin"
153− # fish reads its prompt from $HOME/.config/fish/config.fish.
154115 "HOME=/root"
155116 ];
156117 };