Nix: add hyprutils dep

This commit is contained in:
Mihai Fufezan 2024-06-09 00:22:15 +03:00
parent 28be0805b1
commit 7aabab4a92
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
3 changed files with 53 additions and 12 deletions

View file

@ -1,12 +1,35 @@
{ {
"nodes": { "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1708475490, "lastModified": 1717602782,
"narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=", "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0e74ca98a74bc7270d28838369593635a5db3260", "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -18,6 +41,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"hyprutils": "hyprutils",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"systems": "systems" "systems": "systems"
} }

View file

@ -4,13 +4,20 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux"; systems.url = "github:nix-systems/default-linux";
hyprutils = {
url = "github:hyprwm/hyprutils";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
}; };
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
systems, systems,
}: let ...
} @ inputs: let
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems); eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system: pkgsFor = eachSystem (system:
@ -26,13 +33,16 @@
in { in {
overlays = { overlays = {
default = self.overlays.hyprlang; default = self.overlays.hyprlang;
hyprlang = final: prev: { hyprlang = lib.composeManyExtensions [
inputs.hyprutils.overlays.default
(final: prev: {
hyprlang = final.callPackage ./nix/default.nix { hyprlang = final.callPackage ./nix/default.nix {
stdenv = final.gcc13Stdenv; stdenv = final.gcc13Stdenv;
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
}; };
hyprlang-with-tests = final.hyprlang.override {doCheck = true;}; hyprlang-with-tests = final.hyprlang.override {doCheck = true;};
}; })
];
}; };
packages = eachSystem (system: { packages = eachSystem (system: {

View file

@ -2,6 +2,8 @@
lib, lib,
stdenv, stdenv,
cmake, cmake,
hyprutils,
pkg-config,
version ? "git", version ? "git",
doCheck ? false, doCheck ? false,
}: }:
@ -10,7 +12,12 @@ stdenv.mkDerivation {
inherit version doCheck; inherit version doCheck;
src = ../.; src = ../.;
nativeBuildInputs = [cmake]; nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [hyprutils];
outputs = ["out" "dev"]; outputs = ["out" "dev"];