From 4253231a9349a54ec9899e82a784e2aa30571085 Mon Sep 17 00:00:00 2001 From: VictorGamerLOL Date: Thu, 2 May 2024 19:09:20 +0100 Subject: [PATCH] reworked flake to allow for more platforms It should work on aarch64 now. However I do not own such machine so it is untested. --- flake.lock | 18 +++++++++++++++++- flake.nix | 25 ++++++++++++++++++------- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 1cb431a..9d36d26 100644 --- a/flake.lock +++ b/flake.lock @@ -18,7 +18,23 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index b9f5864..d0ecfb2 100644 --- a/flake.nix +++ b/flake.nix @@ -3,21 +3,32 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + # todo: get a mac + # todo: wait for suyu to get good on MacOS + systems.url = "github:nix-systems/default-linux"; }; - outputs = { self, nixpkgs }: { - packages.x86_64-linux = + outputs = { self, nixpkgs, systems, ... }: + let + eachSystem = nixpkgs.lib.genAttrs (import systems); + in + { + packages = eachSystem (system: let pkgs = import nixpkgs { - system = "x86_64-linux"; - config = {allowUnfree = true;}; + system = "${system}"; + config = {allowUnfree = true;}; # cuda }; - suyu-deps = pkgs.kdePackages // {inherit (self.packages.x86_64-linux) nx_tzdb compat-list;}; + + # Qt6 packages have been moved to kdePackages so we grab them all here so they are not + # confused with their Qt5 counterparts + suyu-deps = pkgs.kdePackages // {inherit (self.packages.${system}) nx_tzdb compat-list;}; in { - default = self.packages.x86_64-linux.suyu; + default = self.packages.${system}.suyu; nx_tzdb = pkgs.callPackage ./suyu/nx_tzdb.nix {}; compat-list = pkgs.callPackage ./suyu/compat-list.nix {}; suyu = pkgs.callPackage ./suyu/suyu.nix suyu-deps; - }; + } + ); }; }