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
Generated
+6 -40
View File
@@ -1,59 +1,25 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1767325753,
"narHash": "sha256-yA/CuWyqm+AQo2ivGy6PlYrjZBQm7jfbe461+4HF2fo=",
"owner": "nixos",
"lastModified": 1767116409,
"narHash": "sha256-5vKw92l1GyTnjoLzEagJy5V5mDFck72LiQWZSOnSicw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "64049ca74d63e971b627b5f3178d95642e61cedd",
"rev": "cad22e7d996aea55ecab064e84834289143e44a0",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.11",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
+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
]);
};
};
}