-
-
Notifications
You must be signed in to change notification settings - Fork 492
Expand file tree
/
Copy pathflake.nix
More file actions
100 lines (90 loc) · 2.96 KB
/
flake.nix
File metadata and controls
100 lines (90 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
description = "QOwnNotes dev flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-qt69.url = "github:nixos/nixpkgs/6f095be4bda67105d2428224f4fb4899234ce683";
nixpkgs-qt5153.url = "github:nixos/nixpkgs/72bbea9db7d727ed044e60b5f5febc60a3c5c955";
# systems.url = "github:nix-systems/default";
};
outputs =
{
# deadnix: skip
self, # to prevent: error: function 'outputs' called with unexpected argument 'self'
nixpkgs,
nixpkgs-qt69,
nixpkgs-qt5153,
}:
let
# Define supported systems
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
# Helper function to generate attributes for each system
forAllSystems = nixpkgs.lib.genAttrs systems;
# Helper to get package sets for a given system
pkgsFor = system: nixpkgs.legacyPackages.${system};
pkgsQt69For = system: nixpkgs-qt69.legacyPackages.${system};
pkgsQt5153For = system: nixpkgs-qt5153.legacyPackages.${system};
in
{
packages = forAllSystems (
system:
let
pkgs = pkgsFor system;
pkgs-qt69 = pkgsQt69For system;
pkgs-qt5153 = pkgsQt5153For system;
in
{
qownnotes-qt6 = pkgs.callPackage (import ./default.nix) { };
qownnotes-qt6-qlitehtml = pkgs.callPackage (import ./default.nix) { useQlitehtml = true; };
qownnotes-qt69 = pkgs-qt69.callPackage (import ./default.nix) { };
qownnotes-qt5 = pkgs.libsForQt5.callPackage (import ./build-systems/nix/default-qt5.nix) { };
qownnotes-qt5153 =
pkgs-qt5153.libsForQt5.callPackage (import ./build-systems/nix/default-qt5.nix)
{ };
default = pkgs.qt6Packages.callPackage (import ./default.nix) { };
}
);
devShells = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
nativeBuildInputs = with pkgs.qt6; [
pkgs.gnumake
pkgs.crowdin-cli
pkgs.cmakeWithGui
qmake
qttools
wrapQtAppsHook
pkgs.pkg-config
# for ./build-systems/github/build-github-src.sh
pkgs.coreutils
pkgs.gh
];
buildInputs = with pkgs.qt6; [
qtbase
qtwebsockets
qtdeclarative
qtsvg
pkgs.botan3
pkgs.libgit2
];
shellHook = ''
echo "qmake: $(qmake --version)"
'';
};
}
);
# Legacy devShell attribute for backwards compatibility
devShell = forAllSystems (system: self.devShells.${system}.default);
checks.x86_64-linux = {
qownnotes = (pkgsFor "x86_64-linux").testers.runNixOSTest ./tests/vm/qownnotes.nix;
};
};
}