add nix tooling

This commit is contained in:
LordGrimmauld 2024-04-09 14:05:59 +02:00
parent d7012df2ce
commit 678456bacc
4 changed files with 93 additions and 5 deletions

6
.gitignore vendored
View file

@ -1,5 +1 @@
# User
*.user
# Build directory
build/
result

26
flake.lock Normal file
View file

@ -0,0 +1,26 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1712604496,
"narHash": "sha256-Ye1R+k60uo0B3mn5xwsgb0PzceSg9y0E2OMYQnizLD0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ed6db4c403cc2fc4924d24e1a2a2f148c6152620",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixpkgs-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View file

@ -0,0 +1,27 @@
{
description = "Gio wrapper for Qt6 applications";
inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable";
outputs = {
nixpkgs,
self,
...
}: let
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in {
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
gio-qt6-pkg = (pkgs.qt6Packages.callPackage ./nix/package.nix {});
in {
gio-qt6 = gio-qt6-pkg;
default = gio-qt6-pkg;
});
};
}

39
nix/package.nix Normal file
View file

@ -0,0 +1,39 @@
{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, glibmm
, doxygen
, qt6
, buildDocs ? true
}:
stdenv.mkDerivation rec {
pname = "gio-qt6";
version = "0.1.0";
src = lib.cleanSource ../.;
nativeBuildInputs = [
cmake
pkg-config
qt6.wrapQtAppsHook
] ++ lib.optionals buildDocs [ doxygen qt6.qttools.dev ];
cmakeFlags = [
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DPROJECT_VERSION=${version}"
"-DBUILD_DOCS=OFF"
] ++ lib.optionals (!buildDocs) [ "-DBUILD_DOCS=OFF" ];
propagatedBuildInputs = [ glibmm ];
meta = with lib; {
description = "Gio wrapper for Qt6 applications";
homepage = "https://git.grimmauld.de/Grimmauld/gio-qt";
license = licenses.lgpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [grimmauld];
};
}