Skip to content

aarch64-linux host fixes & other improvments #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apks/chromium/buildenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ buildFHSUserEnv {
targetPkgs = pkgs: with pkgs; [
# Stuff verified to be needed in chromium
jdk8
glibc_multi.dev # Needs unistd.h
libkrb5.dev # Needs headers
libkrb5
ncurses5
libxml2
];
] ++ lib.optional (buildPlatform.isx86) glibc_multi.dev;
multiPkgs = pkgs: with pkgs; [
zlib
ncurses5
Expand Down
5 changes: 4 additions & 1 deletion apks/chromium/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ let

deps = import (./vendor- + version + ".nix") {
inherit fetchgit fetchcipd fetchurl runCommand symlinkJoin;
platform = "linux-amd64"; # TODO: Figure out mapping for cipd platform
platform = {
x86_64-linux = "linux-amd64";
aarch64-linux = "linux-arm64";
}.${stdenv.buildPlatform.system};
} // depsOverrides;

src = runCommand "chromium-${version}-src" {} # TODO: changed from mkDerivation since it needs passAsFile or else this can get too big for the derivation: nixos "while setting up the build environment" "argument list too long"
Expand Down
3 changes: 2 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ let
else lib.showWarnings eval.config.warnings eval.config;

in {
inherit (eval) pkgs options;
inherit (eval) options;
inherit config;
inherit (eval._module.args) pkgs;

# Things that are nice to have at the top-level, since they might get moved
# in the future:
Expand Down
15 changes: 10 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
};

outputs = { self, nixpkgs, nixpkgs-unstable, androidPkgs, flake-compat, ... }@inputs: let
pkgs = import ./pkgs/default.nix { inherit inputs; };
getPkgs = system: import ./pkgs/default.nix { inherit inputs system; };
in {
# robotnixSystem evaluates a robotnix configuration
lib.robotnixSystem = configuration: import ./default.nix {
inherit configuration pkgs;
lib.robotnixSystem = system: configuration: import ./default.nix {
inherit configuration;
pkgs = getPkgs system;
};

defaultTemplate = {
Expand All @@ -26,12 +27,16 @@
nixosModule = import ./nixos; # Contains all robotnix nixos modules
nixosModules.attestation-server = import ./nixos/attestation-server/module.nix;

packages.x86_64-linux = {
packages.x86_64-linux = let
pkgs = getPkgs "x86_64-linux";
in {
manual = (import ./docs { inherit pkgs; }).manual;
gitRepo = pkgs.gitRepo;
};

devShell.x86_64-linux = pkgs.mkShell {
devShell.x86_64-linux = let
pkgs = getPkgs "x86_64-linux";
in pkgs.mkShell {
name = "robotnix-scripts";
nativeBuildInputs = with pkgs; [
# For android updater scripts
Expand Down
2 changes: 1 addition & 1 deletion pkgs/android-emulator/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{ stdenv, lib, fetchurl, runCommand, writeText, writeShellScript,
autoPatchelfHook, makeWrapper, glibc, libGL, libpulseaudio, zlib, ncurses5,
nspr, fontconfig, nss, unzip, alsa-lib, libuuid, xlibs, dbus, xkeyboard_config,
nspr, fontconfig, nss, unzip, alsa-lib, libuuid, dbus, xkeyboard_config,
xorg,
androidPkgs
}:
Expand Down
6 changes: 3 additions & 3 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

let
inherit (inputs) nixpkgs androidPkgs;
in nixpkgs.legacyPackages.x86_64-linux.appendOverlays [
in nixpkgs.legacyPackages."${system}".appendOverlays [
(self: super: {
androidPkgs.packages = androidPkgs.packages.x86_64-linux;
androidPkgs.sdk = androidPkgs.sdk.x86_64-linux;
androidPkgs.packages = androidPkgs.packages."${system}";
androidPkgs.sdk = androidPkgs.sdk."${system}";
})
(import ./overlay.nix { inherit inputs; })
]
2 changes: 1 addition & 1 deletion template/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# "dailydriver" is an arbitrary user-chosen name for this particular
# configuration. Change it to something meaningful for you, perhaps just
# the device name if you only have one of this kind of device.
robotnixConfigurations."dailydriver" = robotnix.lib.robotnixSystem ({ config, pkgs, ... }: {
robotnixConfigurations."dailydriver" = robotnix.lib.robotnixSystem "x86_64-linux" ({ config, pkgs, ... }: {
# These two are required options
device = "crosshatch";
flavor = "vanilla"; # "grapheneos" is another option
Expand Down