mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-14 03:01:48 +00:00
85 lines
1.7 KiB
Nix
85 lines
1.7 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
nix-filter.url = "github:numtide/nix-filter";
|
|
|
|
gomod2nix = {
|
|
url = "github:nix-community/gomod2nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
nix-filter,
|
|
...
|
|
}@inputs:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
|
|
overlays = [
|
|
inputs.gomod2nix.overlays.default
|
|
];
|
|
};
|
|
|
|
git-pages = pkgs.buildGoApplication {
|
|
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"
|
|
"-X main.versionOverride=${self.shortRev or self.dirtyShortRev}"
|
|
"-extldflags -static"
|
|
"-s -w"
|
|
];
|
|
|
|
go = pkgs.go_1_25;
|
|
modules = ./gomod2nix.toml;
|
|
};
|
|
in
|
|
{
|
|
formatter = pkgs.nixfmt-tree;
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
inputsFrom = [
|
|
git-pages
|
|
];
|
|
|
|
packages = with pkgs; [
|
|
caddy
|
|
gomod2nix
|
|
];
|
|
};
|
|
|
|
packages = {
|
|
inherit git-pages;
|
|
default = git-pages;
|
|
};
|
|
}
|
|
);
|
|
}
|