From 1e613a83ce282fb09084b3df97c0b42a483c2390 Mon Sep 17 00:00:00 2001 From: yemou Date: Sat, 18 May 2024 19:12:25 -0400 Subject: [PATCH] Add support for aarch64-linux to flake.nix Technically, all architectures that support Linux should work, but I don't have all the architectures on hand to actually test that. --- flake.lock | 6 +++--- flake.nix | 41 +++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/flake.lock b/flake.lock index 115cd7d..1877792 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1705316053, - "narHash": "sha256-J2Ey5mPFT8gdfL2XC0JTZvKaBw/b2pnyudEXFvl+dQM=", + "lastModified": 1715961556, + "narHash": "sha256-+NpbZRCRisUHKQJZF3CT+xn14ZZQO+KjxIIanH3Pvn4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370", + "rev": "4a6b83b05df1a8bd7d99095ec4b4d271f2956b64", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 701dc6f..0d5138d 100644 --- a/flake.nix +++ b/flake.nix @@ -3,32 +3,33 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; - outputs = { self, nixpkgs, ... }: { - overlays.default = final: prev: rec { - colorgrab = final.callPackage ./.nix/colorgrab.nix { }; - prefon = final.callPackage ./.nix/prefon.nix { }; - scr = final.callPackage ./.nix/scr.nix { }; - thm = final.callPackage ./.nix/thm.nix { }; - yemou-scripts = final.symlinkJoin { - name = "yemou-scripts"; - paths = [ colorgrab prefon scr thm ]; - }; - }; - - packages."x86_64-linux" = - let - pkgs = import nixpkgs { - system = "x86_64-linux"; + outputs = { self, nixpkgs, ... }: + let + forAllSystems = function: nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] + (system: function (import nixpkgs { + inherit system; overlays = [ self.overlays.default ]; + })); + in + { + overlays.default = final: prev: rec { + colorgrab = final.callPackage ./.nix/colorgrab.nix { }; + prefon = final.callPackage ./.nix/prefon.nix { }; + scr = final.callPackage ./.nix/scr.nix { }; + thm = final.callPackage ./.nix/thm.nix { }; + yemou-scripts = final.symlinkJoin { + name = "yemou-scripts"; + paths = [ colorgrab prefon scr thm ]; }; - in - { + }; + + packages = forAllSystems (pkgs: { colorgrab = pkgs.colorgrab; default = pkgs.yemou-scripts; prefon = pkgs.prefon; scr = pkgs.scr; thm = pkgs.thm; yemou-scripts = pkgs.yemou-scripts; - }; - }; + }); + }; } -- 2.51.2