-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
135 lines (121 loc) · 3.8 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
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
126
127
128
129
130
131
132
133
134
135
{
description = "Next generation mobile/desktop shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
systems.url = "github:nix-systems/default-linux";
flake-utils.url = "github:numtide/flake-utils";
nixos-apple-silicon = {
url = "github:tpwrules/nixos-apple-silicon/release-2024-12-25";
inputs.nixpkgs.follows = "nixpkgs";
};
shoyu = {
url = "github:MidstallSoftware/shoyu";
inputs = {
nixpkgs.follows = "nixpkgs";
systems.follows = "systems";
flake-utils.follows = "flake-utils";
nixos-apple-silicon.follows = "nixos-apple-silicon";
};
};
};
outputs =
{
self,
nixpkgs,
systems,
flake-utils,
nixos-apple-silicon,
shoyu,
...
}:
let
inherit (nixpkgs) lib;
in
flake-utils.lib.eachSystem (import systems) (
system:
let
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [
(
pkgs: prev: with pkgs; {
pkgsAsahi = (
if stdenv.hostPlatform.isAarch64 then
pkgs.appendOverlays [
nixos-apple-silicon.overlays.default
(pkgsAsahi: prev: {
mesa = pkgsAsahi.mesa-asahi-edge.overrideAttrs (
f: p: {
meta.platforms = prev.mesa.meta.platforms;
}
);
})
]
else
null
);
genesis-shell = pkgs.flutter327.buildFlutterApplication {
pname = "genesis-shell";
version = "${shortVersion}+git-${shortRev}";
src = lib.cleanSource self;
flutterBuildFlags = [
"--dart-define=COMMIT_HASH=${shortRev}"
];
buildInputs = with pkgs; [
pkgs.shoyu
];
pubspecLock = lib.importJSON ./pubspec.lock.json;
gitHashes = {
expidus = "sha256-EaOzIJvuZ5Bs75zslMCTb9ChkOX7lNUEUvsbDItyqG0=";
miso = "sha256-EznEUokD0nSON/4XRHe/HT+ybPAdNtoUwXCPEla6i1Y=";
};
meta = {
description = "Next generation mobile/desktop shell.";
homepage = "https://expidusos.com";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ RossComputerGuy ];
platforms = [
"x86_64-linux"
"aarch64-linux"
];
};
};
}
)
shoyu.overlays.default
];
deps = builtins.fromJSON (lib.readFile ./deps.json);
shortRev = self.shortRev or (lib.substring 7 7 lib.fakeHash);
shortRevCodes = lib.map lib.strings.charToInt (lib.stringToCharacters shortRev);
buildCode = lib.foldr (a: b: "${toString a}${toString b}") "" shortRevCodes;
shortVersion = "1.0.0";
version = "${shortVersion}+${buildCode}";
mkDevShell =
pkgs:
pkgs.mkShell {
packages = with pkgs; [
flutter327
pkg-config
gtk3
yq
pkgs.shoyu
];
};
in
{
packages =
{
default = pkgs.genesis-shell;
}
// lib.optionalAttrs (pkgs.pkgsAsahi != null) {
asahi = pkgs.pkgsAsahi.genesis-shell;
};
devShells =
{
default = mkDevShell pkgs;
}
// lib.optionalAttrs (pkgs.pkgsAsahi != null) {
asahi = mkDevShell pkgs.pkgsAsahi;
};
legacyPackages = pkgs;
}
);
}