lilyinstarlight / nixos-cosmic

Flake for using COSMIC on NixOS
MIT License
435 stars 27 forks source link

Building NixOS configuration including nixos-cosmic crashes #495

Open matetamasi opened 1 day ago

matetamasi commented 1 day ago

Hey! I recently reinstalled my machine, the most notable change is using zfs instead of btrfs, a bit of restructuring in the file system, and using LTS linux kernel 6.6 instead of the most recent one available on NixOS unstable. I keep running into a problem where building my config crashes the terminal when including nixos-cosmic.

The configuration from before reinstalling: https://github.com/matetamasi/nix-config/tree/impermanence The working configuration after reinstalling: https://github.com/matetamasi/nix-config/tree/impermanence-zfs (nixos-cosmic is commented out here) The configuration that crashes the terminal when building: https://github.com/matetamasi/nix-config/tree/cosmic-crash

To summarize the difference between the new working installation and the crashing one:

flake.nix:

    #...
    nixosConfigurations.nixos = lib.nixosSystem {
      modules = [
      #...
        {
          nix.settings = {
            substituters = [ "https://cosmic.cachix.org/" ];
            trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
          };
        }
        nixos-cosmic.nixosModules.default
      ];
    };
  };

configuration.nix:

services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;

I tried running nixos-rebuild switch as well as nom build <path>#nixosConfigurations.nixos.config.system.build.toplevel, both of those seem to crash the terminal during some step of building nixos-cosmic. I tried building both from the installation media (so with the system not being live) as well as on the system as it is described in impermanence-zfs. I tried using the old flake.lock file from before reinstalling as well as a freshly updated lock file. I also tried multiple terminal emulators, and tmux. Since attempting to build just kills the terminal, I have no error message and I am not sure how I can get more information about this failure. Any advice would be greatly appreciated.

delliottxyz commented 9 hours ago

It may be an out of memory error. Perhaps try limiting the number of cores used in the build using

nix build .#nixosConfigurations.nixos.config.system.build.toplevel --cores n -j n

where n is the desired number of cores. Perhaps start with n=1 and increase if that works.