Skip to content

Commit 5159898

Browse files
committed
bumps nixpkgs to 23.11 and android-nixpkgs, remove nixpkgsUnstable
This commit bumps nixpkgs to 23.11, while incorporating small changes to ensure everything works. At the same time, nixpkgsUnstable has been removed as it does not seem to be needed anymore. android-nixpkgs has been bumped to the latest version as well. `LD_LIBRARY_PATH` paths has been added to buildFHSUSerEnv, because of upstream changes. Please see the following information if curious. NixOS/nixpkgs#103648 NixOS/nixpkgs#112266 NixOS/nixpkgs#262775 NixOS/nixpkgs#263201 NixOS/nixpkgs#278361
1 parent f941a20 commit 5159898

File tree

6 files changed

+97
-39
lines changed

6 files changed

+97
-39
lines changed

flake.lock

Lines changed: 70 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
description = "Build Android (AOSP) using Nix";
33

44
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
6-
nixpkgsUnstable.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
76
androidPkgs.url = "github:tadfisher/android-nixpkgs/stable";
87
};
98

@@ -38,7 +37,8 @@
3837
wget
3938

4039
# For chromium updater script
41-
python2 cipd git
40+
# python2
41+
cipd git
4242

4343
cachix
4444
];

modules/base.nix

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ in
299299
inherit name;
300300
srcs = [];
301301

302+
# TODO: update in the future, might not be required.
303+
# gets permissed denied if not set, in some of our deps
304+
dontUpdateAutotoolsGnuConfigScripts = true;
305+
302306
# TODO: Clean this stuff up. unshare / robotnix-build could probably be combined into a single utility.
303307
builder = pkgs.writeShellScript "builder.sh" ''
304308
export SAVED_UID=$(${pkgs.coreutils}/bin/id -u)
@@ -436,8 +440,8 @@ in
436440
name = "ota-tools";
437441
inherit src;
438442
sourceRoot = ".";
439-
nativeBuildInputs = with pkgs; [ unzip pythonPackages.pytest ];
440-
buildInputs = [ (pkgs.python.withPackages (p: [ p.protobuf ])) ];
443+
nativeBuildInputs = with pkgs; [ unzip python3Packages.pytest ];
444+
buildInputs = [ (pkgs.python3.withPackages (p: [ p.protobuf ])) ];
441445
postPatch = lib.optionalString (config.androidVersion == 11) ''
442446
cp bin/debugfs_static bin/debugfs
443447
'' + lib.optionalString (config.androidVersion <= 10) ''
@@ -513,6 +517,18 @@ in
513517
name = "robotnix-build";
514518
targetPkgs = pkgs: config.envPackages;
515519
multiPkgs = pkgs: with pkgs; [ zlib ];
520+
521+
# TODO might not be needed in the future, required now because
522+
# Android works in mysterious ways. Wasn't needed in the past
523+
# because these paths were already a part of LD_LIBRARY_PATH
524+
# when using FHS.
525+
#
526+
# See here for issue when it was introduced https://github.com/NixOS/nixpkgs/issues/262775
527+
# Inspiration taken from here https://github.com/NixOS/nixpkgs/pull/278361
528+
# More information here as well https://github.com/NixOS/nixpkgs/issues/103648
529+
profile = ''
530+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/lib32
531+
'';
516532
};
517533
};
518534
}];

modules/envpackages.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ in
1818
lsof
1919
m4
2020
ncurses5
21+
libxcrypt-legacy
2122
openssl # Used in avbtool
2223
psmisc # for "fuser", "pstree"
2324
rsync

pkgs/default.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@
1111
... }@args:
1212

1313
let
14-
inherit (inputs) nixpkgs nixpkgsUnstable androidPkgs;
14+
inherit (inputs) nixpkgs androidPkgs;
1515
in nixpkgs.legacyPackages.x86_64-linux.appendOverlays [
1616
(self: super: {
1717
androidPkgs.packages = androidPkgs.packages.x86_64-linux;
1818
androidPkgs.sdk = androidPkgs.sdk.x86_64-linux;
19-
20-
inherit (nixpkgsUnstable.legacyPackages.x86_64-linux)
21-
diffoscope;
2219
})
2320
(import ./overlay.nix)
2421
]

pkgs/overlay.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ self: super: {
2727

2828
fetchgerritpatchset = super.callPackage ./fetchgerritpatchset {};
2929

30-
fetchgit = super.callPackage ./fetchgit {};
30+
# TODO cleanup once fetchgit is overridable upstream
31+
fetchgit = args: ((super.lib.makeOverridable super.fetchgit) args).overrideAttrs (old: {
32+
impureEnvVars = old.impureEnvVars or [ ] ++ [ "ROBOTNIX_GIT_MIRRORS" ];
33+
});
3134
nix-prefetch-git = super.callPackage ./fetchgit/nix-prefetch-git.nix {};
3235

3336
###

0 commit comments

Comments
 (0)