mirror of
https://github.com/NotAShelf/Echo.git
synced 2024-11-01 11:41:13 +00:00
default.nix
nix tooling
This commit is contained in:
parent
658048a173
commit
475f8d0c3c
4 changed files with 87 additions and 0 deletions
23
default.nix
Normal file
23
default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
buildGoModule,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
pname = "echo";
|
||||
version = "0.1.0";
|
||||
in
|
||||
buildGoModule {
|
||||
inherit pname version;
|
||||
src = builtins.filterSource (path: type: type != "directory" || baseNameOf path != ".git" || lib.hasSuffix ".nix" path) ./.;
|
||||
vendorHash = null;
|
||||
|
||||
ldflags = ["-s" "-w" "-X main.version=${version}"];
|
||||
|
||||
meta = {
|
||||
description = "Simple & lighweight mock server on localhost for testing.";
|
||||
homepage = "https://github.com/notAShelf/echo";
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [NotAShelf];
|
||||
mainProgram = pname;
|
||||
};
|
||||
}
|
26
flake.lock
Normal file
26
flake.lock
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1701454111,
|
||||
"narHash": "sha256-G0Fvu9rBmeEozsFxLLIJKx/KG+/+MNW9Rq5y3V/BBqs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c1f0be03736e6d5ab4d19e867e6684686203eee8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
23
flake.nix
Normal file
23
flake.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
description = "Simple & lighweight mock server on localhost for testing. ";
|
||||
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 {
|
||||
packages = forEachSystem (system: {
|
||||
echo = pkgsForEach.${system}.callPackage ./default.nix {};
|
||||
default = self.packages.${system}.echo;
|
||||
});
|
||||
|
||||
devShells = forEachSystem (system: {
|
||||
default = pkgsForEach.${system}.callPackage ./shell.nix {};
|
||||
});
|
||||
};
|
||||
}
|
15
shell.nix
Normal file
15
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…
Reference in a new issue