diff --git a/default.nix b/default.nix index 98e23d8..f895933 100644 --- a/default.nix +++ b/default.nix @@ -1,13 +1,16 @@ +{ static ? false # whether to build fully static binaries +}: + let - nixpkgs = builtins.fetchTarball + nixpkgs = import (builtins.fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/f12ee5f64c6a.tar.gz"; sha256 = "14afxk35w3kbqimxcp39ngv9cqpc24glss1727ymk4napfg5v7hm"; - }; + }) { }; - pkgs = import { }; + pkgs = if static then nixpkgs.pkgsStatic else nixpkgs; - magnetico = { lib, buildGoModule, nixosTests, sqlite }: + magnetico = { lib, stdenv, buildGoModule, nixosTests, sqlite }: buildGoModule { pname = "magnetico"; version = "0.12.1"; @@ -21,6 +24,8 @@ let tags = [ "fts5" "libsqlite3" ]; ldflags = [ "-s" "-w" ]; + doCheck = !stdenv.hostPlatform.isStatic; + passthru.tests = { inherit (nixosTests) magnetico; }; meta = with lib; {