Initial Project Setup:

- Setup golang project
- Setup nix flake & envrc for development
- Setup basic directory structure
This commit is contained in:
2024-11-10 17:02:04 -08:00
commit f0616214b6
10 changed files with 76 additions and 0 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.direnv

5
cmd/discord-gorp/main.go Normal file
View File

@@ -0,0 +1,5 @@
package main
func main() {
}

0
configs/config.yaml Normal file
View File

25
flake.lock generated Normal file
View File

@@ -0,0 +1,25 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1728018373,
"narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=",
"rev": "bc947f541ae55e999ffdb4013441347d83b00feb",
"revCount": 688563,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.688563%2Brev-bc947f541ae55e999ffdb4013441347d83b00feb/01925b66-3b70-71bd-b277-924a6c208ba7/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

38
flake.nix Normal file
View File

@@ -0,0 +1,38 @@
{
description = "A Nix-flake-based Go 1.22 development environment";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
outputs = { self, nixpkgs }:
let
goVersion = 22; # Change this to update the whole stack
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
});
in
{
overlays.default = final: prev: {
go = final."go_1_${toString goVersion}";
};
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
# go (version is specified by overlay)
go
# goimports, godoc, etc.
gotools
# https://github.com/golangci/golangci-lint
golangci-lint
];
};
});
};
}

3
go.mod Normal file
View File

@@ -0,0 +1,3 @@
module github.com/sapphiregaze/discord-gorp
go 1.22.7

View File

@@ -0,0 +1 @@
package daemon

1
pkg/config/loader.go Normal file
View File

@@ -0,0 +1 @@
package config

1
pkg/rpc/client.go Normal file
View File

@@ -0,0 +1 @@
package rpc