Skip to content

Commit

Permalink
git-repo: update to 2.45, patch to run locally
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jaen authored and Atemu committed Jun 5, 2024
1 parent 25ecd3a commit 0926f07
Show file tree
Hide file tree
Showing 9 changed files with 1,016 additions and 19 deletions.
35 changes: 34 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";

androidPkgs.url = "github:tadfisher/android-nixpkgs/stable";

flake-compat.url = "github:nix-community/flake-compat";
};

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

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

devShell.x86_64-linux = pkgs.mkShell {
Expand Down
17 changes: 17 additions & 0 deletions flake/compat.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ system ? builtins.currentSystem }:
let
lock = builtins.fromJSON (builtins.readFile ./../flake.lock);
flake-compat-entry = lock.nodes.root.inputs.flake-compat;

inherit (lock.nodes."${ flake-compat-entry }".locked) owner repo narHash;

flake-compat = builtins.fetchTarball {
url = "https://github.com/${ owner }/${ repo }/archive/${ lock.nodes.flake-compat.locked.rev }.tar.gz";
sha256 = narHash;
};
in
import flake-compat {
inherit system;

src = ./..;
}
10 changes: 2 additions & 8 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# SPDX-FileCopyrightText: 2020 Daniel Fullmer and robotnix contributors
# SPDX-License-Identifier: MIT

{ inputs ? (import (
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/12c64ca55c1014cdc1b16ed5a804aa8576601ff2.tar.gz";
sha256 = "0jm6nzb83wa6ai17ly9fzpqc40wg1viib8klq8lby54agpl213w5"; }
) {
src = ../.;
}).defaultNix.inputs,
{ inputs ? (import ../flake/compat.nix).defaultNix.inputs,
... }@args:

let
Expand All @@ -17,5 +11,5 @@ in nixpkgs.legacyPackages.x86_64-linux.appendOverlays [
androidPkgs.packages = androidPkgs.packages.x86_64-linux;
androidPkgs.sdk = androidPkgs.sdk.x86_64-linux;
})
(import ./overlay.nix)
(import ./overlay.nix { inherit inputs; })
]
Loading

0 comments on commit 0926f07

Please sign in to comment.