mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-14 11:11:35 +00:00
69 lines
1.3 KiB
Nix
69 lines
1.3 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
nix-filter.url = "github:numtide/nix-filter";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
nix-filter,
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
git-pages = pkgs.buildGo125Module {
|
|
pname = "git-pages";
|
|
version = "0";
|
|
|
|
src = nix-filter {
|
|
root = self;
|
|
|
|
include = [
|
|
"go.mod"
|
|
"go.sum"
|
|
"main.go"
|
|
|
|
(nix-filter.lib.inDirectory "src")
|
|
];
|
|
};
|
|
|
|
buildInputs = with pkgs; [
|
|
pkgsStatic.musl
|
|
];
|
|
|
|
ldflags = [
|
|
"-linkmode external"
|
|
"-extldflags -static"
|
|
"-s -w"
|
|
];
|
|
|
|
vendorHash = "sha256-o6qrKYZHPqhiSr8NcQHtJd7cMgo12FaMAcf2LymIpo8=";
|
|
};
|
|
in
|
|
{
|
|
formatter = pkgs.nixfmt-tree;
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
inputsFrom = [
|
|
git-pages
|
|
];
|
|
|
|
packages = with pkgs; [
|
|
caddy
|
|
];
|
|
};
|
|
|
|
packages = {
|
|
inherit git-pages;
|
|
default = git-pages;
|
|
};
|
|
}
|
|
);
|
|
}
|