Skip to content

Commit b69d866

Browse files
authored
flake enhancement: Merge PR #2 | Rexcrazy804/flake-package
Qs/Flake: addition of a simple flake package that wraps quickshell with the qs config into an executable
2 parents 7ff2c8d + a807017 commit b69d866

File tree

2 files changed

+50
-22
lines changed

2 files changed

+50
-22
lines changed

configs/quickshell/flake.nix

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@
55
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
66
};
77

8-
outputs =
9-
{ self, nixpkgs }:
10-
let
11-
system = "x86_64-linux";
8+
outputs = {
9+
self,
10+
nixpkgs,
11+
}: let
12+
system = "x86_64-linux";
1213

13-
pkgs = import nixpkgs {
14-
inherit system;
15-
config = { };
16-
};
17-
in
18-
{
19-
devShells.${system}.default = pkgs.mkShell {
20-
nativeBuildInputs = with pkgs; [
21-
];
22-
buildInputs = with pkgs; [
23-
kdePackages.qtdeclarative
24-
kdePackages.qt5compat
25-
];
26-
shellHook = ''
27-
export QML_IMPORT_PATH=$PWD/src
28-
'';
29-
};
14+
pkgs = import nixpkgs {
15+
inherit system;
16+
config = {};
3017
};
31-
18+
in {
19+
packages.${system}.default = pkgs.callPackage ./package.nix {};
20+
devShells.${system}.default = pkgs.mkShell {
21+
nativeBuildInputs = with pkgs; [];
22+
buildInputs = with pkgs; [
23+
kdePackages.qtdeclarative
24+
kdePackages.qt5compat
25+
];
26+
shellHook = ''
27+
export QML_IMPORT_PATH=$PWD/src
28+
'';
29+
};
30+
};
3231
}

configs/quickshell/package.nix

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
lib,
3+
symlinkJoin,
4+
makeWrapper,
5+
quickshell,
6+
kdePackages,
7+
configPath ? ./.,
8+
}: let
9+
qmlPath = lib.makeSearchPath "lib/qt-6/qml" [
10+
kdePackages.qtbase
11+
kdePackages.qtdeclarative
12+
kdePackages.qt5compat
13+
];
14+
in
15+
symlinkJoin {
16+
pname = "retroism";
17+
inherit (quickshell) version;
18+
19+
paths = [quickshell];
20+
nativeBuildInputs = [makeWrapper];
21+
22+
postBuild = ''
23+
makeWrapper $out/bin/quickshell $out/bin/retroism \
24+
--set QML2_IMPORT_PATH "${qmlPath}" \
25+
--add-flags '-p ${configPath}'
26+
'';
27+
28+
meta.mainProgram = "retroism";
29+
}

0 commit comments

Comments
 (0)