···542 # If copytoram is enabled: skip mounting the ISO and copy its content to a tmpfs.
543 if [ -n "$copytoram" ] && [ "$device" = /dev/root ] && [ "$mountPoint" = /iso ]; then
544 fsType=$(blkid -o value -s TYPE "$device")
545- fsSize=$(blockdev --getsize64 "$device")
546547 mkdir -p /tmp-iso
548 mount -t "$fsType" /dev/root /tmp-iso
···542 # If copytoram is enabled: skip mounting the ISO and copy its content to a tmpfs.
543 if [ -n "$copytoram" ] && [ "$device" = /dev/root ] && [ "$mountPoint" = /iso ]; then
544 fsType=$(blkid -o value -s TYPE "$device")
545+ fsSize=$(blockdev --getsize64 "$device" || stat -Lc '%s' "$device")
546547 mkdir -p /tmp-iso
548 mount -t "$fsType" /dev/root /tmp-iso
···1516 doCheck = false;
1718- buildFlagsArray = [ "-ldflags= -s -w -X=main.Version=${version}" ];
1920 meta = with lib; {
21 description = "Manage your charm account on the CLI";
···1516 doCheck = false;
1718+ ldflags = [ "-s" "-w" "-X=main.Version=${version}" ];
1920 meta = with lib; {
21 description = "Manage your charm account on the CLI";
+5-5
pkgs/applications/misc/dstask/default.nix
···24 # The other variables are set so that the output of dstask version shows the
25 # git ref and the release version from github.
26 # Ref <https://github.com/NixOS/nixpkgs/pull/87383#discussion_r432097657>
27- buildFlagsArray = [ ''
28- -ldflags=-w -s
29- -X "github.com/naggie/dstask.VERSION=${version}"
30- -X "github.com/naggie/dstask.GIT_COMMIT=v${version}"
31- '' ];
3233 subPackages = [ "cmd/dstask.go" ];
34
···24 # The other variables are set so that the output of dstask version shows the
25 # git ref and the release version from github.
26 # Ref <https://github.com/NixOS/nixpkgs/pull/87383#discussion_r432097657>
27+ ldflags = [
28+ "-w" "-s"
29+ "-X github.com/naggie/dstask.VERSION=${version}"
30+ "-X github.com/naggie/dstask.GIT_COMMIT=v${version}"
31+ ];
3233 subPackages = [ "cmd/dstask.go" ];
34
···1516 subPackages = [ "." ];
1718- buildFlagsArray = [ "-ldflags=-s -w -X github.com/GoogleContainerTools/kpt/run.version=${version}" ];
1920 meta = with lib; {
21 description = "A toolkit to help you manage, manipulate, customize, and apply Kubernetes Resource configuration data files";
···1516 subPackages = [ "." ];
1718+ ldflags = [ "-s" "-w" "-X github.com/GoogleContainerTools/kpt/run.version=${version}" ];
1920 meta = with lib; {
21 description = "A toolkit to help you manage, manipulate, customize, and apply Kubernetes Resource configuration data files";
···1718 subPackages = [ "cmd/tilt" ];
1920- buildFlagsArray = [ "-ldflags=-X main.version=${version}" ];
2122 meta = with lib; {
23 description = "Local development tool to manage your developer instance when your team deploys to Kubernetes in production";
···1718 subPackages = [ "cmd/tilt" ];
1920+ ldflags = [ "-X main.version=${version}" ];
2122 meta = with lib; {
23 description = "Local development tool to manage your developer instance when your team deploys to Kubernetes in production";
···1516 subPackages = [ "." ];
1718- buildFlagsArray = [ "-ldflags=-s -w" ];
1920 meta = with lib; {
21 description = "Synchronize your DNS to multiple providers from a simple DSL";
···1516 subPackages = [ "." ];
1718+ ldflags = [ "-s" "-w" ];
1920 meta = with lib; {
21 description = "Synchronize your DNS to multiple providers from a simple DSL";
+1-1
pkgs/applications/networking/nextdns/default.nix
···1516 doCheck = false;
1718- buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
1920 meta = with lib; {
21 description = "NextDNS DNS/53 to DoH Proxy";
···1516 doCheck = false;
1718+ ldflags = [ "-s" "-w" "-X main.version=${version}" ];
1920 meta = with lib; {
21 description = "NextDNS DNS/53 to DoH Proxy";
···99 writeBashBin = name:
100 writeBash "/bin/${name}";
101102- # writeC writes an executable c package called `name` to `destination` using `libraries`.
103- #
104- # Examples:
105- # writeC "hello-world-ncurses" { libraries = [ pkgs.ncurses ]; } ''
106- # #include <ncurses.h>
107- # int main() {
108- # initscr();
109- # printw("Hello World !!!");
110- # refresh(); endwin();
111- # return 0;
112- # }
113- # ''
114- writeC = name: {
115- libraries ? [],
116- strip ? true
117- }:
118- makeBinWriter {
119- compileScript = ''
120- PATH=${makeBinPath [
121- pkgs.binutils-unwrapped
122- pkgs.coreutils
123- pkgs.findutils
124- pkgs.gcc
125- pkgs.pkg-config
126- ]}
127- export PKG_CONFIG_PATH=${concatMapStringsSep ":" (pkg: "${pkg}/lib/pkgconfig") libraries}
128- gcc \
129- ${optionalString (libraries != [])
130- "$(pkg-config --cflags --libs ${
131- concatMapStringsSep " " (pkg: "$(find ${escapeShellArg pkg}/lib/pkgconfig -name \\*.pc)") libraries
132- })"
133- } \
134- -O \
135- -o "$out" \
136- -Wall \
137- -x c \
138- "$contentPath"
139- '';
140- inherit strip;
141- } name;
142-143- # writeCBin takes the same arguments as writeC but outputs a directory (like writeScriptBin)
144- writeCBin = name:
145- writeC "/bin/${name}";
146-147 # Like writeScript but the first line is a shebang to dash
148 #
149 # Example:
···99 writeBashBin = name:
100 writeBash "/bin/${name}";
101000000000000000000000000000000000000000000000102 # Like writeScript but the first line is a shebang to dash
103 #
104 # Example:
···2122 doCheck = false;
2324- buildFlagsArray = [ "-ldflags=-s -w -X github.com/superfly/flyctl/flyctl.Version=${version} -X github.com/superfly/flyctl/flyctl.Commit=${src.rev} -X github.com/superfly/flyctl/flyctl.BuildDate=1970-01-01T00:00:00+0000 -X github.com/superfly/flyctl/flyctl.Environment=production" ];
2526 meta = with lib; {
27 description = "Command line tools for fly.io services";
···2122 doCheck = false;
2324+ ldflags = [ "-s" "-w" "-X github.com/superfly/flyctl/flyctl.Version=${version}" "-X github.com/superfly/flyctl/flyctl.Commit=${src.rev}" "-X github.com/superfly/flyctl/flyctl.BuildDate=1970-01-01T00:00:00+0000" "-X github.com/superfly/flyctl/flyctl.Environment=production" ];
2526 meta = with lib; {
27 description = "Command line tools for fly.io services";
+1-1
pkgs/development/web/minify/default.nix
···1516 doCheck = false;
1718- buildFlagsArray = [ "-ldflags=-s -w -X main.Version=${version}" ];
1920 meta = with lib; {
21 description = "Minifiers for web formats";
···1516 doCheck = false;
1718+ ldflags = [ "-s" "-w" "-X main.Version=${version}" ];
1920 meta = with lib; {
21 description = "Minifiers for web formats";
+1-1
pkgs/os-specific/darwin/smimesign/default.nix
···1314 vendorSha256 = "1cldxykm9qj5rvyfafam45y5xj4f19700s2f9w7ndhxgfp9vahvz";
1516- buildFlagsArray = "-ldflags=-X main.versionString=v${version}";
1718 meta = with lib; {
19 description = "An S/MIME signing utility for macOS and Windows that is compatible with Git";
···1314 vendorSha256 = "1cldxykm9qj5rvyfafam45y5xj4f19700s2f9w7ndhxgfp9vahvz";
1516+ ldflags = [ "-X main.versionString=v${version}" ];
1718 meta = with lib; {
19 description = "An S/MIME signing utility for macOS and Windows that is compatible with Git";
···14 vendorSha256 = "sha256-kclpoZ33JOciP2IUCQZB5idA7rgbWxPPFNwZU+pEJFU=";
1516 # Taken from https://github.com/oauth2-proxy/oauth2-proxy/blob/master/Makefile
17- buildFlagsArray = ("-ldflags=-X main.VERSION=${version}");
1819 meta = with lib; {
20 description = "A reverse proxy that provides authentication with Google, Github, or other providers";
···14 vendorSha256 = "sha256-kclpoZ33JOciP2IUCQZB5idA7rgbWxPPFNwZU+pEJFU=";
1516 # Taken from https://github.com/oauth2-proxy/oauth2-proxy/blob/master/Makefile
17+ ldflags = [ "-X main.VERSION=${version}" ];
1819 meta = with lib; {
20 description = "A reverse proxy that provides authentication with Google, Github, or other providers";
+1-1
pkgs/servers/pg_featureserv/default.nix
···1314 vendorSha256 = "1jqrkx850ghmpnfjhqky93r8fq7q63m5ivs0lzljzbvn7ya75f2r";
1516- buildFlagsArray = [ "-ldflags=-s -w -X github.com/CrunchyData/pg_featureserv/conf.setVersion=${version}" ];
1718 meta = with lib; {
19 description = "Lightweight RESTful Geospatial Feature Server for PostGIS in Go";
···1314 vendorSha256 = "1jqrkx850ghmpnfjhqky93r8fq7q63m5ivs0lzljzbvn7ya75f2r";
1516+ ldflags = [ "-s" "-w" "-X github.com/CrunchyData/pg_featureserv/conf.setVersion=${version}" ];
1718 meta = with lib; {
19 description = "Lightweight RESTful Geospatial Feature Server for PostGIS in Go";
···19 # Tests need docker
20 doCheck = false;
2122- buildFlagsArray = [
23- # In the future, we might need to switch to `main.Version`, considering:
24- # https://github.com/aler9/rtsp-simple-server/issues/503
25- "-ldflags=-X github.com/aler9/rtsp-simple-server/internal/core.version=v${version}"
26 ];
2728 meta = with lib; {
···19 # Tests need docker
20 doCheck = false;
2122+ # In the future, we might need to switch to `main.Version`, considering:
23+ # https://github.com/aler9/rtsp-simple-server/issues/503
24+ ldflags = [
25+ "-X github.com/aler9/rtsp-simple-server/internal/core.version=v${version}"
26 ];
2728 meta = with lib; {
···1718 subPackages = [ "cmd/grpcui" ];
1920- buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
2122 meta = with lib; {
23 description = "An interactive web UI for gRPC, along the lines of postman";
···1718 subPackages = [ "cmd/grpcui" ];
1920+ ldflags = [ "-s" "-w" "-X main.version=${version}" ];
2122 meta = with lib; {
23 description = "An interactive web UI for gRPC, along the lines of postman";
+1-1
pkgs/tools/networking/grpcurl/default.nix
···1516 vendorSha256 = "sha256-nl8vKVhUMSO20qCDyhNkU5cghNy8vIFqSBvLk59nbWg=";
1718- buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
1920 meta = with lib; {
21 description = "Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers";
···1516 vendorSha256 = "sha256-nl8vKVhUMSO20qCDyhNkU5cghNy8vIFqSBvLk59nbWg=";
1718+ ldflags = [ "-s" "-w" "-X main.version=${version}" ];
1920 meta = with lib; {
21 description = "Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers";
···1516 doCheck = false;
1718- buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
1920 meta = with lib; {
21 description = "A simple deb and rpm packager written in Go";
···1516 doCheck = false;
1718+ ldflags = [ "-s" "-w" "-X main.version=${version}" ];
1920 meta = with lib; {
21 description = "A simple deb and rpm packager written in Go";
···12 };
13 vendorSha256 = "sha256-tTkPFftPDNXafIjAjNg6V6e/+2S/v5Do/YyAXPaGIqA=";
1415- buildFlagsArray = [
16- "-ldflags=-s -w -X main.version=${version}"
17 ];
1819 # Tests require a large variety of tools and resources to run including
···12 };
13 vendorSha256 = "sha256-tTkPFftPDNXafIjAjNg6V6e/+2S/v5Do/YyAXPaGIqA=";
1415+ ldflags = [
16+ "-s" "-w" "-X main.version=${version}"
17 ];
1819 # Tests require a large variety of tools and resources to run including