Skip to content

Commit adf0c0e

Browse files
jaenAtemu
authored andcommitted
git-repo: update to 2.45, patch to run locally
The `repo` tool derivation by default includes only the main wrapper script which fetches the actual tool sources from the internet. We modify the derivation to provide default local sources patched with support for repo2nix, unless specified otherwise with CLI parameters. Flake compat was updated and nixpkgs-unstable re-introduced to facilitate this change.
1 parent 817aebc commit adf0c0e

File tree

9 files changed

+1016
-19
lines changed

9 files changed

+1016
-19
lines changed

flake.lock

Lines changed: 34 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33

44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
6+
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
7+
68
androidPkgs.url = "github:tadfisher/android-nixpkgs/stable";
9+
10+
flake-compat.url = "github:nix-community/flake-compat";
711
};
812

9-
outputs = { self, nixpkgs, androidPkgs, ... }@inputs: let
13+
outputs = { self, nixpkgs, nixpkgs-unstable, androidPkgs, flake-compat, ... }@inputs: let
1014
pkgs = import ./pkgs/default.nix { inherit inputs; };
1115
in {
1216
# robotnixSystem evaluates a robotnix configuration
@@ -24,6 +28,7 @@
2428

2529
packages.x86_64-linux = {
2630
manual = (import ./docs { inherit pkgs; }).manual;
31+
gitRepo = pkgs.gitRepo;
2732
};
2833

2934
devShell.x86_64-linux = pkgs.mkShell {

flake/compat.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{ system ? builtins.currentSystem }:
2+
let
3+
lock = builtins.fromJSON (builtins.readFile ./../flake.lock);
4+
flake-compat-entry = lock.nodes.root.inputs.flake-compat;
5+
6+
inherit (lock.nodes."${ flake-compat-entry }".locked) owner repo narHash;
7+
8+
flake-compat = builtins.fetchTarball {
9+
url = "https://github.com/${ owner }/${ repo }/archive/${ lock.nodes.flake-compat.locked.rev }.tar.gz";
10+
sha256 = narHash;
11+
};
12+
in
13+
import flake-compat {
14+
inherit system;
15+
16+
src = ./..;
17+
}

pkgs/default.nix

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
# SPDX-FileCopyrightText: 2020 Daniel Fullmer and robotnix contributors
22
# SPDX-License-Identifier: MIT
33

4-
{ inputs ? (import (
5-
fetchTarball {
6-
url = "https://github.com/edolstra/flake-compat/archive/12c64ca55c1014cdc1b16ed5a804aa8576601ff2.tar.gz";
7-
sha256 = "0jm6nzb83wa6ai17ly9fzpqc40wg1viib8klq8lby54agpl213w5"; }
8-
) {
9-
src = ../.;
10-
}).defaultNix.inputs,
4+
{ inputs ? (import ../flake/compat.nix).defaultNix.inputs,
115
... }@args:
126

137
let
@@ -17,5 +11,5 @@ in nixpkgs.legacyPackages.x86_64-linux.appendOverlays [
1711
androidPkgs.packages = androidPkgs.packages.x86_64-linux;
1812
androidPkgs.sdk = androidPkgs.sdk.x86_64-linux;
1913
})
20-
(import ./overlay.nix)
14+
(import ./overlay.nix { inherit inputs; })
2115
]

0 commit comments

Comments
 (0)