Add cargo credentials provider via pass
This commit is contained in:
parent
391234776a
commit
0345000e05
|
@ -24,6 +24,7 @@
|
|||
./neovim
|
||||
./pass.nix
|
||||
./programs.nix
|
||||
./rust.nix
|
||||
./scripts
|
||||
./sway
|
||||
./tmate.nix
|
||||
|
|
16
users/simon/modules/rust.nix
Normal file
16
users/simon/modules/rust.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
# SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.file.".cargo/config.toml".source = (pkgs.formats.toml { }).generate "cargo-config.toml" {
|
||||
registry = {
|
||||
global-credential-providers = lib.singleton "cargo:token-from-stdout ${pkgs.writeShellScript "" ''
|
||||
set -eu
|
||||
pass cargo/registry-token/"$(base64 -w0 <<< "''${CARGO_REGISTRY_INDEX_URL}")"
|
||||
''}";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue