Switch shell.nix to flake.nix

This commit is contained in:
Javier Feliz 2025-09-05 23:51:35 -04:00
parent 54c246c9dd
commit b9c4c65082
6 changed files with 122 additions and 39 deletions

1
.direnv/flake-profile Symbolic link
View File

@ -0,0 +1 @@
flake-profile-3-link

View File

@ -0,0 +1 @@
/nix/store/8b5yx1xf1rxjli92p6d51naaglfvpxm7-nix-shell-env

21
.envrc
View File

@ -1 +1,20 @@
use nix use flake
# Environment variables for GTK4/Wayland
export GDK_BACKEND=wayland
# Show development environment info (only once per shell session)
if [[ -z "$WAYCAST_DEV_SHOWN" ]]; then
export WAYCAST_DEV_SHOWN=1
echo "=== Waycast Development Environment ==="
echo "gtk4: $(pkg-config --modversion gtk4 2>/dev/null || echo missing)"
echo "gtk4-layer-shell: $(pkg-config --modversion gtk4-layer-shell-0 2>/dev/null || echo missing)"
echo "wayland-client: $(pkg-config --modversion wayland-client 2>/dev/null || echo missing)"
echo ""
echo "Environment:"
echo " XDG_SESSION_TYPE=$XDG_SESSION_TYPE"
echo " WAYLAND_DISPLAY=$WAYLAND_DISPLAY"
echo " GDK_BACKEND=$GDK_BACKEND"
echo ""
echo "Ready for Waycast development! 🚀"
fi

61
flake.lock generated Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1756787288,
"narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

39
flake.nix Normal file
View File

@ -0,0 +1,39 @@
{
description = "Waycast - GTK4-based application launcher for Wayland compositors";
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 = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
# Build tools
pkg-config
# GTK4 stack
gtk4
glib
gdk-pixbuf
pango
cairo
harfbuzz
librsvg
# Wayland + layer shell (GTK4 variant)
wayland
gtk4-layer-shell
# Icons (so themed icons resolve)
hicolor-icon-theme
adwaita-icon-theme
];
};
});
}

View File

@ -1,38 +0,0 @@
# shell.nix
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
# Tools youll use directly
buildInputs = [
pkgs.pkg-config
# GTK4 stack
pkgs.gtk4
pkgs.glib
pkgs.gdk-pixbuf
pkgs.pango
pkgs.cairo
pkgs.harfbuzz
pkgs.librsvg
# Wayland + layer shell (GTK4 variant)
pkgs.wayland
pkgs.gtk4-layer-shell
# Icons (so themed icons resolve; harmless even if you don't use yet)
pkgs.hicolor-icon-theme
pkgs.adwaita-icon-theme
];
shellHook = ''
export GDK_BACKEND=wayland
echo "gtk4: $(pkg-config --modversion gtk4 2>/dev/null || echo missing)"
echo "gtk4-layer-shell: $(pkg-config --modversion gtk4-layer-shell-0 2>/dev/null || echo missing)"
echo "wayland-client: $(pkg-config --modversion wayland-client 2>/dev/null || echo missing)"
echo "XDG_SESSION_TYPE=$XDG_SESSION_TYPE"
echo "WAYLAND_DISPLAY=$WAYLAND_DISPLAY"
echo "GDK_BACKEND=$GDK_BACKEND"
'';
}