Skip to content

Commit 9c2833f

Browse files
committed
refactor: move architectures to other file
1 parent 0100b13 commit 9c2833f

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

architectures.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[
2+
# Linux
3+
{ arch = "x86_64"; os = "linux"; target = "x86_64-unknown-linux-gnu"; formats = ["deb" "rpm" "tar.xz"]; }
4+
{ arch = "aarch64"; os = "linux"; target = "aarch64-unknown-linux-gnu"; formats = ["deb" "rpm" "tar.xz"]; }
5+
{ arch = "armv7l"; os = "linux"; target = "armv7-unknown-linux-gnueabihf"; formats = ["tar.xz"]; }
6+
{ arch = "armv6l"; os = "linux"; target = "arm-unknown-linux-gnueabihf"; formats = ["tar.xz"]; }
7+
# { arch = "riscv32"; os = "linux"; target = "riscv32gc-unknown-linux-gnu"; formats = ["tar.xz"]; }
8+
# { arch = "riscv64"; os = "linux"; target = "riscv64gc-unknown-linux-gnu"; formats = ["tar.xz"]; }
9+
# MacOS
10+
{ arch = "x86_64"; os = "macos"; target = "x86_64-apple-darwin"; formats = ["tar.xz"]; }
11+
{ arch = "aarch64"; os = "macos"; target = "aarch64-apple-darwin"; formats = ["tar.xz"]; }
12+
# Windows
13+
{ arch = "x86_64"; os = "windows"; target = "x86_64-pc-windows-msvc"; formats = ["zip"]; }
14+
# { arch = "i686"; os = "windows"; target = "i686-pc-windows-msvc"; formats = ["zip"]; }
15+
]

flake.nix

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
flake-utils.lib.eachDefaultSystem (baseSystem:
1313
let
1414
cargoManifest = builtins.fromTOML (builtins.readFile ./Cargo.toml);
15+
architectures = import ./architectures.nix;
16+
1517
overlays = [ (import rust-overlay) ];
1618
pkgs = import nixpkgs {
1719
system = baseSystem;
@@ -43,21 +45,6 @@
4345
localSystem = baseSystem;
4446
};
4547

46-
architectures = [
47-
# Linux
48-
{ arch = "x86_64"; os = "linux"; target = "x86_64-unknown-linux-gnu"; formats = ["deb" "rpm" "tar.xz"]; }
49-
{ arch = "aarch64"; os = "linux"; target = "aarch64-unknown-linux-gnu"; formats = ["deb" "rpm" "tar.xz"]; }
50-
{ arch = "armv7l"; os = "linux"; target = "armv7-unknown-linux-gnueabihf"; formats = ["tar.xz"]; }
51-
{ arch = "armv6l"; os = "linux"; target = "arm-unknown-linux-gnueabihf"; formats = ["tar.xz"]; }
52-
# { arch = "riscv32"; os = "linux"; target = "riscv32gc-unknown-linux-gnu"; formats = ["tar.xz"]; }
53-
# { arch = "riscv64"; os = "linux"; target = "riscv64gc-unknown-linux-gnu"; formats = ["tar.xz"]; }
54-
# MacOS
55-
{ arch = "x86_64"; os = "macos"; target = "x86_64-apple-darwin"; formats = ["tar.xz"]; }
56-
{ arch = "aarch64"; os = "macos"; target = "aarch64-apple-darwin"; formats = ["tar.xz"]; }
57-
# Windows
58-
{ arch = "x86_64"; os = "windows"; target = "x86_64-pc-windows-msvc"; formats = ["zip"]; }
59-
];
60-
6148
mkDevShell = { arch, os, ... }: pkgs.mkShell {
6249
packages = with pkgs; [ rustc cargo ];
6350
shellHook = ''

0 commit comments

Comments
 (0)