-
Notifications
You must be signed in to change notification settings - Fork 47
/
flake.nix
44 lines (36 loc) · 1.27 KB
/
flake.nix
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
{
description = "The SchildiChat Matrix client";
inputs.nixpkgs.url = github:NixOS/nixpkgs;
outputs = { self, nixpkgs }: let
systems = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
overlay = import ./nix/overlay.nix;
# Memoize nixpkgs for different platforms for efficiency.
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ overlay ];
});
in {
inherit overlay;
packages = builtins.mapAttrs (system: pkgs: {
inherit (pkgs)
schildichat-web
schildichat-desktop
schildichat-desktop-wayland
;
}) nixpkgsFor;
defaultPackage = forAllSystems (system: self.packages.${system}.schildichat-desktop);
apps = forAllSystems(system: {
schildichat-desktop = {
type = "app";
program = "${self.packages.${system}.schildichat-desktop}/bin/schildichat-desktop";
};
schildichat-desktop-wayland = {
type = "app";
program = "${self.packages.${system}.schildichat-desktop-wayland}/bin/schildichat-desktop";
};
});
defaultApp = forAllSystems (system: self.apps.${system}.schildichat-desktop);
};
}