Add initial flake.nix and default.nix

For NixOS development
This commit is contained in:
Eli Ribble 2026-05-14 15:33:53 +00:00
parent 4474319e73
commit 5b65a3d4ef
No known key found for this signature in database
3 changed files with 101 additions and 0 deletions

13
default.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.buildGoModule rec {
meta = {
description = "A go library for SQL generation";
homepage = "https://source.gleipnir.technology/Gleipnir/jet";
};
pname = "go-jet";
src = ./.;
subPackages = [];
version = "0.0.1";
# Needs to be updated after every modification of go.mod/go.sum
vendorHash = "sha256-aaJnH258H1LkXvb22rR3Clg7fKzA/aaaBZUkh1E8aaa=";
}

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"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"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1778430510,
"narHash": "sha256-Ti+ZBvW6yrWWAg2szExVTwCd4qOJ3KlVr1tFHfyfi8Q=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8fd9daa3db09ced9700431c5b7ad0e8ba199b575",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"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
}

27
flake.nix Normal file
View file

@ -0,0 +1,27 @@
{
description = "A go library for SQL generation";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
package = import ./default.nix { inherit pkgs; };
in
{
packages.default = package;
# Development shell configuration
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.go
pkgs.lefthook
];
};
}
);
}