16 lines
843 B
Bash
Executable File
16 lines
843 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Fake nix: `nix build --no-link --print-out-paths .#ATTR` -> fabricates a store-like dir.
|
|
echo "nix $*" >> "${FAKE_NIX_LOG:-/dev/null}"
|
|
[[ -z "${FAKE_NIX_FAIL:-}" ]] || { echo "error: attribute missing" >&2; exit 1; }
|
|
attr="${@: -1}"
|
|
out="${FAKE_NIX_STORE:?}/abc-home-manager-generation"
|
|
mkdir -p "$out/home-files/.config/helix" "$out/home-files/.config/git" "$out/store"
|
|
echo 'theme = "base16"' > "$out/store/helix.toml"; chmod 444 "$out/store/helix.toml"
|
|
ln -sfn "$out/store/helix.toml" "$out/home-files/.config/helix/config.toml" # like real HM: symlink into store
|
|
echo '[user]
|
|
name = alex' > "$out/store/gitconfig"; chmod 444 "$out/store/gitconfig"
|
|
ln -sfn "$out/store/gitconfig" "$out/home-files/.gitconfig"
|
|
[[ -z "${FAKE_NIX_NOHOMEFILES:-}" ]] || rm -rf "$out/home-files"
|
|
echo "$attr" > "$out/attr"
|
|
echo "$out"
|