/ app / default.nix
default.nix
 1  {
 2    lib,
 3    version,
 4    rustPlatform,
 5    installShellFiles,
 6  
 7    pkg-config,
 8    openssl,
 9  }:
10  
11  rustPlatform.buildRustPackage {
12    pname = "bale";
13    inherit version;
14    src = ./.;
15  
16    cargoLock.lockFile = ./Cargo.lock;
17  
18    nativeBuildInputs = [
19      pkg-config
20      installShellFiles
21    ];
22    buildInputs = [
23      openssl
24    ];
25  
26    postInstall = ''
27      installShellCompletion --cmd bale \
28        --bash <($out/bin/bale completions bash) \
29        --fish <($out/bin/bale completions fish) \
30        --zsh <($out/bin/bale completions zsh)
31    '';
32  
33    shellHook = ''
34      export SHELL="$(grep "^$USER:" /etc/passwd | awk -F: '{ print $NF }')"
35      [[ $- == *i* ]] && exec $SHELL
36    '';
37  
38    meta = {
39      homepage = "";
40      description = "File/Directory transferring tool";
41      license = lib.licenses.asl20;
42      mainProgram = "bale";
43    };
44  }