From db1b08532e896f1ddb78699763a6903e6b7acfa5 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Mon, 30 Mar 2026 21:00:15 -0400 Subject: [PATCH] chore: reorganize nix files --- flake.nix | 1 - nix/{checks/default.nix => checks.nix} | 12 +++++------- nix/default.nix | 9 ++++----- nix/{shells/default.nix => devshell.nix} | 0 nix/hydra.nix | 9 --------- nix/packages/default.nix | 8 +++++--- nix/packages/{rocksdb/package.nix => rocksdb.nix} | 0 nix/packages/rocksdb/default.nix | 12 ------------ nix/{packages => }/rust.nix | 0 nix/{tests/default.nix => tests.nix} | 0 10 files changed, 14 insertions(+), 37 deletions(-) rename nix/{checks/default.nix => checks.nix} (91%) rename nix/{shells/default.nix => devshell.nix} (100%) delete mode 100644 nix/hydra.nix rename nix/packages/{rocksdb/package.nix => rocksdb.nix} (100%) delete mode 100644 nix/packages/rocksdb/default.nix rename nix/{packages => }/rust.nix (100%) rename nix/{tests/default.nix => tests.nix} (100%) diff --git a/flake.nix b/flake.nix index a4d1886fc..c966cfe28 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,6 @@ url = "github:edolstra/flake-compat?ref=master"; flake = false; }; - }; outputs = diff --git a/nix/checks/default.nix b/nix/checks.nix similarity index 91% rename from nix/checks/default.nix rename to nix/checks.nix index 000c68682..4533f20a2 100644 --- a/nix/checks/default.nix +++ b/nix/checks.nix @@ -10,15 +10,13 @@ let uwulib = inputs.self.uwulib.init pkgs; - rocksdbAllFeatures = self'.packages.rocksdb.override { - enableJemalloc = true; - }; + rocksdb = self'.packages.rocksdb; commonAttrs = (uwulib.build.commonAttrs { }) // { buildInputs = [ pkgs.liburing pkgs.rust-jemalloc-sys-unprefixed - rocksdbAllFeatures + rocksdb ]; nativeBuildInputs = [ pkgs.pkg-config @@ -32,13 +30,13 @@ LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.liburing pkgs.rust-jemalloc-sys-unprefixed - rocksdbAllFeatures + rocksdb ]; } // uwulib.environment.buildPackageEnv // { - ROCKSDB_INCLUDE_DIR = "${rocksdbAllFeatures}/include"; - ROCKSDB_LIB_DIR = "${rocksdbAllFeatures}/lib"; + ROCKSDB_INCLUDE_DIR = "${rocksdb}/include"; + ROCKSDB_LIB_DIR = "${rocksdb}/lib"; }; }; cargoArtifacts = self'.packages.continuwuity-all-features-deps; diff --git a/nix/default.nix b/nix/default.nix index d20a3e020..718af6210 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,11 +1,10 @@ { imports = [ - ./checks ./packages - ./shells - ./tests - - ./hydra.nix + ./checks.nix + ./devshell.nix + ./tests.nix ./fmt.nix + ./rust.nix ]; } diff --git a/nix/shells/default.nix b/nix/devshell.nix similarity index 100% rename from nix/shells/default.nix rename to nix/devshell.nix diff --git a/nix/hydra.nix b/nix/hydra.nix deleted file mode 100644 index f3f4ec6ca..000000000 --- a/nix/hydra.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ inputs, ... }: -let - lib = inputs.nixpkgs.lib; -in -{ - flake.hydraJobs.packages = builtins.mapAttrs ( - _name: lib.hydraJob - ) inputs.self.packages.x86_64-linux; -} diff --git a/nix/packages/default.nix b/nix/packages/default.nix index cb220d88e..b6eb9e721 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -1,14 +1,16 @@ { imports = [ ./continuwuity - ./rocksdb ./rust.nix ./uwulib ]; perSystem = - { self', ... }: + { self', pkgs, ... }: { - packages.default = self'.packages.continuwuity-default-bin; + packages = { + default = self'.packages.continuwuity-default-bin; + rocksdb = pkgs.callPackage ./rocksdb.nix { }; + }; }; } diff --git a/nix/packages/rocksdb/package.nix b/nix/packages/rocksdb.nix similarity index 100% rename from nix/packages/rocksdb/package.nix rename to nix/packages/rocksdb.nix diff --git a/nix/packages/rocksdb/default.nix b/nix/packages/rocksdb/default.nix deleted file mode 100644 index 6358940ad..000000000 --- a/nix/packages/rocksdb/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - perSystem = - { - pkgs, - ... - }: - { - packages = { - rocksdb = pkgs.callPackage ./package.nix { }; - }; - }; -} diff --git a/nix/packages/rust.nix b/nix/rust.nix similarity index 100% rename from nix/packages/rust.nix rename to nix/rust.nix diff --git a/nix/tests/default.nix b/nix/tests.nix similarity index 100% rename from nix/tests/default.nix rename to nix/tests.nix