Skip to content
Merged
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
30 changes: 30 additions & 0 deletions projects/holo/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
lib,
pkgs,
sources,
}@args:

{
metadata = {
summary = "Holo is a suite of routing protocols designed to address the needs of modern networks";
subgrants = [
"HoloRouting"
];
};

nixos.modules.programs = {
holo = {
name = "holo";
# if a project has `packages`, add them inside the `module.nix` file
module = ./programs/holo/module.nix;
examples.basic = {
module = ./programs/holo/examples/basic.nix;
description = "Enable the holo program";
tests.basic = import ./programs/holo/tests/basic.nix args;
};
};
};

# TODO: add service module
Comment thread
ethancedwards8 marked this conversation as resolved.
nixos.modules.services.holo-daemon = null;
}
5 changes: 5 additions & 0 deletions projects/holo/programs/holo/examples/basic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ ... }:

{
programs.holo.enable = true;
}
21 changes: 21 additions & 0 deletions projects/holo/programs/holo/module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.holo;
in
{
options.programs.holo = {
enable = lib.mkEnableOption "holo";
package = lib.mkPackageOption pkgs "holo-cli" { };
};

config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
cfg.package
];
};
}
28 changes: 28 additions & 0 deletions projects/holo/programs/holo/tests/basic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
sources,
...
}:

{
name = "holo";

nodes = {
machine =
{ ... }:
{
imports = [
sources.modules.ngipkgs
sources.modules.programs.holo
sources.examples.holo.basic
];
};
};

testScript =
{ nodes, ... }:
''
start_all()

machine.succeed("holo-cli --version")
'';
}