2022-06-09 21:50:24 +00:00
|
|
|
# docs:
|
|
|
|
# https://rycee.gitlab.io/home-manager/
|
|
|
|
# https://rycee.gitlab.io/home-manager/options.html
|
|
|
|
# man home-configuration.nix
|
|
|
|
#
|
|
|
|
|
|
|
|
{ home-manager, lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.colinsane.home-manager;
|
|
|
|
in
|
2022-05-22 08:27:02 +00:00
|
|
|
{
|
2022-05-23 07:01:50 +00:00
|
|
|
imports = [
|
|
|
|
home-manager.nixosModule
|
|
|
|
];
|
2022-05-22 08:27:02 +00:00
|
|
|
|
2022-06-09 21:50:24 +00:00
|
|
|
options = {
|
|
|
|
colinsane.home-manager.extraPackages = mkOption {
|
|
|
|
default = [ ];
|
|
|
|
type = types.listOf types.package;
|
|
|
|
};
|
2022-06-09 22:01:38 +00:00
|
|
|
colinsane.home-manager.windowManager = mkOption {
|
|
|
|
default = {};
|
|
|
|
type = types.attrs;
|
|
|
|
};
|
2022-06-09 22:05:58 +00:00
|
|
|
colinsane.home-manager.programs = mkOption {
|
|
|
|
default = {};
|
|
|
|
type = types.attrs;
|
|
|
|
};
|
2022-06-09 21:50:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
2022-06-10 01:53:19 +00:00
|
|
|
sops.secrets."colinsane_email_passwd" = {
|
|
|
|
owner = config.users.users.colin.name;
|
|
|
|
};
|
2022-06-21 06:55:43 +00:00
|
|
|
sops.secrets."aerc_accounts" = {
|
|
|
|
owner = config.users.users.colin.name;
|
|
|
|
sopsFile = ../../secrets/universal/aerc_accounts.conf;
|
|
|
|
format = "binary";
|
|
|
|
};
|
2022-06-10 01:53:19 +00:00
|
|
|
|
2022-06-09 21:50:24 +00:00
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
|
|
|
|
2022-06-21 06:55:43 +00:00
|
|
|
# XXX this weird rename + closure is to get home-manager's `config.lib.file` to exist.
|
|
|
|
# see: https://github.com/nix-community/home-manager/issues/589#issuecomment-950474105
|
|
|
|
home-manager.users.colin = let sysconfig = config; in { config, ... }: {
|
2022-06-09 21:50:24 +00:00
|
|
|
home.stateVersion = "21.11";
|
|
|
|
home.username = "colin";
|
|
|
|
home.homeDirectory = "/home/colin";
|
|
|
|
|
|
|
|
# XDG defines things like ~/Desktop, ~/Downloads, etc.
|
|
|
|
# these clutter the home, so i mostly don't use them.
|
|
|
|
xdg.userDirs = {
|
|
|
|
enable = true;
|
|
|
|
createDirectories = false; # on headless systems, most xdg dirs are noise
|
|
|
|
desktop = "$HOME/.xdg/Desktop";
|
2022-06-18 00:52:31 +00:00
|
|
|
documents = "$HOME/dev";
|
2022-06-09 21:50:24 +00:00
|
|
|
download = "$HOME/tmp";
|
|
|
|
music = "$HOME/Music";
|
|
|
|
pictures = "$HOME/Pictures";
|
|
|
|
publicShare = "$HOME/.xdg/Public";
|
|
|
|
templates = "$HOME/.xdg/Templates";
|
|
|
|
videos = "$HOME/Videos";
|
|
|
|
};
|
|
|
|
|
2022-06-21 06:55:43 +00:00
|
|
|
xdg.configFile."aerc/accounts.conf".source =
|
|
|
|
config.lib.file.mkOutOfStoreSymlink sysconfig.sops.secrets.aerc_accounts.path;
|
|
|
|
|
2022-06-10 01:53:19 +00:00
|
|
|
accounts.email.accounts.colinsane = {
|
|
|
|
address = "colin@uninsane.org";
|
|
|
|
userName = "colin";
|
|
|
|
imap = {
|
|
|
|
host = "imap.uninsane.org";
|
|
|
|
port = 993;
|
|
|
|
};
|
|
|
|
smtp = {
|
|
|
|
host = "mx.uninsane.org";
|
|
|
|
port = 465;
|
|
|
|
};
|
|
|
|
realName = "Colin Sane";
|
2022-06-21 06:55:43 +00:00
|
|
|
passwordCommand = "cat ${sysconfig.sops.secrets.colinsane_email_passwd.path}";
|
2022-06-10 01:53:19 +00:00
|
|
|
|
|
|
|
primary = true;
|
|
|
|
|
|
|
|
# mailbox synchronization
|
|
|
|
# mbsync = {
|
|
|
|
# enable = true;
|
|
|
|
# create = "maildir";
|
|
|
|
# };
|
|
|
|
# msmtp.enable = true; # mail sender
|
|
|
|
# notmuch.enable = true; # indexing; used by himalaya
|
|
|
|
|
|
|
|
# docs: https://github.com/soywod/himalaya
|
|
|
|
himalaya.enable = true; # CLI email client
|
|
|
|
};
|
|
|
|
|
2022-06-09 22:05:58 +00:00
|
|
|
programs = {
|
|
|
|
home-manager.enable = true; # this lets home-manager manage dot-files in user dirs, i think
|
|
|
|
|
2022-06-10 01:53:19 +00:00
|
|
|
himalaya.enable = true; # CLI email client
|
|
|
|
|
2022-06-09 22:05:58 +00:00
|
|
|
zsh = {
|
2022-06-09 21:50:24 +00:00
|
|
|
enable = true;
|
2022-06-09 22:05:58 +00:00
|
|
|
enableSyntaxHighlighting = true;
|
|
|
|
enableVteIntegration = true;
|
|
|
|
dotDir = ".config/zsh";
|
|
|
|
|
|
|
|
initExtraBeforeCompInit = ''
|
|
|
|
# p10k instant prompt
|
|
|
|
# run p10k configure to configure, but it can't write out its file :-(
|
|
|
|
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
|
|
|
|
'';
|
|
|
|
|
|
|
|
# prezto = oh-my-zsh fork; controls prompt, auto-completion, etc.
|
|
|
|
# see: https://github.com/sorin-ionescu/prezto
|
|
|
|
prezto = {
|
|
|
|
enable = true;
|
|
|
|
pmodules = [
|
|
|
|
"environment"
|
|
|
|
"terminal"
|
|
|
|
"editor"
|
|
|
|
"history"
|
|
|
|
"directory"
|
|
|
|
"spectrum"
|
|
|
|
"utility"
|
|
|
|
"completion"
|
|
|
|
"prompt"
|
|
|
|
"git"
|
|
|
|
];
|
|
|
|
prompt = {
|
|
|
|
theme = "powerlevel10k";
|
|
|
|
};
|
2022-06-09 21:50:24 +00:00
|
|
|
};
|
|
|
|
};
|
2022-06-09 22:05:58 +00:00
|
|
|
kitty.enable = true;
|
|
|
|
git = {
|
|
|
|
enable = true;
|
|
|
|
userName = "colin";
|
|
|
|
userEmail = "colin@uninsane.org";
|
|
|
|
};
|
2022-06-09 21:50:24 +00:00
|
|
|
|
2022-06-09 22:05:58 +00:00
|
|
|
vim = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = ''
|
|
|
|
" wtf vim project: NOBODY LIKES MOUSE FOR VISUAL MODE
|
|
|
|
set mouse-=a
|
|
|
|
" copy/paste to system clipboard
|
|
|
|
set clipboard=unnamedplus
|
|
|
|
" <tab> completion menu settings
|
|
|
|
set wildmenu
|
|
|
|
set wildmode=longest,list,full
|
|
|
|
" highlight all matching searches (using / and ?)
|
|
|
|
set hlsearch
|
|
|
|
" allow backspace to delete empty lines in insert mode
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
" built-in syntax highlighting
|
|
|
|
syntax enable
|
|
|
|
" show line/col number in bottom right
|
|
|
|
set ruler
|
|
|
|
" highlight trailing space & related syntax errors (does this work?)
|
|
|
|
let c_space_errors=1
|
|
|
|
let python_space_errors=1
|
|
|
|
'';
|
|
|
|
};
|
2022-06-09 21:50:24 +00:00
|
|
|
|
2022-06-21 06:55:43 +00:00
|
|
|
firefox = lib.mkIf (sysconfig.colinsane.gui.enable) {
|
2022-06-09 22:05:58 +00:00
|
|
|
enable = true;
|
2022-06-09 21:50:24 +00:00
|
|
|
|
2022-06-09 22:05:58 +00:00
|
|
|
profiles.default = {
|
|
|
|
bookmarks = {
|
|
|
|
fed_uninsane.url = "https://fed.uninsane.org/";
|
|
|
|
delightful.url = "https://delightful.club/";
|
|
|
|
crowdsupply.url = "https://www.crowdsupply.com/";
|
|
|
|
linux_phone_apps.url = "https://linuxphoneapps.org/mobile-compatibility/5/";
|
|
|
|
mempool.url = "https://jochen-hoenicke.de/queue";
|
|
|
|
};
|
2022-06-09 21:50:24 +00:00
|
|
|
};
|
2022-06-09 22:05:58 +00:00
|
|
|
|
|
|
|
# firefox profile support seems to be broken :shrug:
|
|
|
|
# profiles.other = {
|
|
|
|
# id = 2;
|
|
|
|
# };
|
|
|
|
|
|
|
|
# NB: these must be manually enabled in the Firefox settings on first start
|
|
|
|
# extensions can be found here: https://gitlab.com/rycee/nur-expressions/-/blob/master/pkgs/firefox-addons/addons.json
|
2022-06-16 22:02:38 +00:00
|
|
|
extensions = let
|
|
|
|
addons = pkgs.nur.repos.rycee.firefox-addons;
|
|
|
|
in [
|
|
|
|
addons.bypass-paywalls-clean
|
|
|
|
addons.metamask
|
|
|
|
addons.i-dont-care-about-cookies
|
|
|
|
addons.sidebery
|
|
|
|
addons.sponsorblock
|
|
|
|
addons.ublock-origin
|
2022-06-09 22:05:58 +00:00
|
|
|
];
|
2022-06-09 21:50:24 +00:00
|
|
|
};
|
|
|
|
|
2022-06-09 22:05:58 +00:00
|
|
|
# "command not found" will cause the command to be searched in nixpkgs
|
|
|
|
nix-index.enable = true;
|
|
|
|
} // cfg.programs;
|
2022-06-09 21:50:24 +00:00
|
|
|
|
|
|
|
home.shellAliases = {
|
|
|
|
":q" = "exit";
|
|
|
|
# common typos
|
|
|
|
"cd.." = "cd ..";
|
|
|
|
"cd../" = "cd ../";
|
|
|
|
};
|
|
|
|
|
2022-06-09 22:01:38 +00:00
|
|
|
wayland.windowManager = cfg.windowManager;
|
2022-06-09 21:50:24 +00:00
|
|
|
|
2022-06-16 22:02:38 +00:00
|
|
|
home.packages = with pkgs; [
|
|
|
|
backblaze-b2
|
|
|
|
btrfs-progs
|
|
|
|
dig
|
|
|
|
cryptsetup
|
|
|
|
duplicity
|
2022-06-19 22:56:58 +00:00
|
|
|
efibootmgr
|
2022-06-16 22:02:38 +00:00
|
|
|
fatresize
|
|
|
|
fd
|
|
|
|
file
|
|
|
|
gnumake
|
|
|
|
gptfdisk
|
|
|
|
hdparm
|
|
|
|
htop
|
|
|
|
iftop
|
|
|
|
ifuse
|
|
|
|
inetutils # for telnet
|
|
|
|
iotop
|
|
|
|
iptables
|
|
|
|
jq
|
|
|
|
killall
|
|
|
|
libimobiledevice
|
|
|
|
lm_sensors # for sensors-detect
|
|
|
|
lsof
|
|
|
|
mix2nix
|
|
|
|
netcat
|
|
|
|
networkmanager
|
|
|
|
nixpkgs-review
|
|
|
|
# nixos-generators
|
|
|
|
# nettools
|
|
|
|
nmap
|
2022-06-20 06:54:36 +00:00
|
|
|
oathToolkit # for oathtool
|
2022-06-16 22:02:38 +00:00
|
|
|
obsidian
|
|
|
|
openssl
|
|
|
|
parted
|
|
|
|
pciutils
|
|
|
|
# ponymix
|
|
|
|
powertop
|
|
|
|
pulsemixer
|
|
|
|
python3
|
|
|
|
ripgrep
|
2022-06-20 03:18:57 +00:00
|
|
|
rmlint
|
2022-06-16 22:02:38 +00:00
|
|
|
sane-scripts
|
|
|
|
smartmontools
|
|
|
|
snapper
|
|
|
|
socat
|
|
|
|
sops
|
|
|
|
ssh-to-age
|
|
|
|
sudo
|
|
|
|
usbutils
|
|
|
|
wget
|
|
|
|
wireguard-tools
|
|
|
|
youtube-dl
|
|
|
|
zola
|
2022-06-09 21:50:24 +00:00
|
|
|
]
|
2022-06-21 06:55:43 +00:00
|
|
|
++ (if sysconfig.colinsane.gui.enable then
|
2022-06-16 22:02:38 +00:00
|
|
|
with pkgs;
|
2022-06-09 21:50:24 +00:00
|
|
|
[
|
|
|
|
# GUI only
|
2022-06-21 00:55:17 +00:00
|
|
|
aerc # email client
|
2022-06-16 22:02:38 +00:00
|
|
|
audacity
|
|
|
|
chromium
|
|
|
|
clinfo
|
|
|
|
element-desktop # broken on phosh
|
|
|
|
evince # works on phosh
|
|
|
|
font-manager
|
|
|
|
gimp # broken on phosh
|
|
|
|
gnome.dconf-editor
|
|
|
|
gnome.file-roller
|
|
|
|
gnome.gnome-maps # works on phosh
|
|
|
|
gnome.nautilus
|
|
|
|
gnome-podcasts
|
|
|
|
gnome.gnome-terminal # works on phosh
|
|
|
|
inkscape
|
|
|
|
libreoffice-fresh # XXX colin: maybe don't want this on mobile
|
|
|
|
mesa-demos
|
|
|
|
networkmanagerapplet
|
|
|
|
playerctl
|
|
|
|
tdesktop # broken on phosh
|
|
|
|
vlc # works on phosh
|
|
|
|
whalebird # pleroma client. input is broken on phosh
|
|
|
|
xterm # broken on phosh
|
2022-06-09 21:50:24 +00:00
|
|
|
] else [])
|
2022-06-21 06:55:43 +00:00
|
|
|
++ (if sysconfig.colinsane.gui.enable && pkgs.system == "x86_64-linux" then
|
2022-06-16 22:02:38 +00:00
|
|
|
with pkgs;
|
2022-06-09 21:50:24 +00:00
|
|
|
[
|
|
|
|
# x86_64 only
|
2022-06-16 22:02:38 +00:00
|
|
|
discord
|
|
|
|
kaiteki # Pleroma client
|
|
|
|
gnome.zenity # for kaiteki (it will use qarma, kdialog, or zenity)
|
|
|
|
signal-desktop
|
|
|
|
spotify
|
2022-06-09 21:50:24 +00:00
|
|
|
] else [])
|
|
|
|
++ cfg.extraPackages;
|
|
|
|
};
|
|
|
|
};
|
2022-05-22 08:27:02 +00:00
|
|
|
}
|