hi all,
I followed Proxmox Virtual Environment - NixOS Wiki to build a custom tarball LXC image. I used the boilerplate configuration.nix on that page and upon updating channels, rebooting, and switching, I get these errors
Failed to start transient service unit: Access denied
stat: cannot read file system information for '/boot': No such file or directory
WARNING: /boot being on a different filesystem not supported by init-script-builder.sh
'/nix/store/6544q8n5bj89vsschrfg8dnd0k7lhmkr-system-path/bin/busctl --json=short call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager ListUnitsByPatterns asas 0 0' exited with value 1 at /nix/store/577xpzvwiiim58n841vzccslzy6qrgga-nixos-system-unnamed-24.11pre646099.00d80d13810d/bin/switch-to-configuration line 145. warning: error(s) occurred while switching to the new configuration
Sometimes, the error about /boot isn’t thrown, and it just fails to start the “transient service unit”
trace: warning: system.stateVersion is not set, defaulting to 24.11. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion. Failed to start transient service unit: Access denied '/nix/store/6544q8n5bj89vsschrfg8dnd0k7lhmkr-system-path/bin/busctl --json=short call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager ListUnitsByPatterns asas 0 0' exited with value 1 at /nix/store/577xpzvwiiim58n841vzccslzy6qrgga-nixos-system-unnamed-24.11pre646099.00d80d13810d/bin/switch-to-configuration line 145. warning: error(s) occurred while switching to the new configuration
I built the image nix run github:nix-community/nixos-generators -- --format proxmox-lxc --configuration lxc.nix
passing the following lxc.nix file
{ modulesPath, ... }:
{
imports = [
./base.nix
];
boot.isContainer = true;
# Supress systemd units that don't work because of LXC
systemd.suppressedSystemUnits = [
"dev-mqueue.mount"
"sys-kernel-debug.mount"
"sys-fs-fuse-connections.mount"
];
}
base.nix just sets the state version, creates a user, enables flakes, and adds an ssh key.
{
system.stateVersion = "24.11";
users.users.nixos =
{
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 "
];
};
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "no";
};
security.sudo.wheelNeedsPassword = false;
}
I’m scratching my head at this one, I don’t have much experience with LXCs and the problem isn’t really apparent. Any advice?