diff --git a/derivation.nix b/derivation.nix new file mode 100644 index 0000000..804af68 --- /dev/null +++ b/derivation.nix @@ -0,0 +1,11 @@ +{ lib, pkgs, cargoToml, ... }: +let + manifest = (lib.importTOML cargoToml).package; +in +pkgs.rustPlatform.buildRustPackage { + pname = manifest.name; + version = manifest.version; + cargoLock.lockFile = ./Cargo.lock; + src = lib.cleanSource ./.; + cargoBuildFlags = "-p ${manifest.name}"; +} diff --git a/flake.lock b/flake.lock index 0963024..f5c5d07 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1698646935, - "narHash": "sha256-FgHpELKq1AxZRkL3BzLgfCBMJ4kxAjHCuPwj/uh83d0=", + "lastModified": 1711952616, + "narHash": "sha256-WJvDdOph001fA1Ap3AyaQtz/afJAe7meSG5uJAdSE+A=", "owner": "nix-community", "repo": "fenix", - "rev": "53f0f31a978f1e056763d6d465b0f44af2454a7b", + "rev": "209048d7c545905c470f6f8c05c5061f391031a8", "type": "github" }, "original": { @@ -43,11 +43,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1698434055, - "narHash": "sha256-Phxi5mUKSoL7A0IYUiYtkI9e8NcGaaV5PJEaJApU1Ko=", + "lastModified": 1704290814, + "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1a3c95e3b23b3cdb26750621c08cc2f1560cb883", + "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", "type": "github" }, "original": { @@ -67,11 +67,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1698474035, - "narHash": "sha256-IaufRsz2ATI7vSnnqQxMlcREPFpBDyQqqPFvKp+FjMA=", + "lastModified": 1711885694, + "narHash": "sha256-dyezzeSbWMpflma+E9USmvSxuLgGcNGcGw3cOnX36ko=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "f493207744da98b31295b02e6ed95b26a927056c", + "rev": "e4a405f877efd820bef9c0e77a02494e47c17512", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d79faa3..51ac8cc 100644 --- a/flake.nix +++ b/flake.nix @@ -22,25 +22,16 @@ latest.rustc ]; - migration-package = pkgs.callPackage ./pkgs/migration.nix { - buildPackage = (naersk.lib.${system}.override { - cargo = toolchain; - rustc = toolchain; - }).buildPackage; + migration-package = pkgs.callPackage ./derivation.nix { + cargoToml = ./lib/migration/Cargo.toml; }; - chef = pkgs.callPackage ./pkgs/chef.nix { - buildPackage = (naersk.lib.${system}.override { - cargo = toolchain; - rustc = toolchain; - }).buildPackage; + chef = pkgs.callPackage ./derivation.nix { + cargoToml = ./bin/chef/Cargo.toml; }; - maid = pkgs.callPackage ./pkgs/maid.nix { - buildPackage = (naersk.lib.${system}.override { - cargo = toolchain; - rustc = toolchain; - }).buildPackage; + maid = pkgs.callPackage ./derivation.nix { + cargoToml = ./bin/maid/Cargo.toml; }; in { diff --git a/lib/migration/src/m20231010_000001_create_table.rs b/lib/migration/src/m20231010_000001_create_table.rs index f3f2cf1..c24dd4a 100644 --- a/lib/migration/src/m20231010_000001_create_table.rs +++ b/lib/migration/src/m20231010_000001_create_table.rs @@ -88,7 +88,7 @@ impl MigrationTrait for Migration { id uuid not null primary key references record(id), content text not null ); - + -- TODO: -- create index zone_name_index on zone(name); -- create index record_name_index on record(name); diff --git a/pkgs/chef.nix b/pkgs/chef.nix index ae005fc..9248c32 100644 --- a/pkgs/chef.nix +++ b/pkgs/chef.nix @@ -12,6 +12,6 @@ buildPackage { meta = { description = ""; - homepage = "https://github.com/dresden-zone/dns"; + homepage = "https://github.com/dresden-zone/rabauken"; }; } diff --git a/pkgs/maid.nix b/pkgs/maid.nix deleted file mode 100644 index a1fe4e6..0000000 --- a/pkgs/maid.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ buildPackage, lib, pkg-config, openssl }: -buildPackage { - pname = "maid"; - version = "0.1.0"; - - src = ../.; - cargoBuildOptions = (x: x ++ [ "-p maid" ]); - cargoSha256 = lib.fakeSha256; - - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ ]; - - meta = { - description = ""; - homepage = "https://github.com/dresden-zone/dns"; - }; -}