From 7aabab4a92c0a0346ab3678b775ca5e1471da5d7 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sun, 9 Jun 2024 00:22:15 +0300 Subject: [PATCH] Nix: add hyprutils dep --- flake.lock | 30 +++++++++++++++++++++++++++--- flake.nix | 26 ++++++++++++++++++-------- nix/default.nix | 9 ++++++++- 3 files changed, 53 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 2341deb..6650250 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,35 @@ { "nodes": { + "hyprutils": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": [ + "systems" + ] + }, + "locked": { + "lastModified": 1717881334, + "narHash": "sha256-a0inRgJhPL6v9v7RPM/rx1kbXdfe3xJA1c9z0ZkYnh4=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "0693f9398ab693d89c9a0aa3b3d062dd61b7a60e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1708475490, - "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=", + "lastModified": 1717602782, + "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0e74ca98a74bc7270d28838369593635a5db3260", + "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", "type": "github" }, "original": { @@ -18,6 +41,7 @@ }, "root": { "inputs": { + "hyprutils": "hyprutils", "nixpkgs": "nixpkgs", "systems": "systems" } diff --git a/flake.nix b/flake.nix index 78bcd8e..985f7a1 100644 --- a/flake.nix +++ b/flake.nix @@ -4,13 +4,20 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; systems.url = "github:nix-systems/default-linux"; + + hyprutils = { + url = "github:hyprwm/hyprutils"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.systems.follows = "systems"; + }; }; outputs = { self, nixpkgs, systems, - }: let + ... + } @ inputs: let inherit (nixpkgs) lib; eachSystem = lib.genAttrs (import systems); pkgsFor = eachSystem (system: @@ -26,13 +33,16 @@ in { overlays = { default = self.overlays.hyprlang; - hyprlang = final: prev: { - hyprlang = final.callPackage ./nix/default.nix { - stdenv = final.gcc13Stdenv; - version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); - }; - hyprlang-with-tests = final.hyprlang.override {doCheck = true;}; - }; + hyprlang = lib.composeManyExtensions [ + inputs.hyprutils.overlays.default + (final: prev: { + hyprlang = final.callPackage ./nix/default.nix { + stdenv = final.gcc13Stdenv; + version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); + }; + hyprlang-with-tests = final.hyprlang.override {doCheck = true;}; + }) + ]; }; packages = eachSystem (system: { diff --git a/nix/default.nix b/nix/default.nix index fa91166..25df375 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -2,6 +2,8 @@ lib, stdenv, cmake, + hyprutils, + pkg-config, version ? "git", doCheck ? false, }: @@ -10,7 +12,12 @@ stdenv.mkDerivation { inherit version doCheck; src = ../.; - nativeBuildInputs = [cmake]; + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [hyprutils]; outputs = ["out" "dev"];