{
  config,
  pkgs,
  lib,
  ...
}: {
  imports = [
    # sway as windowmanager
    ../../modules/home-manager/sway.nix
  ];

  # Home Manager needs a bit of information about you and the paths it should
  # manage.
  home.username = "max";
  home.homeDirectory = "/home/max";

  nixpkgs.config.allowUnfree = true;

  # 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.11"; # Please read the comment before changing.

  # The home.packages option allows you to install Nix packages into your
  # environment.
  home.packages = with pkgs; [
    zsh
    starship
    zoxide
    lazygit
    btop
    bat
    eza
    unzip
    rustup
    nextcloud-client
    firefox
    thunderbird
    xournalpp
    kicad
    prismlauncher
    steam
    blender
    mpd
    mpdris2
    mpc-cli
    ymuse
    flip-link
    bacon
    probe-rs
    betaflight-configurator
    loudgain
    youtube-dl
    dconf
    distrobox
  ];

  # 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
    # '';
  };

  # Home Manager can also manage your environment variables through
  # 'home.sessionVariables'. If you don't want to manage your shell through Home
  # Manager then you have to manually source 'hm-session-vars.sh' located at
  # either
  #
  #  ~/.nix-profile/etc/profile.d/hm-session-vars.sh
  #
  # or
  #
  #  ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
  #
  # or
  #
  #  /etc/profiles/per-user/max/etc/profile.d/hm-session-vars.sh
  #
  home.sessionVariables = {
    EDITOR = "nvim";
  };

  programs.zsh = {
    enable = true;
    enableAutosuggestions = true;
    enableCompletion = true;
    defaultKeymap = "emacs";
    dotDir = ".config/zsh";
    history.expireDuplicatesFirst = true;
    history.path = "$ZDOTDIR/.zsh_history";
    historySubstringSearch.enable = true;
    shellAliases = {
      ls = "exa --icons -a --group-directories-first";
      diff = "diff --color=auto";
      grep = "grep --color=auto";
      ip = "ip --color=auto";
      mkdir = "mkdir -p";
      gst = "git status";
      gc = "git commit";
      ga = "git add";
      gpl = "git pull";
      gpu = "git push";
      gd = "git diff";
      gch = "git checkout";
      gs = "git switch";
      gre = "git restore";
      gr = "git remote";
      gcl = "git clone";
      glg = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n''         %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
      gb = "git branch";
      gm = "git merge";
      gf = "git fetch";
      rebuild = "~/dotfiles/nixos/rebuild.sh";
    };
    syntaxHighlighting.enable = true;
    syntaxHighlighting.highlighters = ["main" "brackets"];
  };

  programs.starship = {
    enable = true;
    enableBashIntegration = true;
    enableZshIntegration = true;
    settings = {
      add_newline = false;
      command_timeout = 5000;
      character = {
        success_symbol = "[->](bold green)";
        error_symbol = "[ X](bold red)";
      };
      cmd_duration = {
        min_time = 500;
        show_milliseconds = true;
      };
    };
  };

  programs.zoxide = {
    enable = true;
    enableBashIntegration = true;
    enableZshIntegration = true;
    options = ["--cmd cd"];
  };

  services.nextcloud-client.enable = true;

  services.mpd = {
    enable = true;
    musicDirectory = "/home/max/Music/";
  };

  services.mpdris2.enable = true;

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;
}