Nix code refactor to support standard Nix and best practices
Dependencies
- [2]
NACNZRJExxHash in oldshell.nix - [3]
V3G26FEWConflict resolution (flakes) - [4]
YN63NUZOSanakirja 1.0 - [5]
ZWPPIJXFflake.nix: use Mozilla overlay for Rust - [6]
JEQCEOQDAdding a non-flake shell.nix - [7]
X243Z3Y5Recording only the required metadata (can even be changed later!) - [8]
HYENMEQWAdd nix aarch64-darwin support for Apple Silicon macs - [9]
VKBJ6XB6Formatting and version bump - [10]
Q4XPH27Loverride dev tooling - [11]
OP6UAT25Fix build for darwin by providing the needed additional dependencies - [12]
SH2ZBSAZFix typo in flake.nix defaultPackage - [13]
QAXLX3UABackwards-compatibility: moving old paths to the new "roots" feature - [14]
BFQYATIRAdd nix aarch64-darwin support for Apple Silicon macs - [15]
WZYPQBYNflake: use crate2nix from Nixpkgs - [16]
2B7KNPCMflake.nix uses zstd 1.49 - [17]
STG7MO5MVersion bump - [18]
PNJL5TPZVersion bump - [19]
LAFA7YMQswitch to oxalica/rust-overlay - [20]
MUYNSHG2update Nix build for Rust 2021 edition requirement - [21]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [22]
POBHKKNGUse 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. - [23]
ND62U46TGet nix base builds working again - [24]
QHVMHSGYoldshell.nix: use version 1.4.9 of ZStd because of major performance issues in 1.5 - [25]
RNNJ4ORVshell uses the flake - [26]
JVBQMAFUSolving a conflict - [27]
O2CDACIISolving a conflict - [28]
G734WNM6flake.nix: use crate2nix - [29]
2RUJ4J7MBump flake.nix & flake.lock - [30]
VN6L65VRflake.nix: remove unnecessary build inputs - [31]
XXYMJ6PMupdate Rust for CVE-2022-21658 - [*]
ENWJBQGQFixing a deprecation warning in ed25519_dalek.
Change contents
- replacement in shell.nix at line 1
(import(let lock = builtins.fromJSON (builtins.readFile ./flake.lock); infetchTarball {url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";sha256 = lock.nodes.flake-compat.locked.narHash;}){ src = ./.; }).shellNix[4.12](import ./release.nix).pijulGitDevShell - file addition: release.nix[33.2]
letflakeLock = builtins.fromJSON (builtins.readFile ./flake.lock);pkgsSrc = fetchTarball {url =flakeLock.nodes.nixpkgs.locked.urlor "https://github.com/NixOS/nixpkgs/archive/${flakeLock.nodes.nixpkgs.locked.rev}.tar.gz";sha256 = flakeLock.nodes.nixpkgs.locked.narHash;};pkgs = import pkgsSrc {overlays = [(import ./nix/overlays/default.nix)(import ./nix/overlays/devshells.nix)];};in{inherit (pkgs) pijul pijul-git pijulGitDevShell;} - replacement in oldshell.nix at line 1
with import <nixpkgs> {};with import <nixpkgs> { }; - replacement in oldshell.nix at line 5[4.104]→[4.104:133](∅→∅),[4.133]→[4.212:221](∅→∅),[4.221]→[4.142:168](∅→∅),[4.806]→[4.142:168](∅→∅),[4.142]→[4.142:168](∅→∅),[4.168]→[4.115:130](∅→∅),[4.130]→[4.182:195](∅→∅),[4.182]→[4.182:195](∅→∅),[4.195]→[2.0:11](∅→∅),[2.11]→[4.195:341](∅→∅),[4.195]→[4.195:341](∅→∅)
buildInputs = with pkgs; [zstdlibsodiumopensslpkg-configlibiconvxxHash] ++ lib.optionals stdenv.isDarwin(with darwin.apple_sdk.frameworks; [CoreServicesSecuritySystemConfiguration]);buildInputs =with pkgs;[zstdlibsodiumopensslpkg-configlibiconvxxHash]++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks;[CoreServicesSecuritySystemConfiguration]); - file addition: nix[33.2]
- file addition: package.nix[0.925]
{stdenv,lib,darwin,rustPlatform,cargo,libiconv,pkg-config,rustc,openssl,libsodium,...}:letcargoMeta = builtins.fromTOML (builtins.readFile ../pijul/Cargo.toml);inherit (rustPlatform) cargoBuildHook cargoInstallHook cargoSetupHook;instdenv.mkDerivation {pname = cargoMeta.package.name;version = cargoMeta.package.version;src =letfs = lib.fileset;infs.toSource {root = ../.;fileset = fs.unions [../Cargo.toml../Cargo.lock../pijul-macros../pijul../libpijul../pijul-interaction../pijul-config../pijul-repository../pijul-identity../pijul-remote];};buildAndTestSubdir = "pijul";doCheck = true;cargoBuildType = "release";cargoDeps = rustPlatform.importCargoLock { lockFile = ../Cargo.lock; };nativeBuildInputs = [cargolibiconvpkg-configrustc];buildInputs = [libsodiumopenssl.devcargoBuildHookcargoInstallHookcargoSetupHook] ++ lib.optionals (stdenv.isDarwin) [ darwin.apple_sdk.frameworks.SystemConfiguration ];} - file addition: overlays[0.925]
- file addition: devshells.nix[0.2157]
final: prev: {pijulGitDevShell = (final.mkShell.override { stdenv = final.clangStdenv; }) {name = "pijul";inputsFrom = [ final.pijul-git ];packages = with final; [rust-analyzerrustfmt];LIBCLANG_PATH = "${final.llvmPackages.libclang}/lib";};} - file addition: default.nix[0.2157]
final: prev: {pijul = final.callPackage ../package.nix { stdenv = final.clangStdenv; };pijul-git = final.pijul.overrideAttrs (oldAttrs: { cargoBuildFeatures = oldAttrs.cargoBuildFeatures or [ ] ++ [ "git" ]; });} - edit in flake.nix at line 6
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; - replacement in flake.nix at line 9
{ self, nixpkgs, ...}:{ self, nixpkgs, ... }: - replacement in flake.nix at line 11[4.1023931]→[4.1023931:1024079](∅→∅),[4.1024799]→[4.1024799:1024800](∅→∅),[4.1024800]→[4.546:623](∅→∅)
nameValuePair = name: value: { inherit name value; };genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);LIBCLANG_PATH = "${pkgs.llvmPackages.libclang}/lib";}# there is also nixpkgs.lib.systems.flakeExposedallSystems = ["x86_64-linux""aarch64-linux""i686-linux""x86_64-darwin""aarch64-darwin"];withPkgs =pkgsCallback:nixpkgs.lib.genAttrs allSystems (system:letpkgs = import nixpkgs {inherit system;overlays = [(import ./nix/overlays/default.nix)(import ./nix/overlays/devshells.nix)];};inpkgsCallback { inherit pkgs system; } - replacement in flake.nix at line 34[4.634]→[4.1024849:1024850](∅→∅),[4.246298]→[4.1024849:1024850](∅→∅),[4.1024849]→[4.1024849:1024850](∅→∅),[4.1024850]→[4.635:714](∅→∅),[4.20]→[4.246504:246505](∅→∅),[4.714]→[4.246504:246505](∅→∅),[4.246504]→[4.246504:246505](∅→∅),[4.246505]→[4.715:1000](∅→∅),[4.1000]→[4.1025043:1025044](∅→∅),[4.246551]→[4.1025043:1025044](∅→∅),[4.1025043]→[4.1025043:1025044](∅→∅),[4.1025044]→[4.1001:1115](∅→∅),[4.1115]→[4.1025119:1025120](∅→∅),[4.1025119]→[4.1025119:1025120](∅→∅),[4.166]→[4.166:167](∅→∅),[4.167]→[4.1314:1483](∅→∅)
packages = forAllSystems(pkgs: rec {default = pijul;pijul = pkgs.clangStdenv.mkDerivation (self: {pname = cargoMeta.package.name;version = cargoMeta.package.version;src = ./.;buildAndTestSubdir = "pijul";doCheck = true;cargoBuildType = "release";cargoDeps = pkgs.rustPlatform.importCargoLock {lockFile = ./Cargo.lock;};buildInputs = builtins.attrValues ({inherit (pkgs)libsodiumopenssl;in{overlays = {default = import ./nix/overlay.nix { };devShells = import ./nix/devshells-overlay.nix { };};devShells = withPkgs ({ pkgs, ... }:{default = pkgs.pijulGitDevShell;}); - replacement in flake.nix at line 47[4.1025491]→[4.1484:1881](∅→∅),[4.1881]→[4.1026112:1026126](∅→∅),[4.247587]→[4.1026112:1026126](∅→∅),[4.1026112]→[4.1026112:1026126](∅→∅)
inherit (pkgs.rustPlatform)cargoBuildHookcargoInstallHookcargoSetupHook;}// nixpkgs.lib.optionalAttrs (pkgs.stdenv.isDarwin) {inherit (pkgs.darwin.apple_sdk.frameworks)SystemConfiguration;});});formatter = withPkgs ({ pkgs, ... }: pkgs.nixfmt-rfc-style); - replacement in flake.nix at line 49
pijul-git = pijul.overrideAttrs (self: {cargoBuildFeatures = [ "git" ];});});packages = withPkgs ({ pkgs, ... }:{inherit (pkgs) pijul pijul-git;default = self.packages.${pkgs.system}.pijul;}); - edit in flake.nix at line 58[4.1026223]→[3.0:0](∅→∅),[4.1025120]→[4.1116:1313](∅→∅),[4.1313]→[4.1200:1215](∅→∅),[4.1200]→[4.1200:1215](∅→∅),[4.101]→[4.68:159](∅→∅),[4.1024163]→[4.68:159](∅→∅),[4.159]→[4.0:101](∅→∅),[4.101]→[4.160:236](∅→∅),[4.1024164]→[4.160:236](∅→∅),[4.216]→[4.165:174](∅→∅),[4.236]→[4.165:174](∅→∅),[4.165]→[4.165:174](∅→∅),[4.174]→[4.237:545](∅→∅),[4.545]→[4.591:606](∅→∅),[4.591]→[4.591:606](∅→∅)
nativeBuildInputs = builtins.attrValues {inherit (pkgs)cargolibiconvpkg-configrustc;};forAllSystems = f: genAttrs allSystems (system: f nixpkgs.legacyPackages.${system});allSystems = [ "x86_64-linux" "aarch64-linux" "i686-linux" "x86_64-darwin" "aarch64-darwin" ];cargoMeta = builtins.fromTOML (builtins.readFile ./pijul/Cargo.toml);in {devShell = forAllSystems(pkgs:(pkgs.mkShell.override { stdenv = pkgs.clangStdenv; }){name = "pijul";inputsFrom = [ self.packages.${pkgs.system}.pijul-git ];packages = with pkgs; [rust-analyzerrustfmt]; - resolve order conflict in flake.nix at line 58[4.1026223]
- edit in flake.lock at line 3
"flake-compat": {"locked": {"lastModified": 1696426674,"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=","rev": "0f9255e01c2351cc7d116c072cb317785dd33b33","revCount": 57,"type": "tarball","url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"},"original": {"type": "tarball","url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"}}, - edit in flake.lock at line 21
"flake-compat": "flake-compat", - replacement in default.nix at line 3
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); inletlock = builtins.fromJSON (builtins.readFile ./flake.lock);in - replacement in default.nix at line 7
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";url =lock.nodes.flake-compat.locked.urlor "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";