mirror of
https://github.com/TECHNOFAB11/powerproto.git
synced 2025-12-11 23:50:04 +01:00
chore: add nix flake
This commit is contained in:
parent
507039ecc0
commit
4a61b4dc3d
3 changed files with 77 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
.vscode
|
||||
.idea
|
||||
dist
|
||||
dist
|
||||
result
|
||||
|
|
|
|||
41
flake.lock
generated
Normal file
41
flake.lock
generated
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1687555006,
|
||||
"narHash": "sha256-GD2Kqb/DXQBRJcHqkM2qFZqbVenyO7Co/80JHRMg2U0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "33223d479ffde3d05ac16c6dff04ae43cc27e577",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-23.05",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "systems",
|
||||
"type": "indirect"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
34
flake.nix
Normal file
34
flake.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
description = "Powerproto";
|
||||
inputs.nixpkgs.url = "nixpkgs/nixos-23.05";
|
||||
|
||||
outputs = { self, nixpkgs, systems }:
|
||||
let
|
||||
version = "0.4.2";
|
||||
forEachSystem = nixpkgs.lib.genAttrs (import systems);
|
||||
nixpkgsFor = forEachSystem (system: import nixpkgs { inherit system; });
|
||||
in {
|
||||
# Provide some binary packages for selected system types.
|
||||
packages = forEachSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in {
|
||||
powerproto = pkgs.buildGoModule {
|
||||
pname = "powerproto";
|
||||
inherit version;
|
||||
|
||||
src = ./.;
|
||||
CGO_ENABLED = 0;
|
||||
|
||||
ldflags = [ "-s" "-w" "-X main.Version=${version}" ];
|
||||
|
||||
vendorSha256 = "sha256-MwL6eA5u7dusWDIgbfyyvNqoP4ZhpSWaQuLsUI+YU9k=";
|
||||
|
||||
doCheck = false;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
defaultPackage = forEachSystem (system: self.packages.${system}.powerproto);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue