diff --git a/.gitignore b/.gitignore index 402973f..eabb524 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ # Credentials .env + +# Nix crud +result* diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..61ada55 --- /dev/null +++ b/default.nix @@ -0,0 +1,18 @@ +{ pkgs ? import { }, 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") + ''; +} diff --git a/deps.nix b/deps.nix new file mode 100644 index 0000000..0cee430 --- /dev/null +++ b/deps.nix @@ -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"; + }; + } +] diff --git a/shell.nix b/shell.nix index 7e51531..b6b2df8 100644 --- a/shell.nix +++ b/shell.nix @@ -5,5 +5,5 @@ let inherit pkgs; }; in pkgs.mkShell { - buildInputs = with pkgs; with nur.repos.xe; [ go goimports gopls ]; + buildInputs = with pkgs; with nur.repos.xe; [ go goimports gopls vgo2nix ]; }