mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
chore: centralise folders
This commit is contained in:
parent
7d614f784c
commit
34badc91d5
152 changed files with 6292 additions and 6645 deletions
1
files/templates/go/.envrc
Normal file
1
files/templates/go/.envrc
Normal file
|
|
@ -0,0 +1 @@
|
|||
use flake
|
||||
52
files/templates/go/flake.nix
Normal file
52
files/templates/go/flake.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# heavily inspired by https://github.com/nulladmin1/nix-flake-templates/blob/main/go-nix/flake.nix
|
||||
{
|
||||
description = "Go Flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
systems.url = "github:nix-systems/default";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, systems
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
forEachSystem = nixpkgs.lib.genAttrs (import systems);
|
||||
pkgsFor = forEachSystem (system: import nixpkgs { inherit system; });
|
||||
|
||||
pname = "name";
|
||||
in
|
||||
{
|
||||
formatter = forEachSystem (system: pkgsFor.${system}.nixpkgs-fmt);
|
||||
|
||||
devShells = forEachSystem (system: {
|
||||
default = pkgsFor.${system}.mkShell {
|
||||
packages = with pkgsFor.${system}; [
|
||||
go
|
||||
gopls
|
||||
go-tools
|
||||
gotools
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
packages = forEachSystem (system: {
|
||||
default = pkgsFor.${system}.buildGoModule {
|
||||
inherit pname;
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
vendorHash = null;
|
||||
};
|
||||
});
|
||||
|
||||
apps = forEachSystem (system: {
|
||||
default = {
|
||||
type = "app";
|
||||
program = "${self.packages.${system}.default}/bin/${pname}";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
3
files/templates/go/go.mod
Normal file
3
files/templates/go/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module name
|
||||
|
||||
go 1.22.7
|
||||
9
files/templates/go/name/name.go
Normal file
9
files/templates/go/name/name.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, World!")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue