Add Nix flake for building and installing on NixOS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 22:32:10 -07:00
parent caf1698c16
commit 8953090718
2 changed files with 104 additions and 0 deletions

43
flake.nix Normal file
View File

@@ -0,0 +1,43 @@
{
description = "sgard Shimmering Clarity Gardener: dotfile management";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
packages = {
sgard = pkgs.buildGoModule {
pname = "sgard";
version = "0.1.0";
src = pkgs.lib.cleanSource ./.;
subPackages = [ "cmd/sgard" ];
vendorHash = "sha256-uJMkp08SqZaZ6d64Li4Tx8I9OYjaErLexBrJaf6Vb60=";
ldflags = [ "-s" "-w" ];
meta = {
description = "Shimmering Clarity Gardener: dotfile management";
mainProgram = "sgard";
};
};
default = self.packages.${system}.sgard;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
golangci-lint
];
};
}
);
}