From 384c9986b867caca5a58329b364bf6c82ea29173 Mon Sep 17 00:00:00 2001 From: Petri Hienonen Date: Mon, 20 Oct 2025 07:37:43 +0300 Subject: Initial commit --- flake.nix | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2be9687 --- /dev/null +++ b/flake.nix @@ -0,0 +1,68 @@ +{ + description = "Minimal Gio (gioui.org) development environment with Go support"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + + gioDeps = with pkgs; [ + go + gopls + git + pkg-config + # X11 + Wayland deps + xorg.libX11 + xorg.libXcursor + xorg.libXrandr + xorg.libXinerama + xorg.libXi + xorg.libXext + libGL + wayland + wayland-protocols + libxkbcommon + # Text rendering + cairo + pango + harfbuzz + freetype + fontconfig + ]; + in + { + devShells.default = pkgs.mkShell { + name = "gio-dev"; + packages = gioDeps; + + shellHook = '' + export CGO_ENABLED=1 + export PKG_CONFIG_PATH=${pkgs.lib.makeSearchPath "lib/pkgconfig" gioDeps} + export GIO_USE_WAYLAND=1 + echo "✅ Gio development shell ready." + echo "Run 'go run .' to start your app." + ''; + }; + + apps.default = { + type = "app"; + program = "${pkgs.go}/bin/go run ."; + }; + } + ); +} -- cgit v1.2.3-70-g09d2