!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

154 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.41 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
5 Mar 2024
@reese:cyberia.club@reese:cyberia.club joined the room.23:05:44
7 Mar 2024
@reese:cyberia.club@reese:cyberia.club

hey folks! i recently saw that the e2ee photo storage service ente.io had open-sourced their server so i'm trying to write a flake for it so i can self-host it. i'm doing that by looking at the Dockerfile in the server dir, and created a flake.nix. however, i'm running into trouble. here's what my flake looks like so far:

{
	description = "ente.io Museum server";

	inputs = {
		nixpkgs.url = "nixpkgs/nixos-unstable";
		utils.url = "github:numtide/flake-utils";
	};

	outputs = { self, nixpkgs, utils }:
		utils.lib.eachSystem [
			"x86_64-linux"
			"aarch64-linux"
			"x86_64-darwin"
			"aarch64-darwin"
		] (system: let
			pkgs = nixpkgs.legacyPackages.${system};
			version = "v2.0.34";
		in {
			packages = {
				default = pkgs.buildGoModule {
					pname = "museum";
					inherit version;
					src = ./.;
					nativeBuildInputs = with pkgs; [ gcc git libsodium musl pkg-config ];
					vendorHash = "sha256-D3pJYrip2EEj98q3pawnSkRUiIyjLm82jlmV7owA69Q=";
				};
			};

			# apps.default = utils.lib.mkApp { drv = self.packages.${system}.default; };

			# Ignore this, not relevant to the question
			#devShells.default = pkgs.mkShell {
				#buildInputs = with pkgs; [ gcc git go gopls gotools go-tools libsodium musl pkg-config ];
			#};
		});
}

when i run nix build:

warning: Git tree '...' is dirty
error: builder for '/nix/store/lwpw9bpyrvq8gs53jbwwz2gkimcgk7gl-museum-v2.0.34.drv' failed with exit code 1;
       last 10 log lines:
       > # pkg-config --cflags  -- libsodium libsodium
       > Package libsodium was not found in the pkg-config search path.
       > Perhaps you should add the directory containing `libsodium.pc'
       > to the PKG_CONFIG_PATH environment variable
       > No package 'libsodium' found
       > Package libsodium was not found in the pkg-config search path.
       > Perhaps you should add the directory containing `libsodium.pc'
       > to the PKG_CONFIG_PATH environment variable
       > No package 'libsodium' found
       > pkg-config: exit status 1
       For full logs, run 'nix log /nix/store/lwpw9bpyrvq8gs53jbwwz2gkimcgk7gl-museum-v2.0.34.drv'.

why is pkg-config not finding libsodium? is there something i need to pass to pkgs.buildGoModule to make it work?

thanks in advance.

00:30:13
@reese:cyberia.club@reese:cyberia.club *

hey folks! i recently saw that the e2ee photo storage service ente.io had open-sourced their server so i'm trying to write a flake for it so i can self-host it. i'm doing that by looking at the Dockerfile in the server dir, and this flake.nix is in that dir as well. however, i'm running into trouble. here's what my flake looks like so far:

{
	description = "ente.io Museum server";

	inputs = {
		nixpkgs.url = "nixpkgs/nixos-unstable";
		utils.url = "github:numtide/flake-utils";
	};

	outputs = { self, nixpkgs, utils }:
		utils.lib.eachSystem [
			"x86_64-linux"
			"aarch64-linux"
			"x86_64-darwin"
			"aarch64-darwin"
		] (system: let
			pkgs = nixpkgs.legacyPackages.${system};
			version = "v2.0.34";
		in {
			packages = {
				default = pkgs.buildGoModule {
					pname = "museum";
					inherit version;
					src = ./.;
					nativeBuildInputs = with pkgs; [ gcc git libsodium musl pkg-config ];
					vendorHash = "sha256-D3pJYrip2EEj98q3pawnSkRUiIyjLm82jlmV7owA69Q=";
				};
			};

			# apps.default = utils.lib.mkApp { drv = self.packages.${system}.default; };

			# Ignore this, not relevant to the question
			#devShells.default = pkgs.mkShell {
				#buildInputs = with pkgs; [ gcc git go gopls gotools go-tools libsodium musl pkg-config ];
			#};
		});
}

