{ pkgs, lib, ... }:
{
  environment.systemPackages = with pkgs;
    let aspell' = aspellWithDicts.override {
          aspell = aspell.overrideAttrs (super: {
            postInstall = super.postInstall + ''
              mkdir -p $out/etc
              cat >$out/lib/aspell/en_US-custom.multi <<EOF
              add en_US-w_accents.multi
              add en-computers.rws
              add en_US-science.rws
              EOF
              cat >$out/etc/aspell.conf <<EOF
              master en_US-custom
              EOF
            '';
          });
        } (ps: with ps; [ en en-computers en-science ]);
    in [
    # Shell
    socat
    jq
    tldr
    ripgrep
    unzip

    # Wayland
    brightnessctl
    playerctl
    pamixer
    ffmpeg

    # System management
    htop-vim
    openssl
    libnotify
    inotify-tools
    cachix

    # Programming
    gcc
    git
    pandoc
    texlive.combined.scheme-full
    aspell'
    nixd

    gnuplot
    graphviz
  ];


  programs.steam.enable = true;
  programs.steam.remotePlay.openFirewall = true;
  programs.steam.gamescopeSession.enable = true;
  programs.steam.extest.enable = true;
  programs.steam.protontricks.enable = true;

  programs.hyprland.enable = true;
  security.pam.services.hyprlock = {};

  programs.fish.enable = true;
  programs.sway.enable = true;
  programs.sway.extraPackages = lib.mkForce [];

  services.emacs.enable = true;
  services.emacs.package = with pkgs;
    (emacsPackagesFor (pkgs.emacs30.override { withPgtk = true; }))
      .emacsWithPackages (epkgs: [ epkgs.vterm ]);

  programs.direnv.enable = true;
  programs.direnv.nix-direnv.enable = true;
  programs.direnv.silent = true;

  nix.extraOptions = ''
    keep-derivations = true
    keep-outputs = true
  '';

  # WLuma

  # services.udev.extraRules = let core = exe: lib.getExe' pkgs.coreutils exe; in ''
  #   ACTION=="add", SUBSYSTEM=="backlight", RUN+="${core "chgrp"} video /sys/class/backlight/%k/brightness"
  #   ACTION=="add", SUBSYSTEM=="backlight", RUN+="${core "chmod"} g+w /sys/class/backlight/%k/brightness"
  #   ACTION=="add", SUBSYSTEM=="leds", RUN+="${core "chgrp"} video /sys/class/leds/%k/brightness"
  #   ACTION=="add", SUBSYSTEM=="leds", RUN+="${core "chmod"} g+w /sys/class/leds/%k/brightness"
  # '';
}
