From ce7338040eed6d6e3595a652c219d7889c893bdd Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 19 Jun 2024 00:59:29 +0200 Subject: [PATCH] feat: add multiarch devshell --- flake.nix | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index aa260a3..1b671c0 100644 --- a/flake.nix +++ b/flake.nix @@ -11,12 +11,18 @@ outputs = { self, nixpkgs, home-manager, nur, ... }@inputs: let stateVersion = "23.11"; + + allSystems = [ + "x86_64-linux" # 64bit AMD/Intel x86 + "aarch64-linux" # 64bit ARM macOS + ]; + + forAllSystems = fn: + nixpkgs.lib.genAttrs allSystems + (system: fn { pkgs = import nixpkgs { inherit system; }; }); in { - # TODO: make a multiarch flake - devShells.x86_64-linux.default = - let - pkgs = nixpkgs.legacyPackages."x86_64-linux"; - in pkgs.mkShell { + devShells = forAllSystems ({ pkgs }: { + default = pkgs.mkShell { name = "nixfiles"; buildInputs = [ pkgs.shellcheck @@ -25,8 +31,8 @@ in { pkgs.convco pkgs.typos ]; - }; - + }; + }); nixosConfigurations = { morty = nixpkgs.lib.nixosSystem { system = "x86_64-linux";