[mirror] Command-line application for uploading a site to a git-pages server
1{
2 inputs = {
3 nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4 flake-utils.url = "github:numtide/flake-utils";
5 nix-filter.url = "github:numtide/nix-filter";
6
7 gomod2nix = {
8 url = "github:nix-community/gomod2nix";
9 inputs.nixpkgs.follows = "nixpkgs";
10 inputs.flake-utils.follows = "flake-utils";
11 };
12 };
13
14 outputs =
15 {
16 self,
17 nixpkgs,
18 flake-utils,
19 nix-filter,
20 ...
21 }@inputs:
22 flake-utils.lib.eachDefaultSystem (
23 system:
24 let
25 pkgs = import nixpkgs {
26 inherit system;
27
28 overlays = [
29 inputs.gomod2nix.overlays.default
30 ];
31 };
32
33 git-pages-cli = pkgs.buildGoApplication {
34 pname = "git-pages-cli";
35 version = "0";
36
37 src = nix-filter {
38 root = self;
39
40 include = [
41 "go.mod"
42 "go.sum"
43 "main.go"
44 ];
45 };
46
47 buildInputs = with pkgs; [
48 pkgsStatic.musl
49 ];
50
51 ldflags = [
52 "-linkmode external"
53 "-extldflags -static"
54 "-s -w"
55 ];
56
57 go = pkgs.go_1_25;
58 modules = ./gomod2nix.toml;
59 };
60 in
61 {
62 formatter = pkgs.nixfmt-tree;
63
64 devShells.default = pkgs.mkShell {
65 inputsFrom = [
66 git-pages-cli
67 ];
68
69 packages = with pkgs; [
70 gomod2nix
71 ];
72 };
73
74 packages = {
75 inherit git-pages-cli;
76 default = git-pages-cli;
77 };
78 }
79 );
80}