Skip to content

Commit

Permalink
Add aarch64 Compatability to Flake (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
cold-leopard authored Dec 19, 2024
1 parent 0cf43e5 commit 23083cd
Showing 1 changed file with 36 additions and 33 deletions.
69 changes: 36 additions & 33 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -76,7 +79,7 @@
self.packages.${system}.astal3
];
};
};
});
};

inputs = {
Expand Down

0 comments on commit 23083cd

Please sign in to comment.