Skip to content
Closed
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
1 change: 1 addition & 0 deletions buildbot-nix.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
attribute = "checks.x86_64-linux"
184 changes: 183 additions & 1 deletion flake.lock

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

20 changes: 20 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@
inputs.nixdoc-to-github.flake = false;
inputs.nixdoc-to-github.url = "github:fricklerhandwerk/nixdoc-to-github";

inputs.hillingar.inputs.nixpkgs.follows = "nixpkgs";
inputs.hillingar.inputs.flake-utils.follows = "flake-utils";
inputs.hillingar.inputs.opam-repository.follows = "opam-repository";
inputs.hillingar.inputs.opam-overlays.follows = "opam-overlays";
inputs.hillingar.inputs.mirage-opam-overlays.follows = "mirage-opam-overlays";
inputs.hillingar.url = "github:RyanGibb/hillingar";
# update ocaml-related overlays to use new-enough ocaml packages
inputs.opam-repository = {
url = "github:ocaml/opam-repository";
flake = false;
};
inputs.opam-overlays = {
url = "github:dune-universe/opam-overlays";
flake = false;
};
inputs.mirage-opam-overlays = {
url = "github:dune-universe/mirage-opam-overlays";
flake = false;
};

# See <https://github.com/ngi-nix/ngipkgs/issues/24> for plans to support Darwin.
inputs.systems.url = "github:nix-systems/default-linux";

Expand Down
1 change: 1 addition & 0 deletions maintainers/shells/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pkgs.mkShellNoCC {
# FIX: package scope
"bigbluebutton"
"heads"
"dnsvizor"
# FIX: don't update `sparql-queries` if there is no version change
"inventaire-client"
# fetcher not supported
Expand Down
5 changes: 5 additions & 0 deletions pkgs/by-name/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
pkgs,
dream2nix,
hillingar,
sources,
}:
let
Expand Down Expand Up @@ -82,6 +83,10 @@ let
callPackage (directory + "/sbt-derivation.nix") {
inherit mkSbtDerivation;
}
else if pathExists (directory + "/hillingar.nix") then
callPackage (directory + "/hillingar.nix") {
inherit hillingar;
}
else
throw "No package.nix, dream2.nix or sbt-derivation.nix found in ${directory}"
) packageDirectories;
Expand Down
93 changes: 93 additions & 0 deletions pkgs/by-name/dnsvizor/hillingar.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
lib,
hillingar,
fetchFromGitHub,
pkgsStatic,
stdenv,
}:

let
version = "0-unstable-2025-12-17";

unikernel =
lib.flip hillingar.mkUnikernelPackages
Comment thread
jian-lin marked this conversation as resolved.
(fetchFromGitHub {
owner = "robur-coop";
repo = "dnsvizor";
rev = "57dbfa7208c765ba531995d9638f4a68b4cc6c15";
hash = "sha256-heiCAB+1TlAVa23r1GD6WP2w3Ha8kbqKup/gzJz0EW8=";
# ideally we should use postPatch, but we cannot
postFetch = ''
# TODO(linj) enable test
# currently tests fail to build if target is not "unix"
rm -vrf $out/test

# TODO(linj) remove this patch after dnsvizor#114 is merged
substituteInPlace $out/config.ml --replace-fail \
'package ~min:"0.5.0" "metrics";' \
'package ~min:"0.5.0" "metrics"; package ~min:"0.5.0" "metrics-lwt";'
'';
})
{
unikernelName = "dnsvizor";
depexts = [
pkgsStatic.gmp # some targets, such as hvt, need static gmp
];
monorepoQuery = {
uutf = "1.0.3+dune"; # default version is not in the dune overlay yet
};
query = {
# follow upstream CI version (.cirrus.yml) because newer ones fail to build
ocaml-base-compiler = "4.14.2";
};
};

targets = [
"unix"
"hvt"
"spt"
"xen"
"qubes"
"virtio"
"muen"
"macosx"
"genode"
];

# not use lib.isDerivation because it triggers IFD error if there is one
isDerivation = target: _package: lib.elem target targets;

# bad: eval failure by IFD or build failure
# do not use/set meta.broken because it doesn't cover eval failure by IFD
# more detailed support state can be found in https://github.com/Solo5/solo5/blob/dabc69fd89b8119449ec4088c54b458d4ccc851b/docs/building.md?plain=1#L55
knownBad =
target:
(lib.elem target [
"macosx"
"genode" # removed in solo5 0.7.0
])
|| (
stdenv.hostPlatform.isAarch64
&& lib.elem target [
"xen"
"qubes"
"virtio"
"muen"
]
);
notKnownBad = target: _package: !(knownBad target);

# This project has no release so the inferred version is "dev", which is invalid for nix.
# Use this function to make it valid when necessary.
overrideVersionIfDev =
newVersion: package:
package.overrideAttrs (old: {
version = if old.version == "dev" then newVersion else old.version;
__intentionallyOverridingVersion = true;
});
in
lib.pipe unikernel [
(lib.filterAttrs isDerivation)
(lib.filterAttrs notKnownBad)
(lib.mapAttrs (_target: package: overrideVersionIfDev version package))
]
1 change: 1 addition & 0 deletions pkgs/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ rec {
call = self.newScope {
nixdoc-to-github = self.callPackage sources.nixdoc-to-github { };
dream2nix = sources.dream2nix;
hillingar = sources.hillingar.lib.${system};
};

# Similar to `import`, but aware of `default` scope attributes.
Expand Down