nix build

This commit is contained in:
Cadey Ratio 2020-04-27 12:01:13 -04:00
parent 2accace70b
commit 6b7da06c0f
4 changed files with 97 additions and 1 deletions

3
.gitignore vendored
View File

@ -17,3 +17,6 @@
# Credentials # Credentials
.env .env
# Nix crud
result*

18
default.nix Normal file
View File

@ -0,0 +1,18 @@
{ pkgs ? import <nixpkgs> { }, nur ? import (builtins.fetchTarball
"https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
} }:
pkgs.buildGoPackage {
pname = "xatci";
version = "latest";
goPackagePath = "tulpa.dev/matriski/xatci";
src = ./.;
goDeps = ./deps.nix;
allowGoReference = false;
preBuild = ''
export CGO_ENABLED=0
buildFlagsArray+=(-pkgdir "$TMPDIR")
'';
}

75
deps.nix Normal file
View File

@ -0,0 +1,75 @@
# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix)
[
{
goPackagePath = "github.com/davecgh/go-spew";
fetch = {
type = "git";
url = "https://github.com/davecgh/go-spew";
rev = "v1.1.1";
sha256 = "0hka6hmyvp701adzag2g26cxdj47g21x6jz4sc6jjz1mn59d474y";
};
}
{
goPackagePath = "github.com/facebookarchive/flagenv";
fetch = {
type = "git";
url = "https://github.com/facebookarchive/flagenv";
rev = "fcd59fca7456";
sha256 = "0c7fw4y4gmdrn66dx7la637lx0hvs1w27x9j12wdx037n51r078g";
};
}
{
goPackagePath = "github.com/facebookgo/ensure";
fetch = {
type = "git";
url = "https://github.com/facebookgo/ensure";
rev = "63f1cf65ac4c";
sha256 = "05vi49g2967i5awcb1z69i2n5b5hwn06682kw90x81hbxlr0px36";
};
}
{
goPackagePath = "github.com/facebookgo/flagenv";
fetch = {
type = "git";
url = "https://github.com/facebookgo/flagenv";
rev = "fcd59fca7456";
sha256 = "0c7fw4y4gmdrn66dx7la637lx0hvs1w27x9j12wdx037n51r078g";
};
}
{
goPackagePath = "github.com/facebookgo/stack";
fetch = {
type = "git";
url = "https://github.com/facebookgo/stack";
rev = "751773369052";
sha256 = "07yr05mz7h007ldpij90zjflwgixp148sbyrdlh1fj5bikr4p8m3";
};
}
{
goPackagePath = "github.com/facebookgo/subset";
fetch = {
type = "git";
url = "https://github.com/facebookgo/subset";
rev = "c811ad88dec4";
sha256 = "1sjczgmq26mgqvh7267saypnn4sfdjx467wsm1pgdhyss77mc650";
};
}
{
goPackagePath = "github.com/joho/godotenv";
fetch = {
type = "git";
url = "https://github.com/joho/godotenv";
rev = "v1.3.0";
sha256 = "0ri8if0pc3x6jg4c3i8wr58xyfpxkwmcjk3rp8gb398a1aa3gpjm";
};
}
{
goPackagePath = "github.com/matrix-org/gomatrix";
fetch = {
type = "git";
url = "https://github.com/matrix-org/gomatrix";
rev = "408fff5e6a97";
sha256 = "0kgd7bzbz6ni43g2av7qiwwrgla339bvmgknh3ypzl66wjgfdmc5";
};
}
]

View File

@ -5,5 +5,5 @@ let
inherit pkgs; inherit pkgs;
}; };
in pkgs.mkShell { in pkgs.mkShell {
buildInputs = with pkgs; with nur.repos.xe; [ go goimports gopls ]; buildInputs = with pkgs; with nur.repos.xe; [ go goimports gopls vgo2nix ];
} }