summaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2025-10-20 07:37:43 +0300
committerPetri Hienonen <petri.hienonen@gmail.com>2025-10-20 07:37:43 +0300
commit384c9986b867caca5a58329b364bf6c82ea29173 (patch)
treed36ee565b433b9d6dcae08e0a77d444961bf22ca /flake.nix
downloadcopper-384c9986b867caca5a58329b364bf6c82ea29173.tar.zst
Initial commit
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix68
1 files changed, 68 insertions, 0 deletions
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 .";
+ };
+ }
+ );
+}