From 06f389595b5a472a55021c77aeb05c6c68f42f3a Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Thu, 26 Jun 2025 18:37:58 +0200 Subject: [PATCH] chores: update nix to 2.28.3 and NixOS to 25.05 --- Cargo.lock | 27 +++++++++++++++++++++++++++ Cargo.toml | 1 + src/image_builder.rs | 12 ++++++++---- src/nixos.rs | 2 +- 4 files changed, 37 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82fc3ad..aa78bfe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -208,6 +208,26 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -324,6 +344,7 @@ dependencies = [ "base64", "clap", "console", + "const_format", "csv", "dirs", "env_logger", @@ -1220,6 +1241,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "untrusted" version = "0.9.0" diff --git a/Cargo.toml b/Cargo.toml index 23ed8e9..c7f5a66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ anyhow = "1.0.93" base64 = "0.22.1" clap = { version = "4.5.21", features = ["derive", "env"] } console = "0.15.10" +const_format = "0.2.34" csv = "1.3.1" dirs = "5.0" env_logger = "0.11.5" diff --git a/src/image_builder.rs b/src/image_builder.rs index 4a6b047..c1688fb 100644 --- a/src/image_builder.rs +++ b/src/image_builder.rs @@ -8,6 +8,7 @@ use std::{ }; use anyhow::{bail, Context, Result}; +use const_format::formatcp; use indicatif::{ProgressBar, ProgressStyle}; use liblzma::read::XzDecoder; use regex::Regex; @@ -25,13 +26,16 @@ use tempfile::tempdir; use crate::nixos; use crate::shell::*; -const NIX_VERSION: &str = "2.24.12"; +const NIX_VERSION: &str = "2.28.3"; -const NIX_CONF: &str = "experimental-features = nix-command flakes -extra-nix-path = nixpkgs=github:nixos/nixpkgs/nixos-24.11 +const NIX_CONF: &str = formatcp!( + "experimental-features = nix-command flakes +extra-nix-path = nixpkgs=github:nixos/nixpkgs/nixos-{} build-users-group = sandbox = false -"; +", + nixos::NIXOS_VERSION +); static BASE_SHA256: &str = "/nix/.base.sha256"; static BASE_PATHS: &str = "/nix/.base.paths"; diff --git a/src/nixos.rs b/src/nixos.rs index e1a487e..ce1e5a3 100644 --- a/src/nixos.rs +++ b/src/nixos.rs @@ -8,7 +8,7 @@ use std::{ use anyhow::{bail, Context, Result}; use regex::Regex; -const NIXOS_VERSION: &str = "24.11"; +pub(crate) const NIXOS_VERSION: &str = "25.05"; pub(crate) const ENV_VARS: [(&str, &str); 4] = [ ("PATH", "/nix/.bin"),