-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
88 lines (79 loc) · 2.22 KB
/
flake.nix
File metadata and controls
88 lines (79 loc) · 2.22 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
astal = {
url = "github:aylur/astal";
inputs.nixpkgs.follows = "nixpkgs";
};
ags = {
url = "github:aylur/ags";
inputs.nixpkgs.follows = "nixpkgs";
inputs.astal.follows = "astal";
};
marble = {
url = "git+ssh://git@github.com/marble-shell/kit";
inputs.nixpkgs.follows = "nixpkgs";
inputs.astal.follows = "astal";
};
sshKey = {
url = "git+ssh://git@github.com/aylur/vault?dir=ssh/id_rsa";
flake = false;
};
};
outputs = inputs @ {
self,
nixpkgs,
...
}: let
forAllSystems = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"];
in {
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.stdenv.mkDerivation rec {
pname = "marble";
name = "marble";
src = ./.;
pnpmDeps = pkgs.pnpm.fetchDeps {
inherit pname src;
fetcherVersion = 2;
hash = "sha256-IACKjB8RkZMBhJDeZoYIdduVF/F9zhVdSFWli6naR1U=";
sshKey = inputs.sshKey;
prePnpmInstall = ''
export PATH="$PATH:${pkgs.git}/bin":${pkgs.openssh}/bin
eval "$(ssh-agent -s)"
ssh-add $sshKey
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
'';
};
nativeBuildInputs = [
pkgs.wrapGAppsHook4
pkgs.gobject-introspection
pkgs.pnpm.configHook
inputs.marble.packages.${system}.marbleSetupHook
inputs.ags.packages.${system}.default
];
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share
cp -r data/* $out/share
ags bundle app.ts $out/bin/marble -d "import.meta.PKG_DATADIR='$out/share'"
'';
};
});
devShells = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
buildInputs = [
pkgs.pnpm
(inputs.ags.packages.${system}.default.override {
extraPackages = [
inputs.marble.packages.${system}.marbleSetupHook
];
})
];
};
});
};
}