summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Picciano <me@mediocregopher.com>2024-05-11 18:12:46 +0200
committerBrian Picciano <me@mediocregopher.com>2024-05-11 18:29:07 +0200
commitcfe083ec2f88860e0520ddbd6874aa6981e38e8a (patch)
treec77cd02f4cfb2de4f7e98b939810c139ea57c907
parent5b52676a2defc040d4c0e2fac055d61a1989834c (diff)
Set ssh env and make sure all git utilities are available, so that git over ssh works
-rw-r--r--Makefile5
-rw-r--r--base/ssh_environment2
-rw-r--r--default.nix9
3 files changed, 13 insertions, 3 deletions
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 = [