-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathflake.nix
More file actions
125 lines (112 loc) · 2.93 KB
/
flake.nix
File metadata and controls
125 lines (112 loc) · 2.93 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{
description = "Vish is a graphical editor for creating and managing Bash scripts using a node-based interface";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, ... } @ inputs:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
forAllSystems = (systems: perSystemFlake:
builtins.foldl' (acc: system:
let
inputs' = {
pkgs = nixpkgs.legacyPackages.${system};
};
systemWrapper = (attr: set: { ${system} = set; });
in
acc // (builtins.mapAttrs systemWrapper (perSystemFlake inputs'))
) {} systems
);
vish = (
{
makeWrapper,
stdenv,
lib,
meson,
ninja,
python3,
qt6,
}:
let
python = python3.withPackages (python-pkgs: (with python-pkgs; [
pyside6
shiboken6
]));
inherit (qt6)
qtbase
wrapQtAppsHook
;
in
stdenv.mkDerivation {
pname = "vish";
version = lib.fileContents ./VERSION;
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.gitTracked ./.;
};
buildInputs = [
makeWrapper
meson
ninja
python
qtbase
];
nativeBuildInputs = [
wrapQtAppsHook
];
postInstall = ''
makeWrapper '${python}/bin/python3' "$out/bin/vish" \
--prefix QT_PLUGIN_PATH : "${qtbase}/${qtbase.qtPluginPrefix}" \
--add-flag "$out/share/vish/main.py"
'';
meta = {
description = "Vish is a graphical editor for creating and managing Bash scripts using a node-based interface";
homepage = "https://github.com/Lluciocc/Vish";
license = lib.licenses.mit;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
mainProgram = "vish";
platforms = supportedSystems;
};
}
);
in
{
overlays.default = final: prev: {
vish = self.packages.${prev.stdenv.hostPlatform.system}.vish;
};
} //
forAllSystems supportedSystems (
{ pkgs, ... }:
let
package = pkgs.callPackage vish {};
app = {
type = "app";
program = "${package}/bin/vish";
inherit (package) meta;
};
shell = pkgs.mkShell {
buildInputs = with pkgs; [
python3Packages.virtualenv
python3Packages.pyside6
python3Packages.shiboken6
qt6.qtbase
];
shellHook = ''
export QT_PLUGIN_PATH="${pkgs.qt6.qtbase}/${pkgs.qt6.qtbase.qtPluginPrefix}":$QT_PLUGIN_PATH
'';
};
in
{
packages.vish = package;
packages.default = package;
apps.vish = app;
apps.default = app;
devShells.default = shell;
}
);
}