diff --git a/nix/flake.lock b/nix/flake.lock index 429b33f35..d8ae4da13 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -1,23 +1,5 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1794427683, - "narHash": "sha256-o7ey9gEilsxaifqJWnBDlYSKbNWYQYtKwDyXeZU2kaU=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cd489559845d81f673a12885576016c65cbe9363", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "freetype2": { "flake": false, "locked": { @@ -87,7 +69,6 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "freetype2": "freetype2", "harfbuzz": "harfbuzz", "libpng": "libpng", @@ -116,21 +97,6 @@ "type": "github" } }, - "systems": { - "locked": { - "lastModified": 1791244623, - "narHash": "sha256-uuanbkFk8a313Zfrxdcz8Us/yQtaxNnKJtX8v0ZPpd8=", - "owner": "nix-systems", - "repo": "default", - "rev": "d36eeed142f88b5a636f2e3856a53c61654cf29b", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "zlib": { "flake": false, "locked": { diff --git a/nix/flake.nix b/nix/flake.nix index 28ffe709b..86e73344a 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -3,7 +3,6 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - flake-utils.url = "github:numtide/flake-utils"; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; @@ -41,218 +40,60 @@ }; outputs = - inputs@{ self, ... }: + inputs@{ self, nixpkgs, ... }: let - perSystemOutputs = inputs.flake-utils.lib.eachDefaultSystem ( + lib = nixpkgs.lib; + + systems = builtins.attrNames nixpkgs.legacyPackages; + forSystems = lib.genAttrs systems; + forSys = system: { + pkgs = import nixpkgs { + inherit system; + overlays = [ (import inputs.rust-overlay) ]; + }; + repopkgs = self.packages.${system}; + }; + + vmTestingSystem = "x86_64-linux"; + in + { + packages = forSystems ( system: let - overlays = [ (import inputs.rust-overlay) ]; - pkgs = import inputs.nixpkgs { inherit system overlays; }; - - inherit (inputs.nixpkgs) lib; - inherit (pkgs) stdenv; - - nativeBuildInputs = - with pkgs; - [ - installShellFiles - ncurses # tic for terminfo - pkg-config - python3 - ] - ++ lib.optional stdenv.hostPlatform.isDarwin perl; - - buildInputs = - with pkgs; - [ - fontconfig - libgit2 - openssl - sqlite # Required by the sync-color-schemes workspace member - zlib - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libxkbcommon - wayland - - libx11 - libxcb - libxcb-util - libxcb-image - libxcb-keysyms - libxcb-wm # contains xcb-ewmh among others - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin ([ - libiconv - ]); - - libPath = lib.makeLibraryPath ( - with pkgs; - [ - libxcb-image - libGL - vulkan-loader - ] - ); - - rustPlatform = pkgs.makeRustPlatform { - cargo = pkgs.rust-bin.stable.latest.minimal; - rustc = pkgs.rust-bin.stable.latest.minimal; + pkgs = (forSys system).pkgs; + wezterm = pkgs.callPackage ./package.nix { + flakeInfo = { + inherit (self) lastModifiedDate; + # note: we can't use `inherit` here because `rev` & `dirtyRev` may not be present. + rev = self.rev or null; + dirtyRev = self.dirtyRev or null; + }; + inputSubmodules = { + inherit (inputs) + freetype2 + harfbuzz + libpng + zlib + ; + }; }; in { - packages.default = rustPlatform.buildRustPackage (finalAttrs: { - inherit buildInputs nativeBuildInputs; + default = wezterm; + inherit wezterm; + } + ); - pname = "wezterm"; - src = ./..; - - # Rebuild the usual version number of the project from info of commit being built. - # Format: `-