-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapps.nix
More file actions
28 lines (28 loc) · 798 Bytes
/
Copy pathapps.nix
File metadata and controls
28 lines (28 loc) · 798 Bytes
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
# Apps will create runnable binaries via nix run .#<app-name> targeted to the right specific system
# They are used to target the correct scripts in the bin folder
{
nixpkgs,
self,
}:
let
mkApp = scriptName: system: {
type = "app";
program = "${
(nixpkgs.legacyPackages.${system}.writeScriptBin scriptName ''
#!/usr/bin/env bash
PATH=${nixpkgs.legacyPackages.${system}.git}/bin:$PATH
echo "Running ${scriptName} for ${system}"
exec ${self}/bin/${system}/${scriptName}
'')
}/bin/${scriptName}";
};
mkApps = system: {
"build" = mkApp "build" system;
"switch" = mkApp "switch" system;
"rollback" = mkApp "rollback" system;
};
in
{
"aarch64-darwin" = mkApps "aarch64-darwin";
"x86_64-linux" = mkApps "x86_64-linux";
}