From 76c206ed91a88a47462f3ebf7425feab8bd4a70f Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Fri, 6 Feb 2026 17:17:38 +0100 Subject: [PATCH 1/5] nix --- flake.lock | 48 +++++++++++++++++ flake.nix | 47 +++++++++++++++++ nix/app2unit.nix | 16 ++++++ nix/default.nix | 132 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 243 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 nix/app2unit.nix create mode 100644 nix/default.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f79ec88 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769593411, + "narHash": "sha256-WW00FaBiUmQyxvSbefvgxIjwf/WmRrEGBbwMHvW/7uQ=", + "ref": "refs/heads/master", + "rev": "1e4d804e7f3fa7465811030e8da2bf10d544426a", + "revCount": 732, + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "quickshell": "quickshell" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..546027a --- /dev/null +++ b/flake.nix @@ -0,0 +1,47 @@ +{ + description = "Flake for zshell"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + quickshell = { + url = "git+https://git.outfoxxed.me/outfoxxed/quickshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { + self, + nixpkgs, + ... + }@inputs: + let + forAllSystems = + fn: nixpkgs.lib.genAttrs nixpkgs.lib.platforms.linux (system: fn nixpkgs.legacyPackages.${system}); + in + { + formatter = forAllSystems (pkgs: pkgs.nixfmt); + + packages = forAllSystems (pkgs: rec { + app2unit = pkgs.callPackage ./nix/app2unit.nix { inherit pkgs; }; + }); + + devShells = forAllSystems (pkgs: { + default = + let + shell = self.packages.${pkgs.stdenv.hostPlatform.system}.zshell; + in + pkgs.mkShell.override { stdenv = shell.stdenv; } { + inputsFrom = [ + shell + shell.Plugins + ]; + packages = with pkgs; [ + material-symbols + rubik + nerd-fonts.caskaydia-cove + ]; + }; + }); + }; +} diff --git a/nix/app2unit.nix b/nix/app2unit.nix new file mode 100644 index 0000000..ce5fee2 --- /dev/null +++ b/nix/app2unit.nix @@ -0,0 +1,16 @@ +{ + pkgs, # To ensure the nixpkgs version of app2unit + fetchFromGitHub, + ... +}: +pkgs.app2unit.overrideAttrs ( + final: prev: rec { + version = "1.0.3"; # Fix old issue related to missing env var + src = fetchFromGitHub { + owner = "Vladimir-csp"; + repo = "app2unit"; + tag = "v${version}"; + hash = "sha256-7eEVjgs+8k+/NLteSBKgn4gPaPLHC+3Uzlmz6XB0930="; + }; + } +) diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000..9c3c27b --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,132 @@ +{ + rev, + lib, + stdenv, + makeWrapper, + makeFontsConf, + app2unit, + networkmanager, + swappy, + wl-clipboard, + libqalculate, + bash, + hyprland, + material-symbols, + rubik, + nerd-fonts, + qt6, + quickshell, + aubio, + pipewire, + cmake, + ninja, + pkg-config, +}: +let + version = "1.0.0"; + + runtimeDeps = [ + app2unit + networkmanager + swappy + wl-clipboard + libqalculate + bash + hyprland + ]; + + fontconfig = makeFontsConf { + fontDirectories = [ + material-symbols + rubik + nerd-fonts.caskaydia-cove + ]; + }; + + cmakeBuildType = "RelWithDebInfo"; + + cmakeVersionFlags = [ + (lib.cmakeFeature "VERSION" version) + (lib.cmakeFeature "GIT_REVISION" rev) + (lib.cmakeFeature "DISTRIBUTOR" "nix-flake") + ]; + + plugin = stdenv.mkDerivation { + inherit cmakeBuildType; + name = "zshell-qml-plugin"; + src = lib.fileset.toSource { + root = ./..; + fileset = lib.fileset.union ./../CMakeLists.txt ./../Plugins; + }; + + nativeBuildInputs = [ + cmake + ninja + pkg-config + ]; + buildInputs = [ + qt6.qtbase + qt6.qtdeclarative + libqalculate + pipewire + aubio + ]; + + dontWrapQtApps = true; + cmakeFlags = [ + (lib.cmakeFeature "ENABLE_MODULES" "plugin") + (lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix) + ] + ++ cmakeVersionFlags; + }; +in +stdenv.mkDerivation { + inherit version cmakeBuildType; + pname = "zshell"; + src = ./..; + + nativeBuildInputs = [ + cmake + ninja + makeWrapper + qt6.wrapQtAppsHook + ]; + buildInputs = [ + quickshell + plugin + qt6.qtbase + ]; + propagatedBuildInputs = runtimeDeps; + + cmakeFlags = [ + (lib.cmakeFeature "ENABLE_MODULES" "shell") + ] + ++ cmakeVersionFlags; + + prePatch = '' + substituteInPlace assets/pam.d/fprint \ + --replace-fail pam_fprintd.so /run/current-system/sw/lib/security/pam_fprintd.so + substituteInPlace shell.qml \ + --replace-fail 'ShellRoot {' 'ShellRoot { settings.watchFiles: false' + ''; + + postInstall = '' + makeWrapper ${quickshell}/bin/qs $out/bin/zshell \ + --prefix PATH : "${lib.makeBinPath runtimeDeps}" \ + --set FONTCONFIG_FILE "${fontconfig}" \ + --add-flags "-p $out/share/ZShell" + + mkdir -p $out/lib + ''; + + passthru = { + inherit plugin; + }; + + meta = { + description = "A very segsy desktop shell"; + homepage = "https://github.com/Zacharias-Brohn/z-bar-qt"; + license = lib.licenses.gpl3Only; + mainProgram = "zshell"; + }; +} From e5718b58ab767eb5d22a0663966ee7f7bf0a946e Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Fri, 6 Feb 2026 17:44:02 +0100 Subject: [PATCH 2/5] nix --- CMakeLists.txt | 5 +++-- flake.nix | 12 +++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea51dd6..5aa944b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.19) +include(GNUInstallDirs) project(ZShell) @@ -8,8 +9,8 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(INSTALL_LIBDIR "usr/lib/ZShell" CACHE STRING "Library install dir") -set(INSTALL_QMLDIR "usr/lib/qt6/qml" CACHE STRING "QML install dir") +set(INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/ZShell" CACHE STRING "Library install dir") +set(INSTALL_QMLDIR "${CMAKE_INSTALL_LIBDIR}/qt6/qml" CACHE STRING "QML install dir") add_compile_options( -Wall -Wextra -Wpedantic -Wshadow -Wconversion diff --git a/flake.nix b/flake.nix index 546027a..19aef0a 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,17 @@ formatter = forAllSystems (pkgs: pkgs.nixfmt); packages = forAllSystems (pkgs: rec { - app2unit = pkgs.callPackage ./nix/app2unit.nix { inherit pkgs; }; + zshell = pkgs.callPackage ./nix { + rev = self.rev or self.dirtyRev; + stdenv = pkgs.clangStdenv; + quickshell = inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default.override { + withX11 = false; + withI3 = false; + }; + app2unit = pkgs.callPackage ./nix/app2unit.nix { inherit pkgs; }; + }; + + default = zshell; }); devShells = forAllSystems (pkgs: { From 609b8457fbfe812034986b234f39475dcafdcec0 Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Sat, 7 Feb 2026 01:13:49 +0100 Subject: [PATCH 3/5] nix fixed?? --- CMakeLists.txt | 18 ++++++++++++++---- Plugins/ZShell/CMakeLists.txt | 2 +- nix/default.nix | 15 ++++++++------- shell.qml | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5aa944b..8a45b3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.19) -include(GNUInstallDirs) project(ZShell) @@ -8,9 +7,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(ENABLE_MODULES "plugin;shell" CACHE STRING "Modules to build/install") -set(INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/ZShell" CACHE STRING "Library install dir") -set(INSTALL_QMLDIR "${CMAKE_INSTALL_LIBDIR}/qt6/qml" CACHE STRING "QML install dir") +set(INSTALL_LIBDIR "usr/lib/ZShell" CACHE STRING "Library install dir") +set(INSTALL_QMLDIR "usr/lib/qt6/qml" CACHE STRING "QML install dir") add_compile_options( -Wall -Wextra -Wpedantic -Wshadow -Wconversion @@ -20,4 +20,14 @@ add_compile_options( -Wunreachable-code ) -add_subdirectory(Plugins) + +if("plugin" IN_LIST ENABLE_MODULES) + add_subdirectory(Plugins) +endif() + +if("shell" IN_LIST ENABLE_MODULES) + foreach(dir assets scripts Components Config Modules Daemons Drawers Effects Helpers Paths) + install(DIRECTORY ${dir} DESTINATION "${INSTALL_QSCONFDIR}") + endforeach() + install(FILES shell.qml Bar.qml Wallpaper.qml DESTINATION "${INSTALL_QSCONFDIR}") +endif() diff --git a/Plugins/ZShell/CMakeLists.txt b/Plugins/ZShell/CMakeLists.txt index f76f23b..1c4bf42 100644 --- a/Plugins/ZShell/CMakeLists.txt +++ b/Plugins/ZShell/CMakeLists.txt @@ -20,7 +20,7 @@ function(qml_module arg_TARGET) QMLDIR module_qmldir TYPEINFO module_typeinfo ) - set(module_dir "/usr/lib/qt6/qml/${module_target_path}") + set(module_dir "${INSTALL_QMLDIR}/${module_target_path}") install(TARGETS ${arg_TARGET} LIBRARY DESTINATION "${module_dir}" RUNTIME DESTINATION "${module_dir}") install(TARGETS "${module_plugin_target}" LIBRARY DESTINATION "${module_dir}" RUNTIME DESTINATION "${module_dir}") install(FILES "${module_qmldir}" DESTINATION "${module_dir}") diff --git a/nix/default.nix b/nix/default.nix index 9c3c27b..b876da7 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -95,28 +95,29 @@ stdenv.mkDerivation { quickshell plugin qt6.qtbase + qt6.qtwayland ]; propagatedBuildInputs = runtimeDeps; cmakeFlags = [ (lib.cmakeFeature "ENABLE_MODULES" "shell") + (lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/ZShell") ] ++ cmakeVersionFlags; prePatch = '' - substituteInPlace assets/pam.d/fprint \ - --replace-fail pam_fprintd.so /run/current-system/sw/lib/security/pam_fprintd.so substituteInPlace shell.qml \ --replace-fail 'ShellRoot {' 'ShellRoot { settings.watchFiles: false' ''; postInstall = '' - makeWrapper ${quickshell}/bin/qs $out/bin/zshell \ - --prefix PATH : "${lib.makeBinPath runtimeDeps}" \ - --set FONTCONFIG_FILE "${fontconfig}" \ - --add-flags "-p $out/share/ZShell" + makeWrapper ${quickshell}/bin/qs $out/bin/zshell \ + --prefix PATH : "${lib.makeBinPath runtimeDeps}" \ + --set FONTCONFIG_FILE "${fontconfig}" \ + --add-flags "-p $out/share/ZShell" - mkdir -p $out/lib + echo "$out" + mkdir -p $out/lib ''; passthru = { diff --git a/shell.qml b/shell.qml index 691af97..c6d35b7 100644 --- a/shell.qml +++ b/shell.qml @@ -7,7 +7,7 @@ import qs.Modules.Lock as Lock import qs.Helpers import qs.Modules.Polkit -Scope { +ShellRoot { Bar {} Wallpaper {} Launcher {} From b05370e2c62a9b77d46dc12aacba3de2240fa12a Mon Sep 17 00:00:00 2001 From: Aram Markarov Date: Sat, 7 Feb 2026 12:48:29 +0100 Subject: [PATCH 4/5] updated Readme to include installation instructions for NixOS --- README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/README.md b/README.md index b1791fe..19d3be1 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,70 @@ sudo ninja -C build install This installs the QML plugin to `/usr/lib/qt6/qml`. +### NixOS + +In your flake.nix file, add the following in your inputs. + +```nix +inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + z-bar-qt = { + url = "github:Zacharias-Brohn/z-bar-qt/nix_packaging"; + inputs.nixpkgs.follows = "nixpkgs"; + }; +}; +``` + +Below a full example of what it could look like. + +```nix +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + z-bar-qt = { + url = "github:Zacharias-Brohn/z-bar-qt/nix_packaging"; + inputs.nixpkgs.follows = "nixpgks"; + }; + }; + + outputs = + inputs@{ + nixpkgs, + self, + ... + }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in + { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + inherit system; + }; + modules = [ + ./configuration.nix + ]; + }; + }; +} +``` + +Now you can add z-bar-qt as a nixpkgs in environment.systemPackages (or optionally in your homePackages). + +```nix +{ pkgs, inputs, ... }: + +{ + environment.systemPackages = with pkgs; [ + inputs.z-bar-qt.packages.${system}.zshell + ]; +} +``` + +You can now run ```zshell``` to run the bar. + ## Configuration Configuration is stored in `~/.config/z-bar/config.json`. Options include: From 59369f2adab929d645d411dae6911a3749a9bc57 Mon Sep 17 00:00:00 2001 From: Aram Markarov Date: Sat, 7 Feb 2026 13:28:27 +0100 Subject: [PATCH 5/5] minor adjustment to the md file; inputs link pointing to main now --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19d3be1..0825cfe 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ In your flake.nix file, add the following in your inputs. inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; z-bar-qt = { - url = "github:Zacharias-Brohn/z-bar-qt/nix_packaging"; + url = "github:Zacharias-Brohn/z-bar-qt/"; inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -54,7 +54,7 @@ Below a full example of what it could look like. inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; z-bar-qt = { - url = "github:Zacharias-Brohn/z-bar-qt/nix_packaging"; + url = "github:Zacharias-Brohn/z-bar-qt/"; inputs.nixpkgs.follows = "nixpgks"; }; };