when i run nix build:

warning: Git tree '...' is dirty
error: builder for '/nix/store/lwpw9bpyrvq8gs53jbwwz2gkimcgk7gl-museum-v2.0.34.drv' failed with exit code 1;
       last 10 log lines:
       > # pkg-config --cflags  -- libsodium libsodium
       > Package libsodium was not found in the pkg-config search path.
       > Perhaps you should add the directory containing `libsodium.pc'
       > to the PKG_CONFIG_PATH environment variable
       > No package 'libsodium' found
       > Package libsodium was not found in the pkg-config search path.
       > Perhaps you should add the directory containing `libsodium.pc'
       > to the PKG_CONFIG_PATH environment variable
       > No package 'libsodium' found
       > pkg-config: exit status 1
       For full logs, run 'nix log /nix/store/lwpw9bpyrvq8gs53jbwwz2gkimcgk7gl-museum-v2.0.34.drv'.

why is pkg-config not finding libsodium? is there something i need to pass to pkgs.buildGoModule to make it work?

thanks in advance.

01:02:52
@qbit:tapenet.orgqbit
In reply to @reese:cyberia.club

hey folks! i recently saw that the e2ee photo storage service ente.io had open-sourced their server so i'm trying to write a flake for it so i can self-host it. i'm doing that by looking at the Dockerfile in the server dir, and this flake.nix is in that dir as well. however, i'm running into trouble. here's what my flake looks like so far:

{
	description = "ente.io Museum server";

	inputs = {
		nixpkgs.url = "nixpkgs/nixos-unstable";
		utils.url = "github:numtide/flake-utils";
	};

	outputs = { self, nixpkgs, utils }:
		utils.lib.eachSystem [
			"x86_64-linux"
			"aarch64-linux"
			"x86_64-darwin"
			"aarch64-darwin"
		] (system: let
			pkgs = nixpkgs.legacyPackages.${system};
			version = "v2.0.34";
		in {
			packages = {
				default = pkgs.buildGoModule {
					pname = "museum";
					inherit version;
					src = ./.;
					nativeBuildInputs = with pkgs; [ gcc git libsodium musl pkg-config ];
					vendorHash = "sha256-D3pJYrip2EEj98q3pawnSkRUiIyjLm82jlmV7owA69Q=";
				};
			};

			# apps.default = utils.lib.mkApp { drv = self.packages.${system}.default; };

			# Ignore this, not relevant to the question
			#devShells.default = pkgs.mkShell {
				#buildInputs = with pkgs; [ gcc git go gopls gotools go-tools libsodium musl pkg-config ];
			#};
		});
}

when i run nix build:

warning: Git tree '...' is dirty
error: builder for '/nix/store/lwpw9bpyrvq8gs53jbwwz2gkimcgk7gl-museum-v2.0.34.drv' failed with exit code 1;
       last 10 log lines:
       > # pkg-config --cflags  -- libsodium libsodium
       > Package libsodium was not found in the pkg-config search path.
       > Perhaps you should add the directory containing `libsodium.pc'
       > to the PKG_CONFIG_PATH environment variable
       > No package 'libsodium' found
       > Package libsodium was not found in the pkg-config search path.
       > Perhaps you should add the directory containing `libsodium.pc'
       > to the PKG_CONFIG_PATH environment variable
       > No package 'libsodium' found
       > pkg-config: exit status 1
       For full logs, run 'nix log /nix/store/lwpw9bpyrvq8gs53jbwwz2gkimcgk7gl-museum-v2.0.34.drv'.

why is pkg-config not finding libsodium? is there something i need to pass to pkgs.buildGoModule to make it work?

thanks in advance.

