Initial Nix flake

This commit is contained in:
bin
2025-09-18 19:14:14 +00:00
committed by Catherine
parent f99298d38b
commit 6f932df886
3 changed files with 134 additions and 0 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
/result
/result-*
/bin
/data
/config.toml

77
flake.lock generated Normal file
View File

@@ -0,0 +1,77 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1757882181,
"narHash": "sha256-+cCxYIh2UNalTz364p+QYmWHs0P+6wDhiWR4jDIKQIU=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "59c44d1909c72441144b93cf0f054be7fe764de5",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1758029226,
"narHash": "sha256-TjqVmbpoCqWywY9xIZLTf6ANFvDCXdctCjoYuYPYdMI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "08b8f92ac6354983f5382124fef6006cade4a1c1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nix-filter": "nix-filter",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

55
flake.nix Normal file
View File

@@ -0,0 +1,55 @@
{
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 = "1.0.0";
src = nix-filter {
root = self;
include = [
"go.mod"
"go.sum"
(nix-filter.lib.inDirectory "src")
];
};
vendorHash = "sha256-WVnxNtCCk6T+EsT6Wvd+yR2mxU03SNnSwpeYlYLOCGU=";
fixupPhase = ''
# Apparently `go install` doesn't support renaming the binary, so country girls make do.
mv $out/bin/{src,git-pages}
'';
};
in
{
formatter = pkgs.nixfmt-tree;
devShells.default = pkgs.mkShell {
inputsFrom = [
git-pages
];
};
packages.default = git-pages;
}
);
}