Nix + Home-Manager on Linux Mint (Cinnamon) Crash on Login

New to Nix… Have spent time reading the docs and examples, not sure where I’m going wrong unfortunately. My setup is pretty simple:

  • Installing Nix using Determinate Systems
  • Install Home-Manager (Standalone)
  • Setup home.nix and flake.nix.

Basically, everything seemed to work fine until I rebooted - and then Cinnamon continually crashes and goes into fallback mode. I tried slowly removing items from my home.nix, but it seems like something was sticking around. I reverted the system by completely removing home-manager and nix.

My home.nix:

{ lib, pkgs, ... }:
{
  home = {
    packages = with pkgs; [
      htop
      neovim
    ];
    #
    # Username stuff.
    username = "username";
    homeDirectory = "/home/username";
    #
    # Someone said: don't change this moving forward.
    stateVersion = "23.11";
  };
  # And now, this...
  xdg.enable = true;
  programs.home-manager.enable = true;
}

My flake.nix:

{
  description = "Nix Home Manager Configuration";

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-23.11";

    home-manager = {
      url = "github:nix-community/home-manager/release-23.11";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { nixpkgs, home-manager, ... }:
    let
      lib = nixpkgs.lib;
      system = "x86_64-linux";
      pkgs = import nixpkgs { inherit system; };
    in {
      homeConfigurations = {
        username = home-manager.lib.homeManagerConfiguration {
          inherit pkgs;
          modules = [ ./home.nix ];
        };
      };
    };
}

I have a suspicion it’s something to do with me using xdg.enable incorrectly? Ultimately I think in my adventures I didn’t get .desktop links in the right path and so I thought, based on my reading, that xdg.enable handled this. Obviously this isn’t the correct way to do it. Any help would be much appreciated! TIA!!!

I am also fairly (very) new to Nix, but I do think that the “xdg.enable” is the problem. I cant find it in the nixos options search, so it might be as easy as changing it to “xdg.portal.enable”?

I have exactly the same problem, but I only have

  targets.genericLinux.enable = true;

I found a workaround for now:

  1. Open /usr/share/cinnamon/js/ui/extension.js with root privileges
  2. Find function findExtensionSubdirectory
  3. Change the first parameter of the function call dir.enumerate_children_async from standard::* to standard::name,type
  4. Restart Cinnamon

Further information in the Home Manager issue: bug: Linux Mint 21.3 w/Home-Manager Crashes to Fallback & systemd-coredump · Issue #5102 · nix-community/home-manager · GitHub