diff --git a/flake.nix b/flake.nix index 56ed915..e48fd0d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,12 +2,12 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; - outputs = { self, nixpkgs, ... }: { - packages.x86_64-linux = let - pkgs = import nixpkgs { - system = "x86_64-linux"; - }; - in { + outputs = { self, nixpkgs, ... }: let + forAllSystems = f: (nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: let + pkgs = import nixpkgs { inherit system; }; + in f { inherit pkgs system; } )); + in { + packages = forAllSystems ({ pkgs, system, ... }: { nixos-exporter = pkgs.rustPlatform.buildRustPackage rec { pname = "nixos-exporter"; version = "0.6.0"; @@ -25,20 +25,20 @@ cargoLock.lockFile = ./Cargo.lock; }; - default = self.packages.x86_64-linux.nixos-exporter; - }; + default = self.packages."${system}".nixos-exporter; + }); - apps.x86_64-linux = { + apps = forAllSystems ({ pkgs, system, ... }: { nixos-exporter = { type = "app"; - program = self.packages.x86_64-linux.nixos-exporter + "/bin/nixos-exporter"; + program = self.packages."${system}".nixos-exporter + "/bin/nixos-exporter"; }; nixos-validator = { type = "app"; - program = self.packages.x86_64-linux.nixos-exporter + "/bin/nixos-validator"; + program = self.packages."${system}".nixos-exporter + "/bin/nixos-validator"; }; - default = self.apps.x86_64-linux.nixos-exporter; - }; + default = self.apps."${system}".nixos-exporter; + }); nixosModules = { @@ -166,7 +166,8 @@ }; hydraJobs = { - packages.x86_64-linux.nixos-exporter = self.packages.x86_64-linux.nixos-exporter; + inherit (self) + packages; }; }; }