{ doom-emacs, niten-doom-config, username, user-email, home-dir, enable-gui, ... }: { pkgs, ... }: with pkgs.lib; let inherit (pkgs.stdenv) isLinux; doom-emacs-package = pkgs.callPackage doom-emacs { doomPrivateDir = niten-doom-config; # extraPackages = with pkgs.emacsPackages; [ # elpher # use-package # ]; emacsPackagesOverlay = final: prev: { irony = prev.irony.overrideAttrs (esuper: { buildInputs = with pkgs; esuper.buildInputs ++ [ cmake libclang clang ]; }); }; }; gui-packages = with pkgs; [ exodus firefox imagemagick jq minecraft nyxt openttd pv signal-desktop spotify ] ++ (optionals isLinux [ gnome.gnome-tweaks google-chrome mplayer redshift xclip ]); common-packages = with pkgs; [ ant asdf binutils bundix byobu cdrtools cargo clojure cmake curl enca file fortune doom-emacs-package git gnutls gnupg guile inetutils ipfs iptables jdk leiningen libisofs lispPackages.quicklisp lsof lshw mkpasswd mtr nixfmt nix-index nix-prefetch-git nmap openldap openssl pciutils pwgen python ruby rustc sbcl stdenv texlive.combined.scheme-basic tmux unzip yubikey-manager yubikey-personalization youtube-dl # Check and pick a favorite molly-brown ncgopher amfora asuka kristall castor ] ++ (optionals isLinux [ atop btrfs-progs clj2nix opencv-java ]); ensure-directories = [ ".emacs.d/.local/etc/eshell" ]; in { programs = { bash.enable = true; git = { enable = true; userName = username; userEmail = user-email; ignores = [ "*~" ]; extraConfig.pull.rebase = false; }; }; xresources.properties = mkIf enable-gui { "Xft.antialias" = 1; "Xft.autohint" = 0; # "Xft.dpi" = 192; "Xft.hinting" = 1; "Xft.hintstyle" = "hintfull"; "Xft.lcdfilter" = "lcddefault"; }; services = mkIf isLinux { emacs = { enable = true; package = doom-emacs-package; client = { enable = true; }; }; gpg-agent.enable = true; gnome-keyring.enable = true; redshift = { enable = true; latitude = "47"; longitude = "122"; }; }; accounts.email.accounts = { Fudo = { primary = true; address = "niten@fudo.org"; aliases = [ "peter@selby.ca" ]; userName = "niten"; realName = "Niten"; imap = { host = "mail.fudo.org"; port = 993; tls.enable = true; }; smtp = { host = "mail.fudo.org"; port = 587; tls = { enable = true; useStartTls = true; }; }; }; GMail = { address = "pselby@gmail.com"; flavor = "gmail.com"; realName = "Peter Selby"; }; }; home = { inherit username; homeDirectory = home-dir; packages = if enable-gui then (common-packages ++ gui-packages) else common-packages; file = { ".local/share/openttd/baseset" = mkIf enable-gui { source = "${pkgs.openttd-data}/data"; }; # For nixified emacs ".emacs.d/init.el".text = '' (load "default.el") (setq package-archives nil) (package-initialize) ''; ".xsessions" = mkIf enable-gui { executable = true; text = '' # -*-bash-*- gdmauth=$XAUTHORITY unset XAUTHORITY export XAUTHORITY xauth merge "$gdmauth" if [ -f $HOME/.xinitrc ]; then bash --login -i $HOME/.xinitrc fi ''; }; }; sessionVariables = { # EDITOR = "${doom-emacs}/bin/emacsclient -t"; ALTERNATE_EDITOR = ""; DOOM_EMACS_SITE_PATH = "${niten-doom-config}/site.d"; HISTCONTROL = "ignoredups:ignorespace"; }; }; systemd.user.tmpfiles.rules = optionals isLinux (map (dir: "d ${home-dir}/${dir} 700 niten - - -") ensure-directories); }