diff --git a/clients/quadphone/binfmt.nix b/clients/quadphone/binfmt.nix deleted file mode 100644 index fa9ce26..0000000 --- a/clients/quadphone/binfmt.nix +++ /dev/null @@ -1,2 +0,0 @@ -{inputs, ...}: { -} diff --git a/clients/quadphone/gnome.nix b/clients/quadphone/gnome.nix index 18168d1..792366d 100644 --- a/clients/quadphone/gnome.nix +++ b/clients/quadphone/gnome.nix @@ -1,5 +1,9 @@ -{inputs, ...}: { - nixpkgs.overlays = [inputs.gnome-mobile.overlays.default]; +{ + inputs, + crossPkgs, + ... +}: { + nixpkgs.overlays = [(self: super: inputs.gnome-mobile.overlays.default self crossPkgs)]; i18n.inputMethod = { enable = true; diff --git a/clients/quadphone/hardware-configuration.nix b/clients/quadphone/hardware-configuration.nix index e6d9630..fa8a443 100644 --- a/clients/quadphone/hardware-configuration.nix +++ b/clients/quadphone/hardware-configuration.nix @@ -1,7 +1,7 @@ { config, inputs, - pkgs, + crossPkgs, lib, ... }: { @@ -10,7 +10,8 @@ import "${inputs.sdm845}/nixos/profiles/boot/kernel/sdm845-mainline" { - inherit pkgs lib config; + inherit lib config; + pkgs = crossPkgs; inputs = inputs.sdm845.inputs; }) ]; @@ -18,7 +19,7 @@ boot.initrd.allowMissingModules = true; nixpkgs = { - hostPlatform = "aarch64-linux"; # Do i use binfmt here + hostPlatform = "aarch64-linux"; config.allowBroken = true; }; } diff --git a/clients/quadphone/overlays.nix b/clients/quadphone/overlays.nix index 8597a91..546bd5d 100644 --- a/clients/quadphone/overlays.nix +++ b/clients/quadphone/overlays.nix @@ -5,38 +5,38 @@ }: let ibusPath = "i18n/input-method/default.nix"; in { - disabledModules = [ibusPath]; - imports = [ - (import "${inputs.ibus-fix}/nixos/modules/${ibusPath}") - ]; + # disabledModules = [ibusPath]; + # imports = [ + # (import "${inputs.ibus-fix}/nixos/modules/${ibusPath}") + # ]; - nixpkgs.overlays = [ - (_: super: { - # https://github.com/NixOS/nixpkgs/pull/434550 - iniparser = super.iniparser.overrideAttrs (old: { - cmakeFlags = [ - (lib.cmakeBool "BUILD_TESTING" false) - ]; - }); + # nixpkgs.overlays = [ + # (_: super: { + # # https://github.com/NixOS/nixpkgs/pull/434550 + # iniparser = super.iniparser.overrideAttrs (old: { + # cmakeFlags = [ + # (lib.cmakeBool "BUILD_TESTING" false) + # ]; + # }); - # TODO: Upstream to nixpkgs - glycin-loaders = super.glycin-loaders.overrideAttrs (old: { - env.CARGO_BUILD_TARGET = super.stdenv.hostPlatform.rust.rustcTargetSpec; - postPatch = '' - substituteInPlace loaders/meson.build \ - --replace-fail "cargo_target_dir / rust_target / loader," "cargo_target_dir / '${super.stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / loader," - ''; + # # TODO: Upstream to nixpkgs + # glycin-loaders = super.glycin-loaders.overrideAttrs (old: { + # env.CARGO_BUILD_TARGET = super.stdenv.hostPlatform.rust.rustcTargetSpec; + # postPatch = '' + # substituteInPlace loaders/meson.build \ + # --replace-fail "cargo_target_dir / rust_target / loader," "cargo_target_dir / '${super.stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / loader," + # ''; - nativeBuildInputs = (old.nativeBuildInputs or []) ++ [super.buildPackages.rustPlatform.cargoSetupHook]; - cargoVendorDir = "vendor"; - }); + # nativeBuildInputs = (old.nativeBuildInputs or []) ++ [super.buildPackages.rustPlatform.cargoSetupHook]; + # cargoVendorDir = "vendor"; + # }); - # TODO: Maybe upstream to nixpkgs (ruby maintainer please reply to my DM) - ruby_3_3 = super.ruby_3_3.overrideAttrs (old: { - NIX_RUSTFLAGS = - (old.NIX_RUSTFLAGS or "") - + " --target ${super.stdenv.hostPlatform.rust.rustcTargetSpec}"; - }); - }) - ]; + # # TODO: Maybe upstream to nixpkgs (ruby maintainer please reply to my DM) + # ruby_3_3 = super.ruby_3_3.overrideAttrs (old: { + # NIX_RUSTFLAGS = + # (old.NIX_RUSTFLAGS or "") + # + " --target ${super.stdenv.hostPlatform.rust.rustcTargetSpec}"; + # }); + # }) + # ]; } diff --git a/clients/quadphone/repart.nix b/clients/quadphone/repart.nix index 0f92c02..cc5a783 100644 --- a/clients/quadphone/repart.nix +++ b/clients/quadphone/repart.nix @@ -1,5 +1,6 @@ { modulesPath, + crossPkgs, pkgs, config, lib, @@ -46,14 +47,14 @@ in { }; "20-esp" = { contents = { - "/EFI/EDK2-UEFI-SHELL/SHELL.EFI".source = "${pkgs.edk2-uefi-shell.overrideAttrs {env.NIX_CFLAGS_COMPILE = "-Wno-error=maybe-uninitialized";}}/shell.efi"; + "/EFI/EDK2-UEFI-SHELL/SHELL.EFI".source = "${crossPkgs.edk2-uefi-shell.overrideAttrs {env.NIX_CFLAGS_COMPILE = "-Wno-error=maybe-uninitialized";}}/shell.efi"; "/EFI/BOOT/BOOT${lib.toUpper efiArch}.EFI".source = "${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${efiArch}.efi"; "/EFI/Linux/${config.system.boot.loader.ukiFile}".source = "${config.system.build.uki}/${config.system.boot.loader.ukiFile}"; - "/loader/loader.conf".source = pkgs.writeText "loader.conf" '' + "/loader/loader.conf".source = crossPkgs.writeText "loader.conf" '' timeout 5 console-mode keep ''; - "/loader/entries/shell.conf".source = pkgs.writeText "shell.conf" '' + "/loader/entries/shell.conf".source = crossPkgs.writeText "shell.conf" '' title EDK2 UEFI Shell efi /EFI/EDK2-UEFI-SHELL/SHELL.EFI ''; @@ -68,7 +69,7 @@ in { }; "30-root" = { storePaths = [config.system.build.toplevel]; - contents."/boot".source = pkgs.runCommand "boot" {} "mkdir $out"; + contents."/boot".source = crossPkgs.runCommand "boot" {} "mkdir $out"; repartConfig = { Type = "root"; Format = "ext4"; diff --git a/clients/quadraticserver/caddy.nix b/clients/quadraticserver/caddy.nix index f8c8f63..5fc13b6 100644 --- a/clients/quadraticserver/caddy.nix +++ b/clients/quadraticserver/caddy.nix @@ -13,7 +13,7 @@ environmentFile = config.age.secrets."base64JwtSecret.age".path; package = pkgs.caddy.withPlugins { plugins = ["github.com/ggicci/caddy-jwt@v1.1.0"]; - hash = "sha256-erLYIrrzX19iLEBgq8KIgq+6RDg99Z7tN7FCViG19s4="; + hash = "sha256-RvpZh7iL5vsuvTTSHYYu2blAdO0tINxWWuT9IPlni7o="; }; virtualHosts = diff --git a/flake.nix b/flake.nix index 775e437..9dbaaf6 100755 --- a/flake.nix +++ b/flake.nix @@ -71,9 +71,15 @@ }; system = info: lib.nixosSystem { + inherit (info) system; specialArgs = { inherit inputs dirUtils; isDesktop = info.isDesktop or false; + crossPkgs = import inputs.nixpkgs { + hostPlatform = info.system; + localSystem = info.system; + buildPlatform = "x86_64-linux"; + }; }; modules = with dirUtils; @@ -104,11 +110,14 @@ formatter = pkgs.alejandra; }; - flake.nixosConfigurations = builtins.mapAttrs (name: value: system (value // {hostname = name;})) { + flake.nixosConfigurations = builtins.mapAttrs (name: value: system ({system = "x86_64-linux";} // value // {hostname = name;})) { "quadraticpc".isDesktop = true; "quadtop".isDesktop = true; "quadraticserver".isServer = true; - "quadphone".isGraphical = true; + "quadphone" = { + isGraphical = true; + system = "aarch64-linux"; + }; }; }; } diff --git a/modules/common/arch.nix b/modules/common/arch.nix deleted file mode 100644 index 30deaf8..0000000 --- a/modules/common/arch.nix +++ /dev/null @@ -1,6 +0,0 @@ -{lib, ...}: { - nixpkgs = { - hostPlatform = lib.mkDefault "x86_64-linux"; - buildPlatform = "x86_64-linux"; - }; -} diff --git a/modules/desktop/binfmt.nix b/modules/desktop/binfmt.nix new file mode 100644 index 0000000..ef79873 --- /dev/null +++ b/modules/desktop/binfmt.nix @@ -0,0 +1 @@ +{boot.binfmt.emulatedSystems = ["aarch64-linux"];}