From cfe083ec2f88860e0520ddbd6874aa6981e38e8a Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sat, 11 May 2024 18:12:46 +0200 Subject: Set ssh env and make sure all git utilities are available, so that git over ssh works --- Makefile | 5 ++++- base/ssh_environment | 2 ++ default.nix | 9 +++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 base/ssh_environment diff --git a/Makefile b/Makefile index e330c37..516229d 100644 --- a/Makefile +++ b/Makefile @@ -30,5 +30,8 @@ install-tmpfiles: systemctl --user enable systemd-tmpfiles-setup.service systemctl --user enable --now systemd-tmpfiles-clean.timer +install-ssh-env: + mkdir -p ~/.ssh + cp base/ssh_environment ~/.ssh/environment -install: setup-pulseaudio install-rm-keyfile install-fonts install-tmpfiles install-loadout +install: setup-pulseaudio install-rm-keyfile install-fonts install-tmpfiles install-ssh-env install-loadout diff --git a/base/ssh_environment b/base/ssh_environment new file mode 100644 index 0000000..77b2b01 --- /dev/null +++ b/base/ssh_environment @@ -0,0 +1,2 @@ +PATH=/home/mediocregopher/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/bin + diff --git a/default.nix b/default.nix index 112444d..ebe9b92 100644 --- a/default.nix +++ b/default.nix @@ -44,8 +44,7 @@ in rec { }; - git = pkgs.writeScriptBin "git" '' - #!${pkgs.bash}/bin/bash + gitWrapped = pkgs.writeShellScript "git" '' export XDG_CONFIG_HOME=${gitConfig} bin="${pkgs.git}/bin/git" @@ -60,6 +59,12 @@ in rec { exec "$bin" "$@" ''; + git = pkgs.runCommand "mediocregopher-git" {} '' + cp -rL "${pkgs.git}" "$out" + chmod -R +rwX "$out" + cp "${gitWrapped}" "$out"/bin/git + ''; + bin = pkgs.buildEnv { name = "mediocregopher-bin"; paths = [ -- cgit v1.2.3