taldir

Directory service to resolve wallet mailboxes by messenger addresses
Log | Files | Refs | Submodules | README | LICENSE

flake.nix (1915B)


      1 {
      2   inputs = {
      3     nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
      4     systems.url = "github:nix-systems/default";
      5     self.submodules = true;
      6   };
      7 
      8   outputs = { self, nixpkgs, systems, ... } @ inputs:
      9     let
     10       supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
     11       forEachSystem = nixpkgs.lib.genAttrs supportedSystems;
     12       nixpkgsFor = forEachSystem (system: import nixpkgs { inherit system; });
     13     in
     14     {
     15       # This defines (installable) package derivations
     16       # For use in flakes that use this flake as input in order
     17       # to specify/use gnunet from git as a dependency
     18       packages = forEachSystem (system:
     19         let
     20           pkgs = nixpkgsFor.${system};
     21         in {
     22           gnunet = pkgs.stdenv.mkDerivation {
     23             name = "taler-directory";
     24             src = ./.;
     25             nativeBuildInputs = [
     26               pkgs.gnumake
     27               pkgs.go
     28             ];
     29             buildInputs = [
     30               pkgs.postgresql
     31             ];
     32             preBuild = ''
     33               HOME=$TMPDIR
     34             '';
     35             preConfigure = ''
     36               export GOCACHE=$TMPDIR/go-cache
     37               export GOPATH="$TMPDIR/go"
     38               export GOPROXY=off
     39               ./bootstrap
     40             '';
     41           };
     42         }
     43       );
     44       defaultPackage = forEachSystem (system: self.packages.${system}.gnunet);
     45       # This defines a development shell in which you can compile
     46       # (and use) gnunet
     47        devShells = forEachSystem
     48         (system:
     49           let
     50             pkgs = nixpkgsFor.${system};
     51           in
     52           {
     53             default = pkgs.mkShell {
     54               packages = [
     55                 pkgs.gnumake
     56                 pkgs.go
     57                 pkgs.postgresql
     58               ];
     59 
     60               shellHook = ''
     61                 echo "TalDir environment loaded."
     62                '';
     63             };
     64           });
     65     };
     66 }