diff options
-rw-r--r-- | flake.nix | 69 |
1 files changed, 33 insertions, 36 deletions
@@ -5,48 +5,45 @@ }: let inherit (builtins) replaceStrings readFile; readVer = file: replaceStrings ["\n"] [""] (readFile file); - 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 { - devShells = forAllSystems({system, pkgs, ...}: import ./nix/devshell.nix { - inherit self pkgs; - }); + 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; + }; - lib = forAllSystems({system, pkgs, ...}: { + lib = { mkLuaPackage = import ./nix/lua.nix { inherit pkgs; astal = self; }; - }); + }; - packages = forAllSystems({system, pkgs, mkPkg, ...}: with pkgs;{ + packages.${system} = with pkgs; { docs = import ./docs {inherit self pkgs;}; default = self.packages.${system}.io; @@ -79,7 +76,7 @@ self.packages.${system}.astal3 ]; }; - }); + }; }; inputs = { |