nice! I was gonna do the same :D
01:32:12
@qbit:tapenet.orgqbit reese (they/them): you might need libsodium in buildInputs 01:35:05
@qbit:tapenet.orgqbit also you will need proxyVendor = true; 01:35:07
@reese:cyberia.club@reese:cyberia.club

well now i get this wall of text:

error: builder for '/nix/store/3zrl40q8fcn8159qcp9wq059lk0fx3dh-museum-v2.0.34.drv' failed with exit code 1;
       last 10 log lines:
       > pkg/middleware/rate_limit.go:16:2: github.com/ulule/limiter/v3@v3.8.0: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/github.com/ulule/limiter/v3/@v/v3.8.0.zip: no such file or directory
       > cmd/museum/main.go:60:2: github.com/gin-contrib/gzip@v0.0.5: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/github.com/gin-contrib/gzip/@v/v0.0.5.zip: no such file or directory
       > cmd/museum/main.go:62:2: github.com/gin-contrib/timeout@v0.0.3: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/github.com/gin-contrib/timeout/@v/v0.0.3.zip: no such file or directory
       > cmd/museum/main.go:64:2: github.com/golang-migrate/migrate/v4@v4.12.2: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/github.com/golang-migrate/migrate/v4/@v/v4.12.2.zip: no such file or directory
       > cmd/museum/main.go:65:2: github.com/golang-migrate/migrate/v4@v4.12.2: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/github.com/golang-migrate/migrate/v4/@v/v4.12.2.zip: no such file or directory
       > cmd/museum/main.go:66:2: github.com/golang-migrate/migrate/v4@v4.12.2: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/github.com/golang-migrate/migrate/v4/@v/v4.12.2.zip: no such file or directory
       > cmd/museum/main.go:71:2: github.com/prometheus/client_golang@v1.11.1: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/github.com/prometheus/client_golang/@v/v1.11.1.zip: no such file or directory
       > cmd/museum/main.go:72:2: github.com/robfig/cron/v3@v3.0.1: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/github.com/robfig/cron/v3/@v/v3.0.1.zip: no such file or directory
       > cmd/museum/main.go:75:2: github.com/zsais/go-gin-prometheus@v0.1.0: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/github.com/zsais/go-gin-prometheus/@v/v0.1.0.zip: no such file or directory
       > cmd/museum/main.go:76:2: gopkg.in/natefinch/lumberjack.v2@v2.0.0: reading file:///nix/store/m73mv6hcxpiahl09ipgm8zyg4p67bvh1-museum-v2.0.34-go-modules/gopkg.in/natefinch/lumberjack.v2/@v/v2.0.0.zip: no such file or directory
       For full logs, run 'nix log /nix/store/3zrl40q8fcn8159qcp9wq059lk0fx3dh-museum-v2.0.34.drv'.
01:42:48
@diamondburned:matrix.orgDiamond (it/she)
In reply to @qbit:tapenet.org
also you will need proxyVendor = true;
what's this for!
01:44:22
@diamondburned:matrix.orgDiamond (it/she)* what's this for? 01:44:29
@reese:cyberia.club@reese:cyberia.club

without that i get

error: builder for '/nix/store/4fb4z6mgl19hyg79065jgm7bs9mgxrij-museum-v2.0.34.drv' failed with exit code 1;
       last 10 log lines:
       > Building subPackage ./pkg/utils/time
       > Building subPackage ./tools/abort-unfinished-multipart-uploads
       > Building subPackage ./tools/gen-random-keys
       > Building subPackage ./tools/pkg/cli
       > Building subPackage ./tools/test-wasabi-compliance
       > buildPhase completed in 30 seconds
       > Running phase: checkPhase
       > time="2024-03-07T01:45:40Z" level=fatal msg="Not running tests in non-test environment"
       > FAIL	github.com/ente-io/museum/pkg/repo/storagebonus	0.006s
       > FAIL
01:48:36
@reese:cyberia.club@reese:cyberia.club *

