Add a basic 'hello-world' buildable with Nix

This commit is contained in:
Eli Ribble 2025-11-03 12:22:06 +00:00
parent f3205e2df6
commit 63ff66b3d9
No known key found for this signature in database
6 changed files with 115 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
nidus-sync

13
default.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.buildGoModule rec {
meta = {
description = "Nidus Sync";
homepage = "https://github.com/Gleipnir-Technology/nidus-sync";
};
pname = "nidus-sync";
src = ./.;
subPackages = [];
version = "0.0.1";
# Needs to be updated after every modification of go.mod/go.sum
vendorHash = "sha256-3NQcLcPNfba20LXenLu/RcZistBzEGsRb75IogvSR68=";
}

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": 1761999846,
"narHash": "sha256-IYlYnp4O4dzEpL77BD/lj5NnJy2J8qbHkNSFiPBCbqo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3de8f8d73e35724bf9abef41f1bdbedda1e14a31",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"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
}

30
flake.nix Normal file
View file

@ -0,0 +1,30 @@
{
description = "Nidus sync";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
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;
packages.nidus-sync = package;
# Development shell configuration
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.go
pkgs.goose
pkgs.gotools
pkgs.lefthook
];
};
}
);
}

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module github.com/Gleipnir-Technology/nidus-sync
go 1.24.9

7
main.go Normal file
View file

@ -0,0 +1,7 @@
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello World!")
}