feat: added nix flake

This commit is contained in:
Felix Ulonska 2022-12-31 00:59:01 +01:00
parent 2c3af24f9c
commit 66661e766c
3 changed files with 72 additions and 0 deletions

2
.gitignore vendored
View File

@ -75,3 +75,5 @@ fabric.properties
/tcpDialer.go
/hochwasser
/hochwasser.exe
result

43
flake.lock Normal file
View File

@ -0,0 +1,43 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1672428209,
"narHash": "sha256-eejhqkDz2cb2vc5VeaWphJz8UXNuoNoM8/Op8eWv2tQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View File

@ -0,0 +1,27 @@
{
description = "Build Golang";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in
rec {
devShell = pkgs.mkShell {
buildInputs = [
pkgs.go
];
};
defaultPackage = pkgs.buildGoModule {
pname = "Hochwasser";
name = "Hochwasser";
src = ./.;
vendorSha256 = "sha256-wc52mzV8cs4X1pQHIDcwh2oZiPLLUJwGN/nU9HJvZpQ=";
};
apps.default = { type = "app"; program = "${defaultPackage}/bin/Hochwasser"; };
});
}