added stuff
This commit is contained in:
parent
937f28770d
commit
236b8c2a6b
907 changed files with 70990 additions and 0 deletions
11
nyx/flake/templates/go/default.nix
Normal file
11
nyx/flake/templates/go/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{buildGoModule}:
|
||||
buildGoModule {
|
||||
pname = "sample-go";
|
||||
version = "0.0.1";
|
||||
|
||||
src = ./.;
|
||||
|
||||
vendorHash = "";
|
||||
|
||||
ldflags = ["-s" "-w"];
|
||||
}
|
26
nyx/flake/templates/go/flake.nix
Normal file
26
nyx/flake/templates/go/flake.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
description = "Golang Project Template";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
}: let
|
||||
systems = ["x86_64-linux" "aarch64-linux"];
|
||||
forEachSystem = nixpkgs.lib.genAttrs systems;
|
||||
|
||||
pkgsForEach = nixpkgs.legacyPackages;
|
||||
in rec {
|
||||
packages = forEachSystem (system: {
|
||||
default = pkgsForEach.${system}.callPackage ./default.nix {};
|
||||
});
|
||||
|
||||
devShells = forEachSystem (system: {
|
||||
default = pkgsForEach.${system}.callPackage ./shell.nix {};
|
||||
});
|
||||
|
||||
hydraJobs = packages;
|
||||
};
|
||||
}
|
3
nyx/flake/templates/go/go.mod
Normal file
3
nyx/flake/templates/go/go.mod
Normal file
|
@ -0,0 +1,3 @@
|
|||
module notashelf.dev/sample
|
||||
|
||||
go 1.20
|
7
nyx/flake/templates/go/main.go
Normal file
7
nyx/flake/templates/go/main.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, World!")
|
||||
}
|
15
nyx/flake/templates/go/shell.nix
Normal file
15
nyx/flake/templates/go/shell.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
callPackage,
|
||||
gopls,
|
||||
go,
|
||||
}: let
|
||||
mainPkg = callPackage ./default.nix {};
|
||||
in
|
||||
mainPkg.overrideAttrs (oa: {
|
||||
nativeBuildInputs =
|
||||
[
|
||||
gopls
|
||||
go
|
||||
]
|
||||
++ (oa.nativeBuildInputs or []);
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue