nix-home/niten.nix

239 lines
4.2 KiB
Nix
Raw Normal View History

2021-09-30 17:02:50 -07:00
{
doom-emacs,
niten-doom-config,
username,
user-email,
home-dir,
enable-gui,
...
}:
2021-09-02 13:21:18 -07:00
2023-11-06 15:45:46 -08:00
{ pkgs, ... }:
2023-11-06 15:34:48 -08:00
with pkgs.lib;
2021-09-02 13:21:18 -07:00
let
2023-11-06 19:10:02 -08:00
inherit (pkgs.stdenv) isLinux;
2021-09-30 17:02:50 -07:00
doom-emacs-package = pkgs.callPackage doom-emacs {
doomPrivateDir = niten-doom-config;
extraPackages = with pkgs.emacsPackages; [
elpher
use-package
];
2023-11-06 19:43:11 -08:00
# emacsPackagesOverlay = final: prev: {
# irony = prev.irony.overrideAttrs (esuper: {
# buildInputs = with pkgs;
# esuper.buildInputs ++
# [ cmake libclang clang ];
# });
# };
2021-09-30 17:02:50 -07:00
};
2021-09-02 13:21:18 -07:00
2021-09-30 17:02:50 -07:00
gui-packages = with pkgs; [
2021-09-02 13:21:18 -07:00
exodus
firefox
imagemagick
jq
minecraft
nyxt
openttd
pv
signal-desktop
spotify
2023-11-06 19:32:42 -08:00
] ++ (optionals isLinux [
gnome.gnome-tweaks
google-chrome
mplayer
redshift
2021-09-02 13:21:18 -07:00
xclip
2023-11-06 19:32:42 -08:00
]);
2021-09-02 13:21:18 -07:00
common-packages = with pkgs; [
ant
asdf
binutils
bundix
byobu
cdrtools
cargo
clojure
cmake
curl
enca
file
fortune
2021-09-30 17:02:50 -07:00
doom-emacs-package
2021-09-02 13:21:18 -07:00
git
gnutls
gnupg
guile
2023-11-06 19:34:49 -08:00
inetutils
2021-09-02 13:21:18 -07:00
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
2023-11-06 19:32:42 -08:00
] ++ (optionals isLinux [
2023-11-06 19:35:27 -08:00
atop
2023-11-06 19:36:12 -08:00
btrfs-progs
2023-11-06 19:33:56 -08:00
clj2nix
opencv-java
2023-11-06 19:32:42 -08:00
]);
2021-09-02 13:21:18 -07:00
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;
2021-09-07 15:50:40 -07:00
# "Xft.dpi" = 192;
2021-09-02 13:21:18 -07:00
"Xft.hinting" = 1;
"Xft.hintstyle" = "hintfull";
"Xft.lcdfilter" = "lcddefault";
};
2023-11-06 19:10:02 -08:00
services = mkIf isLinux {
2021-09-02 13:21:18 -07:00
emacs = {
enable = true;
2021-09-30 17:02:50 -07:00
package = doom-emacs-package;
2021-09-02 13:21:18 -07:00
client = {
enable = true;
};
};
gpg-agent.enable = true;
2021-09-08 12:10:59 -07:00
gnome-keyring.enable = true;
redshift = {
enable = true;
2021-09-18 22:57:22 -07:00
latitude = "47";
longitude = "122";
2021-09-08 12:10:59 -07:00
};
};
accounts.email.accounts = {
Fudo = {
primary = true;
address = "niten@fudo.org";
aliases = [ "peter@selby.ca" ];
userName = "niten";
realName = "Niten";
imap = {
host = "mail.fudo.org";
2021-09-18 22:57:22 -07:00
port = 993;
tls.enable = true;
2021-09-08 12:10:59 -07:00
};
smtp = {
host = "mail.fudo.org";
2021-09-18 22:57:22 -07:00
port = 587;
2021-09-08 12:10:59 -07:00
tls = {
enable = true;
useStartTls = true;
};
};
};
GMail = {
address = "pselby@gmail.com";
flavor = "gmail.com";
realName = "Peter Selby";
};
2021-09-02 13:21:18 -07:00
};
home = {
2023-11-06 19:05:08 -08:00
inherit username;
2023-11-06 19:05:49 -08:00
homeDirectory = home-dir;
2021-09-02 13:21:18 -07:00
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 = "";
2021-09-30 17:02:50 -07:00
DOOM_EMACS_SITE_PATH = "${niten-doom-config}/site.d";
2021-09-02 13:21:18 -07:00
HISTCONTROL = "ignoredups:ignorespace";
};
};
2023-11-06 19:10:45 -08:00
systemd.user.tmpfiles.rules = optionals isLinux
(map (dir: "d ${home-dir}/${dir} 700 niten - - -") ensure-directories);
2021-09-02 13:21:18 -07:00
}