mirror of
https://github.com/NotAShelf/tct.git
synced 2025-10-02 06:53:54 +00:00
nix: set up tooling
This commit is contained in:
parent
c8ff2dad43
commit
7a5207f3b4
5 changed files with 91 additions and 0 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake
|
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1750134718,
|
||||
"narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
25
flake.nix
Normal file
25
flake.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
description = "Fast and minimal parallel TCP connection testing utility ";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
}: let
|
||||
systems = ["x86_64-linux" "aarch64-linux"];
|
||||
forEachSystem = nixpkgs.lib.genAttrs systems;
|
||||
|
||||
pkgsForEach = nixpkgs.legacyPackages;
|
||||
in {
|
||||
packages = forEachSystem (system: {
|
||||
default = pkgsForEach.${system}.callPackage ./nix/package.nix {};
|
||||
});
|
||||
|
||||
devShells = forEachSystem (system: {
|
||||
default = pkgsForEach.${system}.callPackage ./nix/shell.nix {};
|
||||
});
|
||||
|
||||
hydraJobs = self.packages;
|
||||
};
|
||||
}
|
24
nix/package.nix
Normal file
24
nix/package.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
}: let
|
||||
fs = lib.fileset;
|
||||
s = ../.;
|
||||
in
|
||||
buildGoModule {
|
||||
pname = "tct";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = s;
|
||||
fileset = fs.unions [
|
||||
(fs.fileFilter (file: builtins.any file.hasExt ["go"]) s)
|
||||
../go.mod
|
||||
../go.sum
|
||||
];
|
||||
};
|
||||
|
||||
vendorHash = "sha256-m5mBubfbXXqXKsygF5j7cHEY+bXhAMcXUts5KBKoLzM=";
|
||||
|
||||
ldflags = ["-s" "-w"];
|
||||
}
|
14
nix/shell.nix
Normal file
14
nix/shell.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
mkShell,
|
||||
go,
|
||||
gopls,
|
||||
delve,
|
||||
}:
|
||||
mkShell {
|
||||
name = "go";
|
||||
packages = [
|
||||
delve
|
||||
go
|
||||
gopls
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue