Skip to content

Commit

Permalink
search: init
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Nov 11, 2024
1 parent 5a0fb26 commit e14abe7
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 13 deletions.
53 changes: 52 additions & 1 deletion flake.lock

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

13 changes: 12 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
search = {
url = "github:NuschtOS/search";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};

outputs = { self, nixpkgs, flake-utils, ... }:
outputs = { self, nixpkgs, flake-utils, search, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let
Expand All @@ -14,6 +19,12 @@
in
{
checks = import ./checks { inherit self pkgs; };
packages = {
search = search.packages.${system}.mkSearch {
modules = [ self.nixosModules.bird ];
urlPrefix = "https://github.com/NuschtOS/bird.nix/blob/main/";
};
};
}
) // {
nixosModules = rec {
Expand Down
28 changes: 17 additions & 11 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ in
# default = "${config.networking.hostName}.${config.networking.domain}";
#};

protocols =
let
protocolOption = lib.mkOption {
type = with lib.types; attrsOf lines;
default = { };
};
in
{
} // (
let
protocolOption = lib.mkOption {
type = with lib.types; attrsOf lines;
default = { };
};
protocols = {
# List of all protocols: https://bird.network.cz/?get_doc&v=20&f=bird-6.html
aggregator = protocolOption;
babel = protocolOption;
Expand All @@ -35,16 +34,23 @@ in
kernel = protocolOption;
l3vpn = protocolOption;
mrt = protocolOption;
ospfv2 = protocolOption;
ospfv3 = protocolOption;
perf = protocolOption;
pipe = protocolOption;
radv = protocolOption;
rip = protocolOption;
rpki = protocolOption;
static = protocolOption;
};
};
in
{
templates = protocols;
protocols = protocols // {
# ospf does not support templates
ospfv2 = protocolOption;
ospfv3 = protocolOption;
};
}
);

config = lib.mkIf cfg.enable {
services.bird2 = {
Expand Down

0 comments on commit e14abe7

Please sign in to comment.