funktionierende flake

This commit is contained in:
2026-01-03 16:19:08 +01:00
parent 23ba1f6f66
commit 7673bb28fd
2 changed files with 61 additions and 91 deletions
+55 -51
View File
@@ -1,63 +1,67 @@
{
description = "Navidrome Client Dev Environment";
description = "navidrome_client";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
initClangScript = pkgs.writeShellScriptBin "init-clang" ''
if [ -f .clang-format ]; then
echo "Fehler: .clang-format existiert bereits."
else
${pkgs.clang-tools}/bin/clang-format -style=Google -dump-config > .clang-format
echo "Erfolg: .clang-format (Google Style) wurde erstellt"
fi
'';
in
{
devShells.default = pkgs.mkShell {
name = "Qt-Navidrome-Dev";
qtStyle = "Breeze";
in
{
packages.${system}.default = pkgs.stdenv.mkDerivation {
pname = "navidrome-client";
version = "0.1";
src = self;
buildInputs = with pkgs; [
qtcreator
cmake
ninja
gdb
pkg-config
nativeBuildInputs = with pkgs; [
cmake
qt6.wrapQtAppsHook
];
clang-tools
initClangScript
buildInputs =
(with pkgs.qt6; [
qtbase
qtdeclarative
qtwayland
qtmultimedia
])
++ pkgs.lib.optionals (qtStyle == "Breeze") (with pkgs.kdePackages; [
kirigami
qqc2-breeze-style
]);
qt6.qtbase
qt6.qtdeclarative
qt6.qtmultimedia
qt6.qtsvg
];
preFixup = ''
qtWrapperArgs+=(--set QT_QUICK_CONTROLS_STYLE ${qtStyle})
'';
};
shellHook = ''
export name="Qt-Navidrome-Dev"
apps.${system}.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/appnavidrome_client";
};
export CC=gcc
export CXX=g++
alias ide='qtcreator . &'
echo "Qt Creator: $(qtcreator -version 2>&1 | head -n 1 | cut -d ' ' -f 1-4)"
echo "CMake: $(cmake --version | head -n 1)"
echo "GDB: $(gdb --version | head -n 1)"
echo "Compiler: $(c++ --version | head -n 1)"
echo ""
echo "'ide' um Qt Creator zu öffnen!"
echo ""
'';
};
}
);
devShells.${system}.default = pkgs.mkShell {
packages =
(with pkgs; [
cmake
gdb
qtcreator
])
++ (with pkgs.qt6; [
qtbase
qtdeclarative
qtwayland
qtmultimedia
])
++ pkgs.lib.optionals (qtStyle == "Breeze") (with pkgs.kdePackages; [
kirigami
qqc2-breeze-style
]);
};
};
}