diff --git a/flake.nix b/flake.nix index 33d556c..8db8076 100644 --- a/flake.nix +++ b/flake.nix @@ -97,15 +97,10 @@ # Garbage collection root # ########################### - packages.${system} = - let - localPkgs = import ./pkgs { inherit pkgs; }; - in - { - default = vm.config.system.build.vm; - crowdsec-hub = localPkgs.crowdsec.hub; - crowdsec-firewall-bouncer = localPkgs.crowdsec.firewall-bouncer; - }; + packages.${system} = { + default = vm.config.system.build.vm; + } + // import ./pkgs { inherit pkgs; }; ################### # Utility scripts # diff --git a/pkgs/crowdsec/_sources/generated.json b/pkgs/_sources/generated.json similarity index 100% rename from pkgs/crowdsec/_sources/generated.json rename to pkgs/_sources/generated.json diff --git a/pkgs/crowdsec/_sources/generated.nix b/pkgs/_sources/generated.nix similarity index 100% rename from pkgs/crowdsec/_sources/generated.nix rename to pkgs/_sources/generated.nix diff --git a/pkgs/crowdsec/default.nix b/pkgs/crowdsec/default.nix deleted file mode 100644 index 66faac3..0000000 --- a/pkgs/crowdsec/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs }: -let - sources = pkgs.callPackage ./_sources/generated.nix { }; - callPackage = pkgs.lib.callPackageWith (pkgs // { inherit sources; }); -in -{ - hub = callPackage ./hub.nix { }; - firewall-bouncer = callPackage ./firewall-bouncer.nix { }; -} diff --git a/pkgs/default.nix b/pkgs/default.nix index 40383f6..f3a72f5 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,7 @@ { pkgs }: -{ - crowdsec = import ./crowdsec { inherit pkgs; }; +pkgs.lib.packagesFromDirectoryRecursive { + callPackage = pkgs.lib.callPackageWith ( + pkgs // { sources = pkgs.callPackage ./_sources/generated.nix { }; } + ); + directory = ./packages; } diff --git a/pkgs/crowdsec/nvfetcher.toml b/pkgs/nvfetcher.toml similarity index 100% rename from pkgs/crowdsec/nvfetcher.toml rename to pkgs/nvfetcher.toml diff --git a/pkgs/crowdsec/firewall-bouncer.nix b/pkgs/packages/crowdsec-firewall-bouncer.nix similarity index 100% rename from pkgs/crowdsec/firewall-bouncer.nix rename to pkgs/packages/crowdsec-firewall-bouncer.nix diff --git a/pkgs/crowdsec/hub.nix b/pkgs/packages/crowdsec-hub.nix similarity index 100% rename from pkgs/crowdsec/hub.nix rename to pkgs/packages/crowdsec-hub.nix