Closed SCOTT-HAMILTON closed 2 years ago
I thought it was just a matter of adding system.stateVersion = "22.05"
to the nixos container config, but apparently it's something else:
$ sudo extra-container create --start <<'EOF'
{
containers.demo = {
privateNetwork = true;
hostAddress = "10.250.0.1";
localAddress = "10.250.0.2";
config = { pkgs, ... }: {
systemd.services.hello = {
wantedBy = [ "multi-user.target" ];
script = ''
while true; do
echo hello | ${pkgs.netcat}/bin/nc -lN 50
done
'';
};
networking.firewall.allowedTCPPorts = [ 50 ];
system.stateVersion = "22.05"; # ADDED THIS LINE
};
};
}
EOF
Building containers...
error: attribute 'stateVersion' missing
at /etc/current-nixpkgs/nixos/modules/virtualisation/nixos-containers.nix:7:56:
6|
7| configurationPrefix = optionalString (versionAtLeast config.system.stateVersion "22.05") "nixos-";
| ^
8| configurationDirectoryName = "${configurationPrefix}containers";
(use '--show-trace' to show detailed location information)
Looks like something broke between nixos-21.11 and nixos-22.05. Bisecting...
This is a known bug, I'll fix this soon!
This is a known bug, I'll fix this soon!
Thanks!
(For some reason I got false results from git bisect, but manually bisected to https://github.com/nixos/nixpkgs/commit/f535d6f45ef9556d392de76c2dd1c26b436c4ea8.)
Thanks!
When running the demo command from the README with extra-container 0.9 installed with https://github.com/erikarvstedt/extra-container#nixos-stable-without-flake-support
I get this error:
"x86_64-linux"
Linux 5.15.46, NixOS, 22.05 (Quokka), 22.05.926.8b538fcb329
yes
yes
nix-env (Nix) 2.8.1
"home-manager-22.05.tar.gz, nixos-22.05, nixos-unstable, nixpkgs-22.05, nixpkgs-unstable"
"home-manager-20.09, nixos-20.09.4407.1c1f5649bb9, nixos-unstable-21.11pre332033.715f6341195, nixpkgs-20.09.4407.1c1f5649bb9, nixpkgs-unstable-21.11pre332842.8afc4e54366"
"home-manager-22.05.tar.gz, nixgl, nixos-22.05, nixos-unstable, nixpkgs-22.05, nixpkgs-unstable, rust-overlay, shamilton"
/home/scott/.nix-defexpr/channels/nixpkgs