{ description = "HTTP service to control monitor brightness"; outputs = { self, nixpkgs, ... }: let system = "x86_64-linux"; in { packages.${system} = { default = nixpkgs.legacyPackages.${system}.callPackage ({ lib, go, buildGoModule }: buildGoModule rec { pname = "ddcutil-daemon"; version = "0.0.1"; src = ./.; # preConfigure phase to compile a statically linked executable preConfigure = '' export CGO_ENABLED=0 export GOOS=linux export GOARCH=amd64 ''; ldflags = let t = "github.com/kitnil/ddcutil-daemon"; in [ "-s" # stripped binary "-X ${t}.Version=${version}" "-X ${t}.Branch=unknown" "-X ${t}.BuildUser=nix@nixpkgs" "-X ${t}.BuildDate=unknown" "-X ${t}.GoVersion=${lib.getVersion go}" ]; vendorSha256 = null; meta = with lib; { description = "HTTP service to control monitor brightness."; homepage = "https://github.com/kitnil/ddcutil-daemon"; license = licenses.asl20; platforms = platforms.unix; }; }) { }; }; }; }