Flakes use in home manager help required - eviltoast

I want to use Plasma-manager in my system. I have enabled flakes in configurations. Now what to do to use it. The output generated by tool rc2nix can be copied through terminal but when i put that in home.nix , it says that plasma is not available which is true but then how do I use this tool. flake file.

  • Insaan@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Thank you for help. so now I have flake.nix and home.nix in ~/.config/home-manager. flake.nix looks like

    `{ description = “Plasma Manager Example”;

    inputs = { # Specify the source of Home Manager and Nixpkgs home-manager.url = “github:nix-community/home-manager”; nixpkgs.url = “github:nixos/nixpkgs/nixpkgs-unstable”; home-manager.inputs.nixpkgs.follows = “nixpkgs”;

    plasma-manager. url = "github:pjones/plasma-manager";
    plasma-manager. inputs. nixpkgs. follows = "nixpkgs";
    plasma-manager. inputs. home-manager. follows = "home-manager";
    

    };

    outputs = { home-manager , plasma-manager , nixpkgs , … }: let system = “x86_64-linux”; username = “naresh”; in { homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.${system}; # extraModules = [ # plasma-manager.homeManagerModules.plasma-manager # ];

        modules = [
          # ./home.nix
          # {
          #   home = {
          #     inherit username;
          #     homeDirectory = "/home/${username}";
          #     # Update the state version as needed.
          #     stateVersion = "23.05";
          #   };
    
    
          # },
          plasma-manager.homeManagerModules.plasma-manager
    
        ];
    
    
      };
      devShells.${system}.default =
        let pkgs = import nixpkgs { inherit system; }; in
        pkgs.mkShell {
          buildInputs = [
            home-manager.packages.${system}.home-manager
          ];
        };
    };
    

    } `

    and home.nix looks like

    { config, pkgs, plasma-manager, ... }:
    
    {
      # Home Manager needs a bit of information about you and the paths it should
      # manage.
      home.username = "naresh";
      home.homeDirectory = "/home/naresh";
    
      # This value determines the Home Manager release that your configuration is
      # compatible with. This helps avoid breakage when a new Home Manager release
      # introduces backwards incompatible changes.
      #
      # You should not change this value, even if you update Home Manager. If you do
      # want to update the value, then make sure to first check the Home Manager
      # release notes.
      home.stateVersion = "23.05"; # Please read the comment before changing.
    
    
      imports = [ plasma-manager.homeManagerModules.plasma-manager ];
    
      # The home.packages option allows you to install Nix packages into your
      # environment.
      home.packages = with pkgs; [
        alacritty
        screenfetch
        konsole
        rnix-lsp
        # # Adds the 'hello' command to your environment. It prints a friendly
        # # "Hello, world!" when run.
        # pkgs.hello
    
        # # It is sometimes useful to fine-tune packages, for example, by applying
        # # overrides. You can do that directly here, just don't forget the
        # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
        # # fonts?
        # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
    
        # # You can also create simple shell scripts directly inside your
        # # configuration. For example, this adds a command 'my-hello' to your
        # # environment:
        # (pkgs.writeShellScriptBin "my-hello" ''
        #   echo "Hello, ${config.home.username}!"
        # '')
      ]; #) ++ ([(builtins.getFlake "github:pjones/plasma-manager")]);
    
      # Home Manager is pretty good at managing dotfiles. The primary way to manage
      # plain files is through 'home.file'.
      home.file = {
        # # Building this configuration will create a copy of 'dotfiles/screenrc' in
        # # the Nix store. Activating the configuration will then make '~/.screenrc' a
        # # symlink to the Nix store copy.
        # ".screenrc".source = dotfiles/screenrc;
    
        # # You can also set the file content immediately.
        # ".gradle/gradle.properties".text = ''
        #   org.gradle.console=verbose
        #   org.gradle.daemon.idletimeout=3600000
        # '';
      };
    
      # You can also manage environment variables but you will have to manually
      # source
      #
      #  ~/.nix-profile/etc/profile.d/hm-session-vars.sh
      #
      # or
      #
      #  /etc/profiles/per-user/naresh/etc/profile.d/hm-session-vars.sh
      #
      # if you don't want to manage your shell through Home Manager.
      home.sessionVariables = {
        # EDITOR = "emacs";
      };
    
      # Let Home Manager install and manage itself.
      programs.home-manager.enable = true;
    
      programs.plasma = {
        enable = true;
    
        # Some high-level settings:
        workspace.clickItemTo = "select";
    
        hotkeys.commands."Launch Konsole" = {
          key = "Meta+Alt+K";
          command = "konsole";
        };
    
        # Some mid-level settings:
        shortcuts = {
          ksmserver = {
            "Lock Session" = [ "Screensaver" "Meta+Ctrl+Alt+L" ];
          };
    
          kwin = {
            "Expose" = "Meta+,";
            "Switch Window Down" = "Meta+J";
            "Switch Window Left" = "Meta+H";
            "Switch Window Right" = "Meta+L";
            "Switch Window Up" = "Meta+K";
          };
        };
    
        # A low-level setting:
        configFile."baloofilerc"."Basic Settings"."Indexing-Enabled" = false;
      };
    }
    
    
    
    

    and when I run home-manager switch --flake ~/.config/home-manager/ It gives me

    `error: … while evaluating a branch condition

         at /nix/store/1ryprai4bllkrna60cmcygxc4qyn79s1-source/lib/lists.nix:57:9:
    
           56|       fold' = n:
           57|         if n == len
             |         ^
           58|         then nul
    
       … while calling the 'length' builtin
    
         at /nix/store/1ryprai4bllkrna60cmcygxc4qyn79s1-source/lib/lists.nix:55:13:
    
           54|     let
           55|       len = length list;
             |             ^
           56|       fold' = n:
    
       (stack trace truncated; use '--show-trace' to show the full trace)
    
       error: The option `home.stateVersion' is used but not defined.
    

    `

    Now don’t know what to do. I got your latter advice regarding diff but first I need to make this work. I am on unstable nixos version. and

    home-manager --version gives 23.11-pre

    nixos-version gives 23.11pre546599.e44462d6021b (Tapir)

    ___``___

    • Triton@lemm.ee
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      The problem seems to be that home.stateVersion is not set because you commented out both the declaration in flake.nix as well as the line that imports home.nix. It’s a bit difficult to see whether the config is otherwise fine since there is a lot of visual clutter due to all the commented-out lines.