diff options
author | cold-leopard <[email protected]> | 2024-12-19 16:56:58 -0600 |
---|---|---|
committer | GitHub <[email protected]> | 2024-12-19 23:56:58 +0100 |
commit | 23083cdec69853bc8e480807a5f93b03df340183 (patch) | |
tree | c6ac8f438a9198a06f352715fedb91280392f96b | |
parent | 0cf43e594f13e3de1f076028c13d10a25ef4a635 (diff) |
Add aarch64 Compatability to Flake (#183)
-rw-r--r-- | flake.nix | 69 |
1 files changed, 36 insertions, 33 deletions
@@ -5,45 +5,48 @@ }: let inherit (builtins) replaceStrings readFile; readVer = file: replaceStrings ["\n"] [""] (readFile file); - - system = "x86_64-linux"; # TODO: other architectures - pkgs = nixpkgs.legacyPackages.${system}; - - mkPkg = name: src: inputs: - pkgs.stdenv.mkDerivation { - nativeBuildInputs = with pkgs; [ - wrapGAppsHook - gobject-introspection - meson - pkg-config - ninja - vala - wayland - wayland-scanner - python3 - ]; - propagatedBuildInputs = [pkgs.glib] ++ inputs; - pname = name; - version = readVer "${src}/version"; - src = src; - postUnpack = '' - cp --remove-destination ${./lib/gir.py} $sourceRoot/gir.py - ''; - outputs = ["out" "dev"]; - }; - in { - devShells.${system} = import ./nix/devshell.nix { - inherit self pkgs; + supportedSystems = [ "x86_64-linux" "aarch64-linux" ]; + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: (forSystem system f)); + forSystem = system: f: f rec { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + mkPkg = name: src: inputs: + pkgs.stdenv.mkDerivation { + nativeBuildInputs = with pkgs; [ + wrapGAppsHook + gobject-introspection + meson + pkg-config + ninja + vala + wayland + wayland-scanner + python3 + ]; + propagatedBuildInputs = [pkgs.glib] ++ inputs; + pname = name; + version = readVer "${src}/version"; + src = src; + postUnpack = '' + cp --remove-destination ${./lib/gir.py} $sourceRoot/gir.py + ''; + outputs = ["out" "dev"]; + }; }; + in { - lib = { + devShells = forAllSystems({system, pkgs, ...}: import ./nix/devshell.nix { + inherit self pkgs; + }); + + lib = forAllSystems({system, pkgs, ...}: { mkLuaPackage = import ./nix/lua.nix { inherit pkgs; astal = self; }; - }; + }); - packages.${system} = with pkgs; { + packages = forAllSystems({system, pkgs, mkPkg, ...}: with pkgs;{ docs = import ./docs {inherit self pkgs;}; default = self.packages.${system}.io; @@ -76,7 +79,7 @@ self.packages.${system}.astal3 ]; }; - }; + }); }; inputs = { |