Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newest Nixos Unstable fails to switch root #253

Closed
th3voic3 opened this issue Jan 26, 2025 · 2 comments
Closed

Newest Nixos Unstable fails to switch root #253

th3voic3 opened this issue Jan 26, 2025 · 2 comments

Comments

@th3voic3
Copy link

th3voic3 commented Jan 26, 2025

Hi,

after the most recent nixos unstable updates and updating my flake to it my system fails to boot after rebuilding with this message:
Image

My workaround is then to reboot once into an older generation before the updates, which populates everything again and then disabling wiping the btrfs subvolume.

Unfortunately I don't get any logs in journalctl for the failed boots and an emergency console is frozen as soon as the error appears.

This is my flake:

  description = "Nixos config flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    impermanence.url = "github:nix-community/impermanence";
    stylix.url = "github:danth/stylix";
    lanzaboote = {
      url = "github:nix-community/lanzaboote";
      #url = "github:nix-community/lanzaboote/v0.4.1";

      # Optional but recommended to limit the size of your system closure.
      inputs.nixpkgs.follows = "nixpkgs";
    };
    agenix.url = "github:ryantm/agenix";
    nvf.url = "github:notashelf/nvf";

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    hyprpanel = {
      url = "github:Jas-SinghFSU/HyprPanel";
    };
    hyprland-qtutils = {
      url = "github:hyprwm/hyprland-qtutils";
    };
  };

  outputs = {
    self,
    nixpkgs,
    impermanence,
    lanzaboote,
    stylix,
    agenix,
    hyprland-qtutils,
    nvf,
    ...
  } @ inputs: let
    system = "x86_64-linux";
  in {
    nixosConfigurations.serenity = nixpkgs.lib.nixosSystem {
      specialArgs = {
        inherit inputs;
        inherit system;
      };
      modules = [
        ./hosts/serenity/configuration.nix
        ./modules/nixos/base
        ./modules/nixos/desktop
        ./modules/nixos/optional/vfio
        ./modules/nixos/optional/btrfs.nix
        ./modules/nixos/optional/cooler.nix
        ./modules/nixos/optional/serenitybackupnas.nix
        ./modules/nixos/optional/nvidia_open.nix
        nvf.nixosModules.default
        impermanence.nixosModules.impermanence
        agenix.nixosModules.default
        {
          environment.systemPackages = [agenix.packages.${system}.default];
        }
        inputs.home-manager.nixosModules.default

        stylix.nixosModules.stylix
        {nixpkgs.overlays = [inputs.hyprpanel.overlay];}
        lanzaboote.nixosModules.lanzaboote
        ({
          pkgs,
          lib,
          ...
        }: {
          boot.loader.systemd-boot.enable = lib.mkForce false;

          boot.lanzaboote = {
            enable = true;
            pkiBundle = "/var/lib/sbctl";
          };
        })
      ];
    };
    nixosConfigurations.shuttle = nixpkgs.lib.nixosSystem {
      specialArgs = {
        inherit inputs;
        inherit system;
      };
      modules = [
        ./hosts/shuttle/configuration.nix
        ./modules/nixos/base
        ./modules/nixos/desktop
        ./modules/nixos/desktop/wireless.nix
        ./modules/nixos/optional/btrfs.nix
        nvf.nixosModules.default
        impermanence.nixosModules.impermanence
        agenix.nixosModules.default
        {
          environment.systemPackages = [agenix.packages.${system}.default];
        }
        inputs.home-manager.nixosModules.default
        stylix.nixosModules.stylix
        lanzaboote.nixosModules.lanzaboote
        {nixpkgs.overlays = [inputs.hyprpanel.overlay];}
        ({
          pkgs,
          lib,
          ...
        }: {
          boot.loader.systemd-boot.enable = lib.mkForce false;

          boot.lanzaboote = {
            enable = true;
            pkiBundle = "/var/lib/sbctl";
          };
        })
      ];
    };
    nixosConfigurations.battleblock = nixpkgs.lib.nixosSystem {
      specialArgs = {
        inherit inputs;
        inherit system;
      };
      modules = [
        ./hosts/battleblock/configuration.nix
        ./modules/nixos/base
        ./modules/nixos/server
        ./modules/nixos/server/wordpress.nix
        ./modules/nixos/server/daniel.nix
        ./modules/nixos/optional/btrfs.nix
        ./modules/nixos/optional/nvidia.nix
        nvf.nixosModules.default
        impermanence.nixosModules.impermanence
        agenix.nixosModules.default
        {
          environment.systemPackages = [agenix.packages.${system}.default];
        }
        inputs.home-manager.nixosModules.default
        lanzaboote.nixosModules.lanzaboote
        ({
          pkgs,
          lib,
          ...
        }: {
          boot.loader.systemd-boot.enable = lib.mkForce false;

          boot.lanzaboote = {
            enable = true;
            pkiBundle = "/var/lib/sbctl";
          };
        })
      ];
    };
  };
}
@alfarelcynthesis
Copy link

You can work around this by creating a /persist/usr/path directory/file which gets linked to your actual filesystem by impermanence (so that /usr/ is "populated" for systemd), but it should probably get an actual fix at some point.

I don't personally use lanzaboote, but I remember it also having some issue with the systemd v257 update, make sure that input is up-to-date too/check out their repo.

@th3voic3
Copy link
Author

@alfarelcynthesis
Thanks a lot. That's a great workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants