mirror of
https://codeberg.org/mtxyz/nixconf.git
synced 2024-11-09 10:01:57 +00:00
245 lines
5.9 KiB
Nix
245 lines
5.9 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib) types;
|
|
cfg = config.mtxyz.platform;
|
|
in
|
|
{
|
|
options.mtxyz.platform = {
|
|
private = lib.mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
};
|
|
minimal = lib.mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
};
|
|
portable = lib.mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
};
|
|
};
|
|
|
|
imports = [
|
|
./neovim.nix
|
|
];
|
|
|
|
config = {
|
|
home.packages = with pkgs; [
|
|
delta unzip tree pwgen nvd nixpkgs-fmt home-manager
|
|
kitty.terminfo nix-output-monitor mosh universal-ctags
|
|
] ++ (lib.optionals cfg.private [
|
|
hledger hledger-ui diceware libsecret
|
|
]);
|
|
|
|
accounts = lib.mkIf cfg.private {
|
|
email.accounts.mtxyz = rec {
|
|
address = "me@mtxyz.me";
|
|
userName = address;
|
|
passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup login ${address}";
|
|
realName = "mtxyz";
|
|
primary = true;
|
|
aliases = [
|
|
"me@mtxyz.me"
|
|
"billy@mtxyz.me"
|
|
"billie@mtxyz.me"
|
|
"bailey@mtxyz.me"
|
|
"contact@wasv.me"
|
|
];
|
|
|
|
imap = {
|
|
host = "imap.migadu.com";
|
|
port = 993;
|
|
tls.enable = true;
|
|
};
|
|
smtp = {
|
|
host = "smtp.migadu.com";
|
|
port = 465;
|
|
tls.enable = true;
|
|
};
|
|
|
|
folders = {
|
|
inbox = "INBOX";
|
|
trash = "Archives";
|
|
};
|
|
};
|
|
calendar.accounts.home = {
|
|
name = "Home";
|
|
primary = true;
|
|
remote = rec {
|
|
type = "caldav";
|
|
userName = "me@mtxyz.me";
|
|
passwordCommand = ["${pkgs.libsecret}/bin/secret-tool" "lookup" "login" userName];
|
|
url = "https://cdav.migadu.com/calendars/${userName}/home/";
|
|
};
|
|
};
|
|
};
|
|
|
|
manual.html.enable = true;
|
|
|
|
home.keyboard.layout = "us";
|
|
home.keyboard.options = [ "caps:super" ];
|
|
|
|
programs.tmux = {
|
|
enable = true;
|
|
mouse = true;
|
|
aggressiveResize = true;
|
|
clock24 = true;
|
|
newSession = true;
|
|
extraConfig = ''
|
|
bind - split-window -h -c "#{pane_current_path}"
|
|
bind | split-window -v -c "#{pane_current_path}"
|
|
unbind '"'
|
|
unbind %
|
|
|
|
bind -n M-Left select-pane -L
|
|
bind -n M-Right select-pane -R
|
|
bind -n M-Up select-pane -U
|
|
bind -n M-Down select-pane -D
|
|
|
|
set -sg escape-time 0
|
|
'';
|
|
};
|
|
|
|
programs.btop = {
|
|
enable = true;
|
|
settings = {
|
|
color_theme = "TTY";
|
|
theme_background = false;
|
|
};
|
|
};
|
|
|
|
programs.password-store.enable = lib.mkDefault cfg.private;
|
|
programs.password-store.package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
|
|
|
|
services.syncthing.enable = lib.mkDefault cfg.private;
|
|
|
|
|
|
programs.direnv = {
|
|
enable = true;
|
|
nix-direnv.enable = true;
|
|
};
|
|
|
|
programs.zoxide = {
|
|
enable = true;
|
|
enableFishIntegration = true;
|
|
options = [ "--cmd cd" ];
|
|
};
|
|
|
|
programs.fish = {
|
|
enable = true;
|
|
functions = {
|
|
fish_prompt = (builtins.readFile ./fish_prompt.fish);
|
|
fish_greeting = "";
|
|
last_cmd = "echo $history[1]";
|
|
fish_command_not_found = ''
|
|
set -l last_argv $argv
|
|
echo \"$argv[1]\" Command Not Found
|
|
'';
|
|
update-sys = ''
|
|
argparse -i 'f/flake=' -- $argv
|
|
set -f mode switch
|
|
if set -q argv[1]
|
|
set -f mode $argv[1]
|
|
end
|
|
|
|
set -f flake nixconf
|
|
if set -q _flag_f
|
|
set -f flake $_flag_f
|
|
end
|
|
|
|
sudo echo -n # Make sure sudo has already prompted for password.
|
|
sudo nixos-rebuild $mode --log-format internal-json -v --flake $flake &| nom --json
|
|
'';
|
|
};
|
|
interactiveShellInit = ''
|
|
abbr --position anywhere -a !! -f last_cmd
|
|
'';
|
|
};
|
|
|
|
programs.gpg.enable = true;
|
|
services.gpg-agent = {
|
|
enable = true;
|
|
defaultCacheTtl = 1800;
|
|
pinentryPackage = lib.mkDefault pkgs.pinentry;
|
|
};
|
|
|
|
programs.bat.enable = true;
|
|
programs.lazygit.enable = true;
|
|
|
|
programs.git = {
|
|
enable = true;
|
|
userName = "Bailey Stevens";
|
|
userEmail = "me@mtxyz.me";
|
|
package = pkgs.gitFull;
|
|
|
|
aliases = {
|
|
lazy = "!lazygit";
|
|
graph = "log --graph --oneline";
|
|
};
|
|
|
|
extraConfig = {
|
|
pull.rebase = true;
|
|
rebase.autostash = true;
|
|
init.defaultBranch = "main";
|
|
push.autoSetupRemote = true;
|
|
sendemail.confirm = "always";
|
|
sendemail.identity = "mtxyz";
|
|
credential.helper = "libsecret";
|
|
};
|
|
|
|
ignores = [
|
|
"*~"
|
|
"*.swp"
|
|
".cache/"
|
|
".venv/"
|
|
"compile_commands.json"
|
|
".#*"
|
|
"tags"
|
|
".vscode/"
|
|
".gradle"
|
|
".idea"
|
|
".direnv"
|
|
".envrc"
|
|
];
|
|
|
|
delta.enable = true;
|
|
delta.options.line-numbers = true;
|
|
};
|
|
|
|
programs.ssh = {
|
|
enable = true;
|
|
controlMaster = "auto";
|
|
controlPersist = "5m";
|
|
matchBlocks = {
|
|
"jellydonut sol pegasi gallifrey" = {
|
|
forwardAgent = true;
|
|
hostname = "%h.gg.lan";
|
|
};
|
|
"freedom shell" = {
|
|
user = "wasv";
|
|
forwardAgent = true;
|
|
hostname = "%h.csh.rit.edu";
|
|
};
|
|
};
|
|
};
|
|
|
|
programs.fzf.enable = true;
|
|
programs.zellij = {
|
|
enable = true;
|
|
settings = {
|
|
pane_frames = false;
|
|
default_mode = "locked";
|
|
default_layout = "compact";
|
|
};
|
|
};
|
|
|
|
programs.home-manager.enable = lib.mkDefault cfg.private;
|
|
|
|
home.stateVersion = "22.11";
|
|
};
|
|
}
|