From d66eb26ab16fed00a72e69ef27053ea9c33108c9 Mon Sep 17 00:00:00 2001 From: speckitor Date: Wed, 21 Jan 2026 22:43:45 +0700 Subject: [PATCH] flake.nix --- .gitignore | 1 + flake.nix | 42 +++++++++++++++++++++++++++++++++++------- result | 1 + 3 files changed, 37 insertions(+), 7 deletions(-) create mode 120000 result diff --git a/.gitignore b/.gitignore index 08ace1e..b5093d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ absinthe .cache/ +result/ compile_commands.json xdg-shell-protocol.h diff --git a/flake.nix b/flake.nix index d9e7ede..2170ea3 100644 --- a/flake.nix +++ b/flake.nix @@ -8,13 +8,41 @@ outputs = { self, nixpkgs, ... }: let system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; in { - devShells."${system}".default = - let - pkgs = import nixpkgs { inherit system; }; - in - pkgs.mkShell { + packages.${system}.default = pkgs.stdenv.mkDerivation { + pname = "absinthe"; + version = "0.1"; + + src = ./.; + + nativeBuildInputs = with pkgs; [ + gcc + gnumake + pkg-config + wayland-scanner + ]; + + buildInputs = with pkgs; [ + wayland + wayland-protocols + wlroots_0_19 + pixman + libxkbcommon + ]; + + buildPhase = '' + make + ''; + + installPhase = '' + mkdir -p $out/bin + cp absinthe $out/bin/ + ''; + }; + + devShells."${system}".default = pkgs.mkShell { packages = with pkgs; [ pkg-config gnumake @@ -25,12 +53,12 @@ wlroots_0_19 pixman libxkbcommon - zsh + fish ]; shellHook = '' echo "Absinthe dev shell" - exec zsh + exec fish ''; }; }; diff --git a/result b/result new file mode 120000 index 0000000..21ff40e --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/4f2jgjcrdyyrcajbn286czd73y7vlk8z-absinthe-0.1 \ No newline at end of file