without proxyVendor i get

error: builder for '/nix/store/4fb4z6mgl19hyg79065jgm7bs9mgxrij-museum-v2.0.34.drv' failed with exit code 1;
       last 10 log lines:
       > Building subPackage ./pkg/utils/time
       > Building subPackage ./tools/abort-unfinished-multipart-uploads
       > Building subPackage ./tools/gen-random-keys
       > Building subPackage ./tools/pkg/cli
       > Building subPackage ./tools/test-wasabi-compliance
       > buildPhase completed in 30 seconds
       > Running phase: checkPhase
       > time="2024-03-07T01:45:40Z" level=fatal msg="Not running tests in non-test environment"
       > FAIL	github.com/ente-io/museum/pkg/repo/storagebonus	0.006s
       > FAIL
01:48:53
@qbit:tapenet.orgqbit
In reply to @reese:cyberia.club

without proxyVendor i get

error: builder for '/nix/store/4fb4z6mgl19hyg79065jgm7bs9mgxrij-museum-v2.0.34.drv' failed with exit code 1;
       last 10 log lines:
       > Building subPackage ./pkg/utils/time
       > Building subPackage ./tools/abort-unfinished-multipart-uploads
       > Building subPackage ./tools/gen-random-keys
       > Building subPackage ./tools/pkg/cli
       > Building subPackage ./tools/test-wasabi-compliance
       > buildPhase completed in 30 seconds
       > Running phase: checkPhase
       > time="2024-03-07T01:45:40Z" level=fatal msg="Not running tests in non-test environment"
       > FAIL	github.com/ente-io/museum/pkg/repo/storagebonus	0.006s
       > FAIL
you might need to specify the submodules to build
01:58:56
@qbit:tapenet.orgqbitsubpackages? i can't ever remember 01:59:04
@qbit:tapenet.orgqbit
In reply to @diamondburned:matrix.org
what's this for?
stuff that uses cgo
01:59:10
@diamondburned:matrix.orgDiamond (it/she)wait interesting 01:59:35
@diamondburned:matrix.orgDiamond (it/she)it never had to enable that for Cgo stuff01:59:41
@qbit:tapenet.orgqbit supPackages 01:59:56
@qbit:tapenet.orgqbit
In reply to @diamondburned:matrix.org
it never had to enable that for Cgo stuff
if you have a FOD for the vendor stuff you need it
02:00:20
@qbit:tapenet.orgqbitor you get a different fod on different arches / os combos02:00:34
@diamondburned:matrix.orgDiamond (it/she)oh that latter part is weird 02:02:17
@diamondburned:matrix.orgDiamond (it/she)huh idk 02:02:19
@diamondburned:matrix.orgDiamond (it/she) it just never needed it for Cgo stuff, like Dissent just doesn't need it and it's probably the most Cgo-heavy program ever 02:02:52
@reese:cyberia.club@reese:cyberia.clubhmm dang i have no experience with cgo tbh02:03:19
@reese:cyberia.club@reese:cyberia.club * hmm dang i know nothing about cgo tbh02:03:58
@fractivore:cyberia.clubSYMYƧ reese (they/them): yoo!! Good to see ya over here in nixos.org land 😄 Anyway I suggest increasing the verbosity level, try 3 and see if it makes it clear (by passing the --verbose flag to nix develop twice). 02:33:08
@fractivore:cyberia.clubSYMYƧIf you haven't already02:33:34
@fractivore:cyberia.clubSYMYƧ4 is super verbose, and 5 accurately self-describes as "vomit", that verbosity level goes beyond helpful02:34:28
@qbit:tapenet.orgqbitverbosity probably won't get ya much more - the error is right there02:34:32
@qbit:tapenet.orgqbit subPackages = [ 'cmd/museum' ]; is probably all ya need now 02:35:02
@reese:cyberia.club@reese:cyberia.clubit says there is an invalid token in that string 🤨02:37:24

Show newer messages


Back to Room ListRoom Version: 9