feat: nix build enabled
nix build will put binary into nix store, and symlink to ./result running with ./result/bin/auth-pocketbase-attempt serve --dir=./pb_data if i understood migrations correctly, when using as a framework migrations will be generated as go files, and will be packaged into the binary
This commit is contained in:
55
flake.nix
55
flake.nix
@@ -1,23 +1,42 @@
|
||||
{
|
||||
description = "going to look at the pocketbase apis";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
outputs = { self, nixpkgs }: {
|
||||
devShell.x86_64-linux = let pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.go
|
||||
pkgs.wgo # for restart of project
|
||||
pkgs.semgrep
|
||||
pkgs.gopls
|
||||
pkgs.nodePackages.tailwindcss
|
||||
pkgs.nodePackages.prettier
|
||||
pkgs.gnumake
|
||||
];
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pname = "auth-pocketbase-attempt";
|
||||
version = "0.0.1";
|
||||
in rec {
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.go
|
||||
pkgs.wgo # for restart of project
|
||||
pkgs.semgrep
|
||||
pkgs.gopls
|
||||
pkgs.nodePackages.tailwindcss
|
||||
pkgs.nodePackages.prettier
|
||||
pkgs.gnumake
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export GOPATH=$PWD/.go
|
||||
export PATH=$GOPATH/bin:$PATH
|
||||
'';
|
||||
};
|
||||
};
|
||||
shellHook = ''
|
||||
export GOPATH=$PWD/.go
|
||||
export PATH=$GOPATH/bin:$PATH
|
||||
'';
|
||||
};
|
||||
packages = rec {
|
||||
auth-pocketbase-attempt = pkgs.buildGoModule {
|
||||
inherit pname version;
|
||||
src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
|
||||
vendorHash = "sha256-7B5EkrLpL+P5wipQG5a12hrvXQn/UpYAjrz/DuHmSUQ="; # set to "" when get dependencies in go.mod
|
||||
|
||||
# Adding the Tailwind build step to preBuild
|
||||
preBuild = ''
|
||||
${pkgs.nodePackages.tailwindcss}/bin/tailwindcss -i pages/input.css -o pages/static/public/out.css
|
||||
'';
|
||||
};
|
||||
default = auth-pocketbase-attempt;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user