-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
98 lines (86 loc) · 2.38 KB
/
Copy pathflake.nix
File metadata and controls
98 lines (86 loc) · 2.38 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
{
description = "Desktop widgets built with Astal and Gnim";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
ags = {
url = "github:aylur/ags";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
ags,
}:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pname = "widgets";
entry = "src/app.tsx";
version = self.shortRev or self.dirtyShortRev or "dev";
astalPackages = with ags.packages.${system}; [
io
astal4
apps
cava
mpris
notifd
tray
wireplumber
];
extraPackages = astalPackages ++ [
pkgs.libadwaita
pkgs.libsoup_3
pkgs.gtk4-layer-shell
];
in
{
packages.${system}.default = pkgs.stdenv.mkDerivation (finalAttrs: {
inherit pname version;
src = ./.;
pnpmDeps = pkgs.fetchPnpmDeps {
inherit (finalAttrs) pname version src;
fetcherVersion = 4;
hash = "sha256-iINiPDy/Tuut8PF2aLGb2WwE/QxERPgImwC8ueuHWDg=";
};
nativeBuildInputs = with pkgs; [
nodejs
pnpm
pnpmConfigHook
wrapGAppsHook3
gobject-introspection
ags.packages.${system}.default
];
buildInputs = extraPackages ++ [ pkgs.gjs ];
buildPhase = ''
runHook preBuild
pnpm run gen:css
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
ags bundle ${entry} $out/bin/${pname}
runHook postInstall
'';
preFixup = ''
gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${pkgs.lucide}/share")
gappsWrapperArgs+=(--prefix GIO_EXTRA_MODULES : "${pkgs.glib-networking}/lib/gio/modules")
'';
});
devShells.${system}.default = pkgs.mkShell {
buildInputs = [
(ags.packages.${system}.default.override { inherit extraPackages; })
pkgs.nodejs
pkgs.pnpm
pkgs.watchexec
pkgs.lucide
];
shellHook = ''
export XDG_DATA_DIRS="${pkgs.lucide}/share''${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
export GIO_EXTRA_MODULES="${pkgs.glib-networking}/lib/gio/modules''${GIO_EXTRA_MODULES:+:$GIO_EXTRA_MODULES}"
'';
};
};
}