nixos-server/lib.nix

20 lines
635 B
Nix
Raw Normal View History

2024-05-25 15:12:56 +02:00
{ pkgs, ... }:
2024-05-23 12:08:06 +02:00
{
2024-05-25 01:01:07 +02:00
flatMap = (f: list: builtins.foldl' (acc: elem: acc // elem) {} (builtins.map f list));
flatMapS = (f: list: builtins.foldl' (acc: elem: acc + elem) "" (builtins.map f list));
2024-05-25 15:12:56 +02:00
git-forward-shell = pkgs.stdenv.mkDerivation {
name = "git-forward-shell";
passthru = {
shellPath = "/bin/git-forward-shell";
};
phases = [ "installPhase" ];
src = pkgs.writeScriptBin "git-forward-shell" ''
#!/bin/sh
ssh -p 2222 -o StrictHostKeyChecking=no git@gitea.containers "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" bash $@"
'';
installPhase = ''
cp -r $src $out
'';
};
2024-05-23 12:08:06 +02:00
}