Move package definition out of flake.nix

dblsaiko
Mar 30, 2024, 11:51 PM
7GVHKOLT4RH2LXZKIYWU2MCFMQEF5BGPE7VIMADDXFALWIL6RKLQC

Dependencies

  • [2] O2CDACII Solving a conflict
  • [3] VN6L65VR flake.nix: remove unnecessary build inputs
  • [4] OP6UAT25 Fix build for darwin by providing the needed additional dependencies
  • [5] G734WNM6 flake.nix: use crate2nix
  • [6] ZWPPIJXF flake.nix: use Mozilla overlay for Rust
  • [7] MUYNSHG2 update Nix build for Rust 2021 edition requirement
  • [8] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [9] SH2ZBSAZ Fix typo in flake.nix defaultPackage
  • [10] LAFA7YMQ switch to oxalica/rust-overlay
  • [11] Q4XPH27L override dev tooling
  • [12] POBHKKNG Use nixpkgs builtin Rust build tools This fixes the broken flake packages and prevents having to manually update any sort of Nix-specific lock file, which should make it less prone to breaking in the future.
  • [*] ENWJBQGQ Fixing a deprecation warning in ed25519_dalek.

Change contents

  • file addition: package.nix (----------)
    [14.2]
    {
    lib,
    clangStdenv,
    cargo,
    darwin,
    libiconv,
    libsodium,
    openssl,
    pkg-config,
    rustPlatform,
    rustc,
    }: let
    cargoMeta = builtins.fromTOML (builtins.readFile ./pijul/Cargo.toml);
    in
    clangStdenv.mkDerivation (self: {
    pname = cargoMeta.package.name;
    version = cargoMeta.package.version;
    src = ./.;
    buildAndTestSubdir = "pijul";
    doCheck = true;
    cargoBuildType = "release";
    cargoDeps = rustPlatform.importCargoLock {
    lockFile = ./Cargo.lock;
    };
    nativeBuildInputs = [
    cargo
    libiconv
    pkg-config
    rustc
    ];
    buildInputs =
    [
    libsodium
    openssl
    rustPlatform.cargoBuildHook
    rustPlatform.cargoInstallHook
    rustPlatform.cargoSetupHook
    ]
    ++ lib.optionals clangStdenv.isDarwin [
    darwin.apple_sdk.frameworks.SystemConfiguration
    ];
    })
  • edit in flake.nix at line 19
    [2.101][3.160:236](),[3.1024164][3.160:236]()
    cargoMeta = builtins.fromTOML (builtins.readFile ./pijul/Cargo.toml);
  • edit in flake.nix at line 41
    [3.20][3.246504:246505](),[3.714][3.246504:246505](),[3.246504][3.246504:246505](),[3.246505][3.715:931]()
    pijul = pkgs.clangStdenv.mkDerivation (self: {
    pname = cargoMeta.package.name;
    version = cargoMeta.package.version;
    src = ./.;
    buildAndTestSubdir = "pijul";
  • replacement in flake.nix at line 42
    [3.932][3.932:1000]()
    doCheck = true;
    cargoBuildType = "release";
    [3.932]
    [3.1025043]
    pijul = pkgs.callPackage ./package.nix {};
  • edit in flake.nix at line 44
    [3.1025044][3.1001:1115](),[3.1115][3.1025119:1025120](),[3.1025119][3.1025119:1025120](),[3.1025120][3.1116:1313](),[3.1313][3.1200:1215](),[3.1200][3.1200:1215](),[3.166][3.166:167](),[3.167][3.1314:1483](),[3.1483][3.1025490:1025491](),[3.246947][3.1025490:1025491](),[3.1025490][3.1025490:1025491](),[3.1025491][3.1484:1881](),[3.1881][3.1026112:1026127](),[3.247587][3.1026112:1026127](),[3.1026112][3.1026112:1026127]()
    cargoDeps = pkgs.rustPlatform.importCargoLock {
    lockFile = ./Cargo.lock;
    };
    nativeBuildInputs = builtins.attrValues {
    inherit (pkgs)
    cargo
    libiconv
    pkg-config
    rustc
    ;
    };
    buildInputs = builtins.attrValues (
    {
    inherit (pkgs)
    libsodium
    openssl
    ;
    inherit (pkgs.rustPlatform)
    cargoBuildHook
    cargoInstallHook
    cargoSetupHook
    ;
    }
    // nixpkgs.lib.optionalAttrs (pkgs.stdenv.isDarwin) {
    inherit (pkgs.darwin.apple_sdk.frameworks)
    SystemConfiguration
    ;
    }
    );
    });