{"id":13317175,"url":"https://github.com/hardenedlinux/zeek2nix","last_synced_at":"2025-03-11T00:33:33.358Z","repository":{"id":37703131,"uuid":"300570045","full_name":"hardenedlinux/zeek2nix","owner":"hardenedlinux","description":"An operator which calls zeek to nix-ecosystem simply.","archived":false,"fork":false,"pushed_at":"2023-03-06T15:58:37.000Z","size":2136,"stargazers_count":9,"open_issues_count":2,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-07-29T19:15:12.633Z","etag":null,"topics":["ids","network-monitoring","nix","zeek","zeek-ids","zeek-package"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hardenedlinux.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-02T09:48:36.000Z","updated_at":"2024-04-30T12:37:34.000Z","dependencies_parsed_at":"2023-02-18T21:01:09.100Z","dependency_job_id":null,"html_url":"https://github.com/hardenedlinux/zeek2nix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardenedlinux%2Fzeek2nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardenedlinux%2Fzeek2nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardenedlinux%2Fzeek2nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardenedlinux%2Fzeek2nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hardenedlinux","download_url":"https://codeload.github.com/hardenedlinux/zeek2nix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221201830,"owners_count":16775420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ids","network-monitoring","nix","zeek","zeek-ids","zeek-package"],"created_at":"2024-07-29T18:24:58.456Z","updated_at":"2024-10-23T13:31:14.473Z","avatar_url":"https://github.com/hardenedlinux.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: Zeek to Nix Flake's feature\n\n* Building Zeek with nix-shell(shell mode)\n#+begin_src sh :async t :exports both :results output\nnix develop\n# or\nnix-shell\n#+end_src\n\n* Library\n\n** Building zeek with plugins\n\n#+begin_src nix :async :exports both :results output\nmkZeekPlugins = inputs.zeek2nix.lib.zeekWithPlugins {\n  package = inputs.zeek2nix.packages.${system}.zeek-latest;\n  plugins = [\n    {\n      src = inputs.zeek2nix.lib.nixpkgs.zeek-sources.zeek-community-id;\n    }\n  ];\n  };\n#+end_src\n\n** Testing your Zeek Plugin src with Nix-CI\n\n#+begin_src nix :async :exports both :results output\nmkZeekPluginCI = nixpkgs.zeekPluginCi {\n    plugins = [\n      {\n        src = inputs.zeek2nix.lib.nixpkgs.zeek-sources.zeek-netmap;\n      }\n    ];\n    buildInputs = [inputs.zeek2nix.lib.nixpkgs.netmap];\n  };\n#+end_src\n\n* Deploying Zeek with NixOS (flakes feature)\n#+begin_src nix :async t :exports both :results output\n{\n  inputs =\n    {\n      zeek-nix = {\n        url = \"github:hardenedlinux/zeek-nix/main\";\n        inputs.nixpkgs.follows = \"nixos\";\n      };\n      \"...\"\n        };\n        outputs = { self, zeek-nix, nixpkgs, ... }: {\n        nixosConfigurations.myConfig = nixpkgs.lib.nixosSystem {\n          system = \"...\";\n\n          modules = [\n            zeek-nix.nixosModules.zeek\n            ({ ... }: {\n              services.zeek = {\n                enable = true;\n                standalone = true;\n                interface = \"eno1\";\n                listenAddress = \"localhost\";\n                package = pkgs.zeekWithPlugins {\n                  package = pkgs.zeek-latest;\n                  plugins = [\n                    {\n                      src = pkgs.zeek-sources.zeek-community-id;\n                    }\n                  ];\n                };\n\n                privateScript = ''\n                  @load /home/gtrun/project/hardenedlinux-zeek-script/scripts/zeek-query.zeek\n                  @load /home/gtrun/project/hardenedlinux-zeek-script/scripts/log-passwords.zeek\n                '';\n              };\n            })\n          ];\n        };\n      };\n    }\n#+end_src\n\n\n* creating the zeek dynamic dir to ~/var/lib/zeek~\n:BACKLINKS:\n[2020-10-09 Fri 19:35] \u003c- [[*Build Zeek with nix-build -\u003e result/bin/zeek (Current version)][Build Zeek with nix-build -\u003e result/bin/zeek (Current version)]]\n:END:\n#+begin_src sh :async t :exports both :results output\nsudo bash ./pre-run-zeekctl.sh\n#+end_src\n\n\n\n* Optional: using cachix to speed up binary build\n#+begin_src sh :async t :exports both :results output\nnix-env -iA cachix -f https://cachix.org/api/v1/install\ncachix use zeek\n#+end_src\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardenedlinux%2Fzeek2nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhardenedlinux%2Fzeek2nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardenedlinux%2Fzeek2nix/lists"}