diff --git a/projects-old/SCION-1M/default.nix b/projects-old/SCION-1M/default.nix deleted file mode 100644 index 3911adf2f..000000000 --- a/projects-old/SCION-1M/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - pkgs, - lib, - sources, -}@args: -{ - packages = { - inherit (pkgs) - scion - scion-apps - scion-bootstrapper - ioq3-scion - pan-bindings - ; - }; - nixos = { - modules.services.scion = "${sources.inputs.nixpkgs}/nixos/modules/services/networking/scion/scion.nix"; - # TODO: unbreak - # tests.scion = "${sources.inputs.nixpkgs}/nixos/tests/scion/freestanding-deployment/default.nix"; - tests = null; - examples = null; - }; -} diff --git a/projects/SCION/default.nix b/projects/SCION/default.nix new file mode 100644 index 000000000..b956be154 --- /dev/null +++ b/projects/SCION/default.nix @@ -0,0 +1,55 @@ +{ + lib, + pkgs, + sources, +}@args: +{ + metadata = { + summary = "SCION is a clean-slate Next-Generation Internet (NGI) architecture which offers a.o. multi-path and path-awareness capabilities by design."; + subgrants = [ + "SCION-proxy" + "SCION-router-codealignment" + "Verified-SCION-router" + "SCION-Rains" + "SCION-Swarm" + "SCION-IPFS" + "SCION-1M" + "SCION-geo" + ]; + links = { + docs = { + text = "SCION Documentation"; + url = "https://docs.scion.org/en/latest/"; + }; + build = { + text = "Build from source"; + url = "https://github.com/scionproto/scion?tab=readme-ov-file#build-from-sources"; + }; + tests = { + text = "Testing Tutorial"; + url = "https://docs.scion.org/en/latest/tutorials/deploy.html#tasks-to-perform"; + }; + }; + }; + + nixos.modules.programs = { + scion = { + name = "scion"; + module = ./programs/basic/module.nix; + examples.basic = { + module = ./programs/basic/examples/basic.nix; + description = ""; + tests.basic = import ./programs/basic/tests/basic.nix args; + }; + }; + }; + + nixos.modules.services = { + scion = { + name = "scion"; + module = "${sources.inputs.nixpkgs}/nixos/modules/services/networking/scion/scion.nix"; + # TODO: unbreak + # tests.scion = "${sources.inputs.nixpkgs}/nixos/tests/scion/freestanding-deployment/default.nix"; + }; + }; +} diff --git a/projects/SCION/programs/basic/examples/basic.nix b/projects/SCION/programs/basic/examples/basic.nix new file mode 100644 index 000000000..e90d7d82c --- /dev/null +++ b/projects/SCION/programs/basic/examples/basic.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + programs.scion.enable = true; +} diff --git a/projects/SCION/programs/basic/module.nix b/projects/SCION/programs/basic/module.nix new file mode 100644 index 000000000..1cef7462c --- /dev/null +++ b/projects/SCION/programs/basic/module.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.programs.scion; +in +{ + options.programs.scion = { + enable = lib.mkEnableOption "scion"; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + scion + scion-apps + # scion-bootstrapper # FIX: broken in nixpkgs + ioq3-scion + pan-bindings + ]; + }; +} diff --git a/projects/SCION/programs/basic/tests/basic.nix b/projects/SCION/programs/basic/tests/basic.nix new file mode 100644 index 000000000..0b024900f --- /dev/null +++ b/projects/SCION/programs/basic/tests/basic.nix @@ -0,0 +1,28 @@ +{ + sources, + ... +}: + +{ + name = "scion"; + + nodes = { + machine = + { ... }: + { + imports = [ + sources.modules.ngipkgs + sources.modules.programs.scion + sources.examples.SCION.basic + ]; + }; + }; + + testScript = + { nodes, ... }: + '' + start_all() + + machine.succeed() + ''; +}