nix-community / plasma-manager

Manage KDE Plasma with Home Manager
https://nix-community.github.io/plasma-manager/
MIT License
602 stars 70 forks source link

Enabling plasma-manager gives error: attribute 'xor' missing #335

Closed Ilwyd closed 1 month ago

Ilwyd commented 1 month ago

I'm new to NixOS and I'm attempting to start using plasma-manager, however when I run home-manager switch --flake . I get the following error: error: attribute 'xor' missing at /nix/store/2yv61xbgv9f94akkmz11wpny8vbmhqmm-source/modules/workspace.nix:377:23

This is my flake.nix file:

{

    description = "My first flake!";

    inputs = {
        nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
        home-manager.url = "github:nix-community/home-manager/master";
        home-manager.inputs.nixpkgs.follows = "nixpkgs"; # Make sure that the nixpkgs and home-manager versions are the same
        nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; # unstable branch. Use github:gmodena/nix-flatpak/?ref=<tag> to pin releases.
        plasma-manager = {
            url = "github:nix-community/plasma-manager";
            inputs.nixpkgs.follows = "nixpkgs";
            inputs.home-manager.follows = "home-manager";
        };
    };

    outputs = inputs@ {self, nixpkgs, home-manager, nix-flatpak, plasma-manager, ... }:
        let
            lib = nixpkgs.lib;
            system = "x86_64-linux";
            pkgs = nixpkgs.legacyPackages.${system};
        in {
            nixosConfigurations = {
                nixos = lib.nixosSystem {
                    inherit system;
                    modules = [ 
                        nix-flatpak.nixosModules.nix-flatpak
                        ./configuration.nix 
                    ];
                };
            };

            homeConfigurations = {
                myUser = home-manager.lib.homeManagerConfiguration {
                    inherit pkgs;
                    modules = [ 
                        inputs.plasma-manager.homeManagerModules.plasma-manager
                        ./home.nix 
                        ./user/user.nix
                    ];
                    extraSpecialArgs = {
                        inherit plasma-manager;
                    };
                };
            };
        };
}

./user/user.nix just imports another .nix file which has the output of rc2nix. Even with all of the configuration removed and just programs.plasma.enabled = true; I still get the same error ./home.nix has username and homeDirectory set up as shown here

Not sure what I'm doing wrong here, but it may be something obvious to others. Any help is appricated.

HeitorAugustoLN commented 1 month ago

Well, this looks like it is missing lib.xor. Not really sure why it is happening, since apparently it is still available in latest nixos-unstable

HeitorAugustoLN commented 1 month ago

Could you check for it in nix repl if it exists like this:

nixpkgs = import <nixpkgs> {}
nixpkgs.lib.xor
Ilwyd commented 1 month ago

It looks like I've gotten it sorted out, although I'm not exactly certain what I did to fix it. I ran nix flake update last night and did a restart which I think might be the solution.