diff --git a/src/image_builder.rs b/src/image_builder.rs index e2dd2ac..4a6b047 100644 --- a/src/image_builder.rs +++ b/src/image_builder.rs @@ -25,10 +25,10 @@ use tempfile::tempdir; use crate::nixos; use crate::shell::*; -const NIX_VERSION: &str = "2.25.2"; +const NIX_VERSION: &str = "2.24.12"; const NIX_CONF: &str = "experimental-features = nix-command flakes -extra-nix-path = nixpkgs=flake:nixpkgs +extra-nix-path = nixpkgs=github:nixos/nixpkgs/nixos-24.11 build-users-group = sandbox = false "; diff --git a/src/nixos.rs b/src/nixos.rs index 8a96d86..e1a487e 100644 --- a/src/nixos.rs +++ b/src/nixos.rs @@ -8,6 +8,8 @@ use std::{ use anyhow::{bail, Context, Result}; use regex::Regex; +const NIXOS_VERSION: &str = "24.11"; + pub(crate) const ENV_VARS: [(&str, &str); 4] = [ ("PATH", "/nix/.bin"), ("NIX_CONF_DIR", "/nix/etc"), @@ -76,6 +78,7 @@ pub fn build_flake_from_package_list( match &caps[1] { "name" => name, "description" => description, + "version" => NIXOS_VERSION, "packages" => &package_list, _ => "", } diff --git a/src/templates/flake.nix b/src/templates/flake.nix index a056bf8..5511fc7 100644 --- a/src/templates/flake.nix +++ b/src/templates/flake.nix @@ -1,7 +1,7 @@ { description = "{{ description }}"; inputs = { - nixpkgs.url = "flake:nixpkgs"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-{{ version }}"; flake-utils.url = "github:numtide/flake-utils"; };