feat(bootstrap): Add the root of the repository

This avoids making ../../.. in some places
This commit is contained in:
Tom Hubrecht 2025-04-14 14:02:42 +02:00 committed by thubrecht
parent 6ffa71c17d
commit 8f8585038d
3 changed files with 11 additions and 7 deletions

View file

@ -27,6 +27,8 @@ in
{ {
inherit overlays sources unpatchedSources; inherit overlays sources unpatchedSources;
root = ./.;
pkgs = pkgs // { pkgs = pkgs // {
lib = pkgs.lib.extend overlays.lib; lib = pkgs.lib.extend overlays.lib;
}; };

View file

@ -2,6 +2,8 @@
# #
# SPDX-License-Identifier: EUPL-1.2 # SPDX-License-Identifier: EUPL-1.2
{ bootstrap, ... }:
let let
host = "docuseal.dgnum.eu"; host = "docuseal.dgnum.eu";
port = 2500; port = 2500;
@ -12,7 +14,7 @@ in
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: _: { (self: _: {
docuseal = self.callPackage ../../../../pkgs/by-name/docuseal { }; docuseal = self.callPackage (bootstrap.root + "/pkgs/by-name/docuseal") { };
}) })
]; ];

View file

@ -5,13 +5,13 @@
{ {
lib, lib,
meta, meta,
bootstrap,
sources, sources,
dgn-keys, dgn-keys,
... ...
}: }:
let let
inherit (lib.extra) mkImports; inherit (lib.extra) mkImports;
hive-root = ../../../..;
host = "search.infra.dgnum.eu"; host = "search.infra.dgnum.eu";
in in
{ {
@ -24,14 +24,14 @@ in
enable = true; enable = true;
modules = { modules = {
"netconf" = { "netconf" = {
paths = mkImports hive-root [ paths = mkImports bootstrap.root [
"modules/netconf" "modules/netconf"
"modules/generic" "modules/generic"
"lib/netconf-junos" "lib/netconf-junos"
]; ];
path-translations = [ path-translations = [
{ {
base = hive-root; base = bootstrap.root;
url = "https://git.dgnum.eu/DGNum/infrastructure/src/branch/main/"; url = "https://git.dgnum.eu/DGNum/infrastructure/src/branch/main/";
} }
]; ];
@ -39,11 +39,11 @@ in
"DGNum Infrastructure" = "DGNum Infrastructure" =
let let
# prefer a non-patched nixpkgs # prefer a non-patched nixpkgs
infra-nixpkgs = (import "${hive-root}/bootstrap.nix").pkgs; infra-nixpkgs = bootstrap.pkgs;
infra-modulesPath = "${infra-nixpkgs.path}/nixos/modules/"; infra-modulesPath = "${infra-nixpkgs.path}/nixos/modules/";
in in
{ {
paths = mkImports hive-root [ paths = mkImports bootstrap.root [
"modules/generic" "modules/generic"
"modules/nixos" "modules/nixos"
]; ];
@ -71,7 +71,7 @@ in
}; };
path-translations = [ path-translations = [
{ {
base = hive-root; base = bootstrap.root;
url = "https://git.dgnum.eu/DGNum/infrastructure/src/branch/main/"; url = "https://git.dgnum.eu/DGNum/infrastructure/src/branch/main/";
} }
{ {