Skip to content

Instantly share code, notes, and snippets.

@MatrixManAtYrService
Last active March 5, 2024 21:59
Show Gist options
  • Save MatrixManAtYrService/b527300542b6fddc60cbd4fd96efd17c to your computer and use it in GitHub Desktop.
Save MatrixManAtYrService/b527300542b6fddc60cbd4fd96efd17c to your computer and use it in GitHub Desktop.
radicle in a nix devshell
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs?ref=23.11";
radicle.url = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5?ref=master";
};
outputs = { self, nixpkgs, flake-utils, radicle }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
frameworkSecurity = pkgs.darwin.apple_sdk.frameworks.Security;
# TODO: only do this if ${system} is darwin
# TODO: better yet, fix it in the radicle flake
radicle-cli = radicle.packages.${system}.radicle-cli.overrideAttrs (oldAttrs: rec {
NIX_LDFLAGS = "-F${frameworkSecurity}/Library/Frameworks ${oldAttrs.NIX_LDFLAGS or ""}";
});
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
darwin.apple_sdk.frameworks.Security
pkg-config
openssl
radicle-cli
];
};
});
}
$ nix develop
... wait for nix to build things (only takes a long time the first time) ...
$ rad --version
rad 0.8.0 (unknown)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment