https://github.com/rfaulhaber/sfdx-nix
Nix derivation for the Salesforce CLI
https://github.com/rfaulhaber/sfdx-nix
nix nix-derivation nixos salesforce sfdx sfdx-cli
Last synced: 5 months ago
JSON representation
Nix derivation for the Salesforce CLI
- Host: GitHub
- URL: https://github.com/rfaulhaber/sfdx-nix
- Owner: rfaulhaber
- License: bsd-3-clause
- Created: 2020-12-24T18:40:02.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2026-01-11T18:24:14.000Z (5 months ago)
- Last Synced: 2026-01-11T21:52:09.835Z (5 months ago)
- Topics: nix, nix-derivation, nixos, salesforce, sfdx, sfdx-cli
- Language: Nix
- Homepage:
- Size: 366 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sfdx-nix
[](https://garnix.io/repo/rfaulhaber/sfdx-nix)
Simple Nix flake that provides the [Salesforce CLI](https://developer.salesforce.com/tools/salesforcecli) for Salesforce. You can use it like any other flake.
This project is in no way affiliated with Salesforce.
This project's license only covers the code in this repository, and is licensed
under the same license that the Salesforce CLI itself is.
## Usage
This flake can be used like any other flake. For example, within the CLI:
```sh
nix run github:rfaulhaber/sfdx-nix
```
is the same as just running `sf`. Similarly,
``` sh
nix shell github:rfaulhaber/sfdx-nix
```
will add the `sf` command to your environment.
You can add it to a NixOS configuration like any other flake as well. Something like this should work:
```nix
{
inputs = {
nixpkgs = "github:NixOS/nixpkgs";
sfdx-nix = "github:rfaulhaber/sfdx-nix";
};
outputs = {
nixpkgs,
sfdx-nix,
...
}: {
nixosConfigurations.your-machine = nixpkgs.lib.nixosSystem {
# see flake.nix for supported systems
system = "x86_64-linux";
modules = [
# ...
{...}: {
# or added to your user packages
environment.systemPackages = [
sfdx-nix.packages."x86_64-linux".default
];
}
];
};
};
}
```
Previously this flake was built to support `sfdx` and `sf` executable, however now that Salesforce has retired `sfdx` the package/app default exported by this flake is `sf`.
## Build Cache
This project uses [Garnix](https://garnix.io/) to build the project. Garnix provides a Nix cache for publicly hosted repositories. If you aren't already, you may use the cached build for this project by using [Garnix's cache](https://garnix.io/docs/caching). If you would rather not add Garnix's cache or a more specific cache, I also maintain a build cache with Cachix [here](https://app.cachix.org/cache/sfdx-nix).