nix development environment for P2PRC go program

This commit is contained in:
2025-01-05 14:02:16 +00:00
parent 111b4dd777
commit bedf1431fa
4 changed files with 333 additions and 8 deletions

View File

@@ -11,20 +11,31 @@
(flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
overlays = [ gomod2nix.overlays.default ];
};
# pkgs = nixpkgs.legacyPackages.${system};
# The current default sdk for macOS fails to compile go projects, so we use a newer one for now.
# This has no effect on other platforms.
callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage;
in
{
packages.default = callPackage ./. {
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
};
# packages.default = callPackage ./. {
# inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
# };
devShells.default = callPackage ./shell.nix {
inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gotools
go-tools
gomod2nix.packages.${system}.default
sqlite-interactive
];
};
})
);