From ff6d685126415da4e3b2ea243969936b746ad73b Mon Sep 17 00:00:00 2001 From: rzuasti Date: Sat, 24 Jan 2026 12:16:24 -0500 Subject: [PATCH] Adding Nix flake support --- flake.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2b77e52 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "OOTT - An easy to setup and use network device monitoring service"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + }; + + outputs = { + self, + nixpkgs, + }: let + # System types to support. + supportedSystems = ["x86_64-linux"]; + + # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + + # Nixpkgs instantiated for supported system types. + nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); + + version = "0.0.1"; + pname = "oott"; + in { + packages = forAllSystems (system: let + pkgs = nixpkgsFor.${system}; + in { + ${pname} = pkgs.rustPlatform.buildRustPackage rec { + inherit pname; + inherit version; + src = ./.; + cargoLock = ./Cargo.lock; + }; + }); + }; +}