-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
34 lines (31 loc) · 1.12 KB
/
flake.nix
File metadata and controls
34 lines (31 loc) · 1.12 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
{
# flake.nix and default.nix thanks to: https://n8henrie.com/2023/09/crosscompile-rust-for-x86-linux-from-m1-mac-with-nix/
# TODO: dynamically build for host system and cross compile if required. https://nix.dev/tutorials/cross-compilation.html
description = "Manage subs for your sports game";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, rust-overlay, }:
let
system = "aarch64-linux";
overlays = [ (import rust-overlay) ];
makePkgs = targetSystem:
import nixpkgs {
inherit overlays system;
crossSystem = {
config = targetSystem;
rustc.config = targetSystem;
isStatic = true;
};
};
in {
packages.${system} = {
default = self.outputs.packages.${system}.subbers-x86_64-linux;
subbers-aarch64-linux =
(makePkgs "aarch64-unknown-linux-musl").callPackage ./default.nix { };
subbers-x86_64-linux =
(makePkgs "x86_64-unknown-linux-musl").callPackage ./default.nix { };
};
};
}