This commit is contained in:
Harald Hoyer 2024-01-11 10:26:46 +00:00
parent 66c05f9093
commit 45d6f4b0f3
205 changed files with 9040 additions and 342 deletions

View file

@ -0,0 +1,58 @@
{ options
, config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.apps.firefox;
defaultSettings = {
"browser.aboutwelcome.enabled" = false;
"browser.meta_refresh_when_inactive.disabled" = true;
"browser.startup.homepage" = "https://start.duckduckgo.com/?kak=-1&kal=-1&kao=-1&kaq=-1&kt=Hack+Nerd+Font&kae=d&ks=m&k7=2e3440&kj=3b4252&k9=eceff4&kaa=d8dee9&ku=1&k8=d8dee9&kx=81a1c1&k21=3b4252&k18=1&k5=2&kp=-2&k1=-1&kaj=u&kay=b&kk=-1&kax=-1&kap=-1&kau=-1";
"browser.bookmarks.showMobileBookmarks" = true;
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.aboutConfig.showWarning" = false;
"browser.ssb.enabled" = true;
};
in
{
options.plusultra.apps.firefox = with types; {
enable = mkBoolOpt false "Whether or not to enable Firefox.";
extraConfig =
mkOpt str "" "Extra configuration for the user profile JS file.";
userChrome =
mkOpt str "" "Extra configuration for the user chrome CSS file.";
settings = mkOpt attrs defaultSettings "Settings to apply to the profile.";
};
config = mkIf cfg.enable {
plusultra.desktop.addons.firefox-nordic-theme = enabled;
plusultra.home = {
extraOptions = {
programs.firefox = {
enable = true;
package = pkgs.firefox.override {
cfg = {
# FIXME: This method of enabling browser pass support is
# deprecated, but the suggested solution requires using
# the NixOS module rather than Home-Manager. Update this
# if/when Home-Manager gets support for:
# `programs.firefox.extraNativeMessagingHosts.packages`
enableBrowserpass = true;
};
};
profiles.${config.plusultra.user.name} = {
inherit (cfg) extraConfig userChrome settings;
id = 0;
name = config.plusultra.user.name;
};
};
};
};
};
}

View file

@ -0,0 +1,18 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.iterm2;
in
{
options.plusultra.apps.iterm2 = with types; {
enable = mkBoolOpt false "Whether or not to enable iTerm2.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
iterm2
];
};
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.vscode;
in
{
options.plusultra.apps.vscode = with types; {
enable = mkBoolOpt false "Whether or not to enable vscode.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ vscode ]; };
}

View file

@ -0,0 +1,47 @@
inputs @ { options
, config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.neovim;
in
{
options.plusultra.cli-apps.neovim = with types; {
enable = mkBoolOpt false "Whether or not to enable neovim.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
# FIXME: As of today (2022-12-09), `page` no longer works with my Neovim
# configuration. Either something in my configuration is breaking it or `page` is busted.
# page
plusultra.neovim
];
environment.variables = {
# PAGER = "page";
# MANPAGER =
# "page -C -e 'au User PageDisconnect sleep 100m|%y p|enew! |bd! #|pu p|set ft=man'";
PAGER = "less";
MANPAGER = "less";
NPM_CONFIG_PREFIX = "$HOME/.npm-global";
EDITOR = "nvim";
};
plusultra.home = {
configFile = {
"dashboard-nvim/.keep".text = "";
};
extraOptions = {
# Use Neovim for Git diffs.
programs.zsh.shellAliases.vimdiff = "nvim -d";
programs.bash.shellAliases.vimdiff = "nvim -d";
programs.fish.shellAliases.vimdiff = "nvim -d";
};
};
};
}

View file

@ -0,0 +1,23 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.desktop.addons.firefox-nordic-theme;
profileDir = ".mozilla/firefox/${config.plusultra.user.name}";
in
{
options.plusultra.desktop.addons.firefox-nordic-theme = with types; {
enable = mkBoolOpt false "Whether to enable the Nordic theme for firefox.";
};
config = mkIf cfg.enable {
plusultra.apps.firefox = {
extraConfig = builtins.readFile
"${pkgs.plusultra.firefox-nordic-theme}/configuration/user.js";
userChrome = ''
@import "${pkgs.plusultra.firefox-nordic-theme}/userChrome.css";
'';
};
};
}

View file

@ -0,0 +1,109 @@
{ lib, pkgs, config, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.desktop.addons.skhd;
mkScript = name: file: pkgs.writeShellApplication {
inherit name;
checkPhase = "";
text = builtins.readFile file;
};
open-iterm2 = mkScript "open-iterm2" ./scripts/open-iterm2.sh;
in
{
options.plusultra.desktop.addons.skhd = {
enable = mkEnableOption "skhd";
};
config = mkIf cfg.enable {
services.skhd = {
enable = true;
skhdConfig = ''
# Movement
shift + cmd - h : yabai -m window --focus west
shift + cmd - j : yabai -m window --focus south
shift + cmd - k : yabai -m window --focus north
shift + cmd - l : yabai -m window --focus east
# Window Movement
lctrl + shift + cmd - h : yabai -m window --swap west
lctrl + shift + cmd - j : yabai -m window --swap south
lctrl + shift + cmd - k : yabai -m window --swap north
lctrl + shift + cmd - l : yabai -m window --swap east
# Window Resize
lctrl + cmd - h : yabai -m window --resize left:-50:0; \
yabai -m window --resize right:-50:0
lctrl + cmd - j : yabai -m window --resize bottom:0:50; \
yabai -m window --resize top:0:50
lctrl + cmd - k : yabai -m window --resize top:0:-50; \
yabai -m window --resize bottom:0:-50
lctrl + cmd - l : yabai -m window --resize right:50:0; \
yabai -m window --resize left:50:0
lctrl + alt - h : yabai -m window --resize left:-10:0; \
yabai -m window --resize right:-10:0
lctrl + alt - j : yabai -m window --resize bottom:0:10; \
yabai -m window --resize top:0:10
lctrl + alt - k : yabai -m window --resize top:0:-10; \
yabai -m window --resize bottom:0:-10
lctrl + alt - l : yabai -m window --resize right:10:0; \
yabai -m window --resize left:10:0
lctrl + cmd - e : yabai -m space --balance
# Move Window To Space
lctrl + shift + cmd - m : yabai -m window --space last; yabai -m space --focus last
lctrl + shift + cmd - p : yabai -m window --space prev; yabai -m space --focus prev
lctrl + shift + cmd - n : yabai -m window --space next; yabai -m space --focus next
lctrl + shift + cmd - 1 : yabai -m window --space 1; yabai -m space --focus 1
lctrl + shift + cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2
lctrl + shift + cmd - 3 : yabai -m window --space 3; yabai -m space --focus 3
lctrl + shift + cmd - 4 : yabai -m window --space 4; yabai -m space --focus 4
# Focus Space
# shift + cmd - m : yabai -m space --focus last
# shift + cmd - p : yabai -m space --focus prev
# shift + cmd - n : yabai -m space --focus next
shift + cmd - 1 : yabai -m space --focus 1
shift + cmd - 2 : yabai -m space --focus 2
shift + cmd - 3 : yabai -m space --focus 3
shift + cmd - 4 : yabai -m space --focus 4
# Insert Direction
lctrl + shift + cmd - v : yabai -m window --insert south
lctrl + shift + cmd - b : yabai -m window --insert east
lctrl + shift + cmd - s : yabai -m window --insert stack
# Floating Windows
# shift + cmd - space : \
# yabai -m window --toggle float; \
# yabai -m window --toggle border
shift + cmd - space : yabai -m window --toggle float
# Terminal
shift + cmd - return : ${open-iterm2}/bin/open-iterm2
# Fullscreen
alt - f : yabai -m window --toggle zoom-fullscreen
shift + alt - f : yabai -m window --toggle native-fullscreen
# Restart Yabai
shift + lctrl + alt - r : \
/usr/bin/env osascript <<< \
"display notification \"Restarting Yabai\" with title \"Yabai\""; \
launchctl kickstart -k "gui/$UID/org.nixos.yabai"
# Restart Spacebar
shift + lctrl + alt - s : \
/usr/bin/env osascript <<< \
"display notification \"Restarting Spacebar\" with title \"Spacebar\""; \
launchctl kickstart -k "gui/$UID/org.nixos.spacebar"
'';
};
};
}

View file

@ -0,0 +1,14 @@
# Detects if iTerm2 is running
if ! pgrep -f "iTerm" > /dev/null 2>&1; then
open -a "/Applications/Nix Apps/iTerm2.app"
else
# Create a new window
script='tell application "iTerm2" to create window with default profile'
! osascript -e "${script}" > /dev/null 2>&1 && {
# Get pids for any app with "iTerm" and kill
while IFS="" read -r pid; do
kill -15 "${pid}"
done < <(pgrep -f "iTerm")
open -a "/Applications/Nix Apps/iTerm2.app"
}
fi

View file

@ -0,0 +1,47 @@
{ lib, pkgs, config, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.desktop.addons.spacebar;
in
{
options.plusultra.desktop.addons.spacebar = {
enable = mkEnableOption "Spacebar";
};
config = mkIf cfg.enable {
services.spacebar = {
enable = true;
package = pkgs.spacebar;
config = {
position = "top";
display = "all";
height = 32;
title = "on";
spaces = "on";
clock = "on";
power = "off";
padding_left = 10;
padding_right = 10;
spacing_left = 10;
spacing_right = 10;
foreground_color = "0xffeceff4";
background_color = "0xff1d2128";
text_font = ''"Hack Nerd Font Mono:Regular:14.0"'';
icon_font = ''"Hack Nerd Font Mono:Regular:20.0"'';
# Shell entries apparently break the whole bar...
# https://github.com/cmacrae/spacebar/issues/104
# right_shell_icon = "";
# right_shell_command = ''"whoami"'';
# right_shell = "on";
};
};
};
}

View file

@ -0,0 +1,77 @@
{ lib
, pkgs
, config
, ...
}:
let
cfg = config.plusultra.desktop.yabai;
inherit (lib) types mkEnableOption mkIf;
inherit (lib.plusultra) mkOpt enabled;
in
{
options.plusultra.desktop.yabai = {
enable = mkEnableOption "Yabai";
enable-scripting-addition = mkOpt types.bool true "Whether to enable the scripting addition for Yabai. (Requires SIP to be disabled)";
};
config = mkIf cfg.enable {
plusultra.desktop.addons = {
skhd = enabled;
spacebar = enabled;
};
services.yabai = {
enable = true;
enableScriptingAddition = cfg.enable-scripting-addition;
config = {
layout = "bsp";
auto_balance = "off";
debug_output = "on";
top_padding = 8;
right_padding = 8;
left_padding = 8;
bottom_padding = 8;
window_gap = 6;
window_topmost = "on";
window_shadow = "float";
# As of macOS Sonoma, window borders break Yabai and cause a bunch of lag.
window_border = "off";
# window_border = "on";
# window_border_width = 5;
# window_border_radius = 14;
# window_border_blur = "off";
# window_border_hidpi = "on";
# insert_feedback_color = "0xffb48ead";
# normal_window_border_color = "0x002e3440";
# active_window_border_color = "0xff5e81ac";
external_bar = "all:${builtins.toString config.services.spacebar.config.height}:0";
# mouse_modifier = "alt";
mouse_modifier = "cmd";
mouse_action1 = "move";
mouse_action2 = "resize";
};
extraConfig = ''
yabai -m rule --add label="Finder" app="^Finder$" title="(Co(py|nnect)|Move|Info|Pref)" manage=off
yabai -m rule --add label="Safari" app="^Safari$" title="^(General|(Tab|Password|Website|Extension)s|AutoFill|Se(arch|curity)|Privacy|Advance)$" manage=off
yabai -m rule --add label="System Preferences" app="^System Preferences$" title=".*" manage=off
yabai -m rule --add label="App Store" app="^App Store$" manage=off
yabai -m rule --add label="Activity Monitor" app="^Activity Monitor$" manage=off
yabai -m rule --add label="Calculator" app="^Calculator$" manage=off
yabai -m rule --add label="Dictionary" app="^Dictionary$" manage=off
yabai -m rule --add label="mpv" app="^mpv$" manage=off
yabai -m rule --add label="Software Update" title="Software Update" manage=off
yabai -m rule --add label="About This Mac" app="System Information" title="About This Mac" manage=off
'';
};
};
}

View file

@ -0,0 +1,40 @@
{ options, config, pkgs, lib, inputs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.home;
in
{
# imports = with inputs; [
# home-manager.darwinModules.home-manager
# ];
options.plusultra.home = with types; {
file = mkOpt attrs { }
"A set of files to be managed by home-manager's <option>home.file</option>.";
configFile = mkOpt attrs { }
"A set of files to be managed by home-manager's <option>xdg.configFile</option>.";
extraOptions = mkOpt attrs { } "Options to pass directly to home-manager.";
homeConfig = mkOpt attrs { } "Final config for home-manager.";
};
config = {
plusultra.home.extraOptions = {
home.stateVersion = mkDefault "22.11";
home.file = mkAliasDefinitions options.plusultra.home.file;
xdg.enable = true;
xdg.configFile = mkAliasDefinitions options.plusultra.home.configFile;
};
snowfallorg.user.${config.plusultra.user.name}.home.config = mkAliasDefinitions options.plusultra.home.extraOptions;
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
# users.${config.plusultra.user.name} = args:
# mkAliasDefinitions options.plusultra.home.extraOptions;
};
};
}

View file

@ -0,0 +1,74 @@
{ options
, config
, pkgs
, lib
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.nix;
in
{
options.plusultra.nix = with types; {
enable = mkBoolOpt true "Whether or not to manage nix configuration.";
package = mkOpt package pkgs.nixUnstable "Which nix package to use.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
deploy-rs
nixfmt
nix-index
nix-prefetch-git
];
nix =
let
users = [ "root" config.plusultra.user.name ];
in
{
package = cfg.package;
settings = {
experimental-features = "nix-command flakes";
http-connections = 50;
warn-dirty = false;
log-lines = 50;
# Large builds apparently fail due to an issue with darwin:
# https://github.com/NixOS/nix/issues/4119
sandbox = false;
# This appears to break on darwin
# https://github.com/NixOS/nix/issues/7273
auto-optimise-store = false;
allow-import-from-derivation = true;
trusted-users = users;
allowed-users = users;
# NOTE: This configuration is generated by nix-installer so I'm adding it here in
# case it becomes important.
extra-nix-path = "nixpkgs=flake:nixpkgs";
build-users-group = "nixbld";
};
#// (lib.optionalAttrs config.plusultra.tools.direnv.enable {
# keep-outputs = true;
# keep-derivations = true;
#});
gc = {
automatic = true;
interval = { Day = 7; };
options = "--delete-older-than 30d";
user = config.plusultra.user.name;
};
# flake-utils-plus
generateRegistryFromInputs = true;
generateNixPathFromInputs = true;
linkInputs = true;
};
};
}

View file

@ -0,0 +1,84 @@
{ lib, config, pkgs, inputs, ... }:
let
inherit (lib) types mkEnableOption mkIf;
inherit (lib.plusultra) mkOpt;
cfg = config.plusultra.security.gpg;
gpgConf = "${inputs.gpg-base-conf}/gpg.conf";
gpgAgentConf = ''
enable-ssh-support
default-cache-ttl 60
max-cache-ttl 120
'';
guide = "${inputs.yubikey-guide}/README.md";
theme = pkgs.fetchFromGitHub {
owner = "jez";
repo = "pandoc-markdown-css-theme";
rev = "019a4829242937761949274916022e9861ed0627";
sha256 = "1h48yqffpaz437f3c9hfryf23r95rr319lrb3y79kxpxbc9hihxb";
};
guideHTML = pkgs.runCommand "yubikey-guide" { } ''
${pkgs.pandoc}/bin/pandoc \
--standalone \
--metadata title="Yubikey Guide" \
--from markdown \
--to html5+smart \
--toc \
--template ${theme}/template.html5 \
--css ${theme}/docs/css/theme.css \
--css ${theme}/docs/css/skylighting-solarized-theme.css \
-o $out \
${guide}
'';
reload-yubikey = pkgs.writeShellScriptBin "reload-yubikey" ''
${pkgs.gnupg}/bin/gpg-connect-agent "scd serialno" "learn --force" /bye
'';
in
{
options.plusultra.security.gpg = {
enable = mkEnableOption "GPG";
agentTimeout = mkOpt types.int 5 "The amount of time to wait before continuing with shell init.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
gnupg
];
environment.shellInit = ''
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)
${pkgs.coreutils}/bin/timeout ${builtins.toString cfg.agentTimeout} ${pkgs.gnupg}/bin/gpgconf --launch gpg-agent
gpg_agent_timeout_status=$?
if [ "$gpg_agent_timeout_status" = 124 ]; then
# Command timed out...
echo "GPG Agent timed out..."
echo 'Run "gpgconf --launch gpg-agent" to try and launch it again.'
fi
'';
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
plusultra.home.file = {
".gnupg/.keep".text = "";
".gnupg/yubikey-guide.md".source = guide;
".gnupg/yubikey-guide.html".source = guideHTML;
".gnupg/gpg.conf".source = gpgConf;
".gnupg/gpg-agent.conf".text = gpgAgentConf;
};
};
}

View file

@ -0,0 +1,17 @@
{ lib, config, ... }:
let
inherit (lib) types mkIf;
inherit (lib.plusultra) mkOpt enabled;
cfg = config.plusultra.services.nix-daemon;
in
{
options.plusultra.services.nix-daemon = {
enable = mkOpt types.bool true "Whether to enable the Nix daemon.";
};
config = mkIf cfg.enable {
services.nix-daemon = enabled;
};
}

View file

@ -0,0 +1,43 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.suites.common;
in
{
options.plusultra.suites.common = with types; {
enable = mkBoolOpt false "Whether or not to enable common configuration.";
};
config = mkIf cfg.enable {
programs.zsh = enabled;
plusultra = {
nix = enabled;
apps = {
iterm2 = enabled;
};
cli-apps = {
neovim = enabled;
};
tools = {
git = enabled;
flake = enabled;
};
system = {
fonts = enabled;
input = enabled;
interface = enabled;
};
security = {
gpg = enabled;
};
};
};
}

View file

@ -0,0 +1,35 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.suites.development;
in
{
options.plusultra.suites.development = with types; {
enable = mkBoolOpt false
"Whether or not to enable common development configuration.";
};
config = mkIf cfg.enable {
plusultra = {
apps = {
vscode = enabled;
};
tools = {
# at = enabled;
# direnv = enabled;
# go = enabled;
# http = enabled;
# k8s = enabled;
node = enabled;
# titan = enabled;
python = enabled;
java = enabled;
};
# virtualisation = { podman = enabled; };
};
};
}

View file

@ -0,0 +1,32 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.system.fonts;
in
{
options.plusultra.system.fonts = with types; {
enable = mkBoolOpt false "Whether or not to manage fonts.";
fonts = mkOpt (listOf package) [ ] "Custom font packages to install.";
};
config = mkIf cfg.enable {
environment.variables = {
# Enable icons in tooling since we have nerdfonts.
LOG_ICONS = "true";
};
fonts = {
fontDir = enabled;
fonts = with pkgs;
[
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji
(nerdfonts.override { fonts = [ "Hack" ]; })
] ++ cfg.fonts;
};
};
}

View file

@ -0,0 +1 @@
{ "~a" = (); "~b" = (); "~c" = (); "~d" = (); "~e" = (); "~f" = (); "~g" = (); "~h" = (); "~i" = (); "~j" = (); "~k" = (); "~l" = (); "~m" = (); "~n" = (); "~o" = (); "~p" = (); "~q" = (); "~r" = (); "~s" = (); "~t" = (); "~u" = (); "~v" = (); "~w" = (); "~x" = (); "~y" = (); "~z" = (); }

View file

@ -0,0 +1,55 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.system.input;
in
{
options.plusultra.system.input = with types; {
enable = mkEnableOption "macOS input";
};
config = mkIf cfg.enable (mkMerge [
{
system = {
keyboard = {
enableKeyMapping = true;
remapCapsLockToEscape = true;
};
defaults = {
".GlobalPreferences" = {
"com.apple.mouse.scaling" = "1";
};
NSGlobalDomain = {
AppleKeyboardUIMode = 3;
ApplePressAndHoldEnabled = false;
KeyRepeat = 2;
InitialKeyRepeat = 15;
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = false;
NSAutomaticQuoteSubstitutionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticSpellingCorrectionEnabled = false;
};
};
};
snowfallorg.user.${config.plusultra.user.name}.home.config = {
home.activation = {
# Disable special keys when using Option as a modifier.
# https://superuser.com/questions/941286/disable-default-option-key-binding
disableSpecialKeys = lib.home-manager.hm.dag.entryAfter [ "writeBoundary" ] ''
set +e
$DRY_RUN_CMD /usr/bin/sudo mkdir -p $HOME/Library/KeyBindings
$DRY_RUN_CMD /usr/bin/sudo cp '${builtins.toPath ./DefaultKeyBinding.dict}' "$HOME/Library/KeyBindings/DefaultKeyBinding.dict"
set -e
'';
};
};
}
]);
}

View file

@ -0,0 +1,29 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.system.interface;
in
{
options.plusultra.system.interface = with types; {
enable = mkEnableOption "macOS interface";
};
config = mkIf cfg.enable {
system.defaults = {
dock.autohide = true;
finder = {
AppleShowAllExtensions = true;
FXEnableExtensionChangeWarning = false;
};
NSGlobalDomain = {
_HIHideMenuBar = true;
AppleShowScrollBars = "Always";
};
};
plusultra.home.file.".hushlogin".text = "";
};
}

View file

@ -0,0 +1,18 @@
{ lib, config, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.tools.flake;
in
{
options.plusultra.tools.flake = {
enable = mkEnableOption "Flake";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
snowfallorg.flake
];
};
}

View file

@ -0,0 +1,43 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.tools.git;
gpg = config.plusultra.security.gpg;
user = config.plusultra.user;
in
{
options.plusultra.tools.git = with types; {
enable = mkBoolOpt false "Whether or not to install and configure git.";
userName = mkOpt types.str user.fullName "The name to configure git with.";
userEmail = mkOpt types.str user.email "The email to configure git with.";
signingKey =
mkOpt types.str "9762169A1B35EA68" "The key ID to sign commits with.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ git ];
plusultra.home.extraOptions = {
programs.git = {
enable = true;
inherit (cfg) userName userEmail;
lfs = enabled;
signing = {
key = cfg.signingKey;
signByDefault = mkIf gpg.enable true;
};
extraConfig = {
init = { defaultBranch = "main"; };
pull = { rebase = true; };
push = { autoSetupRemote = true; };
core = { whitespace = "trailing-space,space-before-tab"; };
safe = {
directory = "${config.users.users.${user.name}.home}/work/config";
};
};
};
};
};
}

View file

@ -0,0 +1,17 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.tools.java;
in
{
options.plusultra.tools.java = with types; {
enable = mkBoolOpt false "Whether or not to enable Java.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
jdk
];
};
}

View file

@ -0,0 +1,42 @@
{ options
, config
, pkgs
, lib
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.tools.node;
in
{
options.plusultra.tools.node = with types; {
enable = mkBoolOpt false "Whether or not to install and configure git";
pkg = mkOpt package pkgs.nodejs "The NodeJS package to use";
prettier = {
enable = mkBoolOpt true "Whether or not to install Prettier";
pkg =
mkOpt package pkgs.nodePackages.prettier "The NodeJS package to use";
};
yarn = {
enable = mkBoolOpt true "Whether or not to install Yarn";
pkg = mkOpt package pkgs.nodePackages.yarn "The NodeJS package to use";
};
pnpm = {
enable = mkBoolOpt true "Whether or not to install Pnpm";
pkg = mkOpt package pkgs.nodePackages.pnpm "The NodeJS package to use";
};
flyctl = {
enable = mkBoolOpt true "Whether or not to install flyctl";
pkg = mkOpt package pkgs.flyctl "The flyctl package to use";
};
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs;
[ cfg.pkg ]
++ (lib.optional cfg.prettier.enable cfg.prettier.pkg)
++ (lib.optional cfg.yarn.enable cfg.yarn.pkg)
++ (lib.optional cfg.pnpm.enable cfg.pnpm.pkg)
++ (lib.optional cfg.flyctl.enable cfg.flyctl.pkg);
};
}

View file

@ -0,0 +1,22 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.tools.python;
in
{
options.plusultra.tools.python = with types; {
enable = mkBoolOpt false "Whether or not to enable Python.";
};
config =
mkIf cfg.enable {
environment.systemPackages = with pkgs; [
(python311.withPackages (ps:
with ps; [
numpy
])
)
];
};
}

View file

@ -0,0 +1,45 @@
{ lib
, config
, pkgs
, ...
}:
let
inherit (lib) types mkIf mkDefault;
inherit (lib.plusultra) mkOpt;
cfg = config.plusultra.user;
is-linux = pkgs.stdenv.isLinux;
is-darwin = pkgs.stdenv.isDarwin;
in
{
options.plusultra.user = {
name = mkOpt types.str "short" "The user account.";
fullName = mkOpt types.str "Jake Hamilton" "The full name of the user.";
email = mkOpt types.str "jake.hamilton@hey.com" "The email of the user.";
uid = mkOpt (types.nullOr types.int) 501 "The uid for the user account.";
};
config = {
users.users.${cfg.name} = {
# NOTE: Setting the uid here is required for another
# module to evaluate successfully since it reads
# `users.users.${plusultra.user.name}.uid`.
uid = mkIf (cfg.uid != null) cfg.uid;
};
snowfallorg.user.${config.plusultra.user.name}.home.config = {
home = {
file = {
".profile".text = ''
# The default file limit is far too low and throws an error when rebuilding the system.
# See the original with: ulimit -Sa
ulimit -n 4096
'';
};
};
};
};
}

View file

@ -0,0 +1,27 @@
{ lib
, config
, pkgs
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.plusultra.cli-apps.bash;
in
{
options.plusultra.cli-apps.bash = {
enable = mkEnableOption "BASH shell";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
bashInteractive
];
programs.bash = {
enable = true;
initExtra = ''
function msh() { mosh "$@" -- bash -c 'if type -f tmux; then tmux new-session -A -s 0; else screen -R; fi;' ; };
'';
};
};
}

View file

@ -0,0 +1,22 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.bat;
in
{
options.plusultra.cli-apps.bat = {
enable = mkEnableOption "bat";
};
config = mkIf cfg.enable {
programs.bat = {
enable = true;
config.theme = "ansi";
extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ];
};
};
}

View file

@ -0,0 +1,53 @@
{ lib
, config
, pkgs
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.plusultra.cli-apps.fish;
in
{
options.plusultra.cli-apps.fish = {
enable = mkEnableOption "FISH shell";
};
config = mkIf cfg.enable {
programs.fish = {
enable = true;
interactiveShellInit = ''
function msh --wraps mosh --description 'mosh with tmux'
if not set -q argv[1]
echo 'Usage: msh [user@]host [command]'
else
${pkgs.mosh}/bin/mosh $argv -- tmux new-session -A -s 0
end
end
'';
plugins = [{
name = "foreign-env";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "plugin-foreign-env";
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
};
}];
shellInit =
''
# nix
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
end
# home-manager
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
end
'';
};
};
}

View file

@ -0,0 +1,49 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.git;
in
{
options.plusultra.cli-apps.git = {
enable = mkEnableOption "git";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
delta
gh
];
programs.git = {
enable = true;
userName = "Harald Hoyer";
userEmail = "harald@hoyer.xyz";
extraConfig = {
init.defaultBranch = "main";
"credential \"https://github.com\"" = {
helper = "!gh auth git-credential";
};
alias = {
co = "checkout";
ci = "commit";
};
pull.ff = "only";
core.pager = "delta";
delta = {
features = "side-by-side line-numbers decorations";
syntax-theme = "DarkNeon";
light = "false";
line-numbers = "true";
navigate = "true";
};
interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
merge.conflictStyle = "diff3";
diff.colorMoved = "default";
};
};
};
}

View file

@ -0,0 +1,33 @@
{ lib, config, pkgs, ... }:
let
inherit (lib) mkEnableOption mkIf;
inherit (lib.plusultra) enabled;
cfg = config.plusultra.cli-apps.home-manager;
in
{
options.plusultra.cli-apps.home-manager = {
enable = mkEnableOption "home-manager";
};
config = mkIf cfg.enable {
programs.home-manager = enabled;
home.sessionVariables = {
EDITOR = "${pkgs.vim}/bin/vim";
BATDIFF_USE_DELTA = "true";
};
home.shellAliases = {
cat = "${pkgs.bat}/bin/bat --decorations never";
less = ''${pkgs.bat}/bin/bat --decorations never --paging=always --pager "${pkgs.less}/bin/less -RF"'';
man = "${pkgs.bat-extras.batman}/bin/batman";
};
home.packages = with pkgs; [
bat
vim
cachix
];
};
}

View file

@ -0,0 +1,230 @@
{ lib, config, pkgs, ... }:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.plusultra.cli-apps.neovim;
in
{
options.plusultra.cli-apps.neovim = {
enable = mkEnableOption "Neovim";
};
config = mkIf cfg.enable {
programs.neovim-flake = {
enable = true;
# your settings need to go into the settings attrset
settings = {
vim = {
viAlias = false;
vimAlias = false;
debugMode = {
enable = false;
level = 20;
logFile = "/tmp/nvim.log";
};
};
vim.lsp = {
formatOnSave = true;
lspkind.enable = false;
lightbulb.enable = true;
lspsaga.enable = false;
nvimCodeActionMenu.enable = true;
trouble.enable = true;
lspSignature.enable = true;
lsplines.enable = true;
};
vim.debugger = {
nvim-dap = {
enable = true;
ui.enable = true;
};
};
vim.languages = {
enableLSP = true;
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;
nix = {
enable = true;
format.type = "nixpkgs-fmt";
};
html.enable = true;
clang = {
enable = true;
lsp.server = "clangd";
};
sql.enable = false;
rust = {
enable = true;
crates.enable = true;
};
java.enable = true;
ts.enable = true;
svelte.enable = true;
go.enable = true;
zig.enable = true;
python.enable = true;
dart.enable = true;
elixir.enable = false;
};
vim.visuals = {
enable = true;
nvimWebDevicons.enable = true;
scrollBar.enable = true;
smoothScroll.enable = true;
cellularAutomaton.enable = true;
fidget-nvim.enable = true;
indentBlankline = {
enable = true;
fillChar = null;
eolChar = null;
showCurrContext = true;
};
cursorline = {
enable = true;
lineTimeout = 0;
};
};
vim.statusline = {
lualine = {
enable = true;
theme = "catppuccin";
};
};
vim.theme = {
enable = true;
name = "catppuccin";
style = "mocha";
transparent = false;
};
vim.autopairs.enable = true;
vim.autocomplete = {
enable = true;
type = "nvim-cmp";
};
vim.filetree = {
nvimTree = {
enable = true;
};
};
vim.tabline = {
nvimBufferline.enable = true;
};
vim.treesitter.context.enable = true;
vim.binds = {
whichKey.enable = true;
cheatsheet.enable = true;
};
vim.telescope.enable = true;
vim.git = {
enable = true;
gitsigns.enable = true;
gitsigns.codeActions = false; # throws an annoying debug message
};
vim.minimap = {
minimap-vim.enable = false;
codewindow.enable = true; # lighter, faster, and uses lua for configuration
};
vim.dashboard = {
dashboard-nvim.enable = false;
alpha.enable = true;
};
vim.notify = {
nvim-notify.enable = true;
};
vim.projects = {
project-nvim.enable = true;
};
vim.utility = {
ccc.enable = true;
vim-wakatime.enable = false;
icon-picker.enable = true;
surround.enable = true;
diffview-nvim.enable = true;
motion = {
hop.enable = true;
leap.enable = true;
};
};
vim.notes = {
obsidian.enable = false; # FIXME neovim fails to build if obsidian is enabled
orgmode.enable = false;
mind-nvim.enable = true;
todo-comments.enable = true;
};
vim.terminal = {
toggleterm = {
enable = true;
lazygit.enable = true;
};
};
vim.ui = {
borders.enable = true;
noice.enable = true;
colorizer.enable = true;
modes-nvim.enable = false; # the theme looks terrible with catppuccin
illuminate.enable = true;
breadcrumbs = {
enable = true;
navbuddy.enable = true;
};
smartcolumn = {
enable = true;
columnAt.languages = {
# this is a freeform module, it's `buftype = int;` for configuring column position
nix = 110;
ruby = 120;
java = 130;
go = [ 90 130 ];
};
};
};
vim.assistant = {
copilot = {
enable = true;
cmp.enable = true;
};
};
vim.session = {
nvim-session-manager.enable = false;
};
vim.gestures = {
gesture-nvim.enable = false;
};
vim.comments = {
comment-nvim.enable = true;
};
vim.spellChecking.languages = [ "en" "de" ];
};
};
};
}

View file

@ -0,0 +1,32 @@
{ lib
, config
, pkgs
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.plusultra.cli-apps.starship;
in
{
options.plusultra.cli-apps.starship = {
enable = mkEnableOption "starship";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "JetBrainsMono" ]; })
];
programs.starship = {
enable = true;
settings = {
container.format = "[\\[$name\\]]($style) ";
git_status = {
ahead = "$\{count}";
diverged = "$\{ahead_count}$\{behind_count}";
behind = "$\{count}";
};
};
};
};
}

View file

@ -0,0 +1,20 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.tmux;
in
{
options.plusultra.cli-apps.tmux = {
enable = mkEnableOption "Tmux";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
tmux
];
};
}

View file

@ -0,0 +1,11 @@
{ lib, config, pkgs, host ? null, format ? "unknown", ... }:
let
inherit (lib) types;
inherit (lib.plusultra) mkOpt;
in
{
options.plusultra.host = {
name = mkOpt (types.nullOr types.str) host "The host name.";
};
}

View file

@ -0,0 +1,18 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.tools.direnv;
in
{
options.plusultra.tools.direnv = with types; {
enable = mkBoolOpt false "Whether or not to enable direnv.";
};
config = mkIf cfg.enable {
programs.direnv = {
enable = true;
nix-direnv = enabled;
};
};
}

View file

@ -0,0 +1,40 @@
{ lib, config, pkgs, ... }:
let
inherit (lib) types mkEnableOption mkIf;
inherit (lib.plusultra) mkOpt enabled;
cfg = config.plusultra.tools.git;
user = config.plusultra.user;
in
{
options.plusultra.tools.git = {
enable = mkEnableOption "Git";
userName = mkOpt types.str user.fullName "The name to configure git with.";
userEmail = mkOpt types.str user.email "The email to configure git with.";
signingKey =
mkOpt types.str "9762169A1B35EA68" "The key ID to sign commits with.";
signByDefault = mkOpt types.bool true "Whether to sign commits by default.";
};
config = mkIf cfg.enable {
programs.git = {
enable = true;
inherit (cfg) userName userEmail;
lfs = enabled;
signing = {
key = cfg.signingKey;
inherit (cfg) signByDefault;
};
extraConfig = {
init = { defaultBranch = "main"; };
pull = { rebase = true; };
push = { autoSetupRemote = true; };
core = { whitespace = "trailing-space,space-before-tab"; };
safe = {
directory = "${user.home}/work/config";
};
};
};
};
}

View file

@ -0,0 +1,21 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.tools.jetbrains;
in
{
options.plusultra.tools.jetbrains = with types; {
enable = mkBoolOpt false "Whether or not to enable jetbrains.";
};
config = mkIf cfg.enable {
home.sessionPath = [
"$HOME/.local/share/JetBrains/Toolbox/scripts"
];
home.packages = with pkgs; [
jetbrains-toolbox
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "JetBrainsMono" ]; })
];
};
}

View file

@ -0,0 +1,20 @@
{ lib, config, pkgs, ... }:
let
inherit (lib) types mkEnableOption mkIf;
cfg = config.plusultra.tools.ssh;
in
{
options.plusultra.tools.ssh = {
enable = mkEnableOption "SSH";
};
config = mkIf cfg.enable {
programs.ssh = {
extraConfig = ''
Host *
HostKeyAlgorithms +ssh-rsa
'';
};
};
}

View file

@ -0,0 +1,50 @@
{ lib, config, pkgs, osConfig ? { }, ... }:
let
inherit (lib) types mkIf mkDefault mkMerge;
inherit (lib.plusultra) mkOpt;
cfg = config.plusultra.user;
is-linux = pkgs.stdenv.isLinux;
is-darwin = pkgs.stdenv.isDarwin;
home-directory =
if cfg.name == null then
null
else if is-darwin then
"/Users/${cfg.name}"
else
"/home/${cfg.name}";
in
{
options.plusultra.user = {
enable = mkOpt types.bool false "Whether to configure the user account.";
name = mkOpt (types.nullOr types.str) config.snowfallorg.user.name "The user account.";
fullName = mkOpt types.str "Jake Hamilton" "The full name of the user.";
email = mkOpt types.str "jake.hamilton@hey.com" "The email of the user.";
home = mkOpt (types.nullOr types.str) home-directory "The user's home directory.";
};
config = mkIf cfg.enable (mkMerge [
{
assertions = [
{
assertion = cfg.name != null;
message = "plusultra.user.name must be set";
}
{
assertion = cfg.home != null;
message = "plusultra.user.home must be set";
}
];
home = {
username = mkDefault cfg.name;
homeDirectory = mkDefault cfg.home;
};
}
]);
}

View file

@ -0,0 +1,23 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps._1password;
in
{
options.plusultra.apps._1password = with types; {
enable = mkBoolOpt false "Whether or not to enable 1password.";
};
config = mkIf cfg.enable {
programs = {
_1password = enabled;
_1password-gui = {
enable = true;
polkitPolicyOwners = [ config.plusultra.user.name ];
};
};
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.ardour;
in
{
options.plusultra.apps.ardour = with types; {
enable = mkBoolOpt false "Whether or not to enable Ardour.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ ardour ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.blender;
in
{
options.plusultra.apps.blender = with types; {
enable = mkBoolOpt false "Whether or not to enable Blender.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ blender ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.bottles;
in
{
options.plusultra.apps.bottles = with types; {
enable = mkBoolOpt false "Whether or not to enable Bottles.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ bottles ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.cadence;
in
{
options.plusultra.apps.cadence = with types; {
enable = mkBoolOpt false "Whether or not to enable Cadence.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ cadence ]; };
}

View file

@ -0,0 +1,41 @@
{ options, config, lib, pkgs, inputs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.discord;
discord = lib.replugged.makeDiscordPlugged {
inherit pkgs;
# This is currently broken, but could speed up Discord startup in the future.
withOpenAsar = false;
plugins = {
inherit (inputs) discord-tweaks;
};
themes = {
inherit (inputs) discord-nord-theme;
};
};
in
{
options.plusultra.apps.discord = with types; {
enable = mkBoolOpt false "Whether or not to enable Discord.";
canary.enable = mkBoolOpt false "Whether or not to enable Discord Canary.";
chromium.enable = mkBoolOpt false
"Whether or not to enable the Chromium version of Discord.";
firefox.enable = mkBoolOpt false
"Whether or not to enable the Firefox version of Discord.";
native.enable = mkBoolOpt false "Whether or not to enable the native version of Discord.";
};
config = mkIf (cfg.enable or cfg.chromium.enable) {
environment.systemPackages =
lib.optional cfg.enable discord
++ lib.optional cfg.canary.enable pkgs.plusultra.discord
++ lib.optional cfg.chromium.enable pkgs.plusultra.discord-chromium
++ lib.optional cfg.firefox.enable pkgs.plusultra.discord-firefox
++ lib.optional cfg.native.enable pkgs.discord;
};
}

View file

@ -0,0 +1,18 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.dolphin;
in
{
options.plusultra.apps.dolphin = with types; {
enable = mkBoolOpt false "Whether or not to enable Dolphin.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ dolphin-emu ];
# Enable GameCube controller support.
services.udev.packages = [ pkgs.dolphinEmu ];
};
}

View file

@ -0,0 +1,30 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.doukutsu-rs;
desktopItem = pkgs.makeDesktopItem {
name = "doukutsu-rs";
desktopName = "doukutsu-rs";
genericName =
"A fully playable re-implementation of Cave Story (Doukutsu Monogatari) engine written in Rust.";
exec = "${pkgs.plusultra.doukutsu-rs}/bin/doukutsu-rs";
icon = ./icon.png;
type = "Application";
categories = [ "Game" "AdventureGame" ];
terminal = false;
};
in
{
options.plusultra.apps.doukutsu-rs = with types; {
enable = mkBoolOpt false "Whether or not to enable doukutsu-rs.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs.plusultra; [
doukutsu-rs
desktopItem
];
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.element;
in
{
options.plusultra.apps.element = with types; {
enable = mkBoolOpt false "Whether or not to enable Element.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ element-desktop ];
};
}

View file

@ -0,0 +1,22 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.etcher;
in
{
options.plusultra.apps.etcher = with types; {
enable = mkBoolOpt false "Whether or not to enable etcher.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs;
[
# Etcher is currently broken in nixpkgs, temporarily replaced with
# gnome disk utility.
# etcher
gnome.gnome-disk-utility
];
};
}

View file

@ -0,0 +1,35 @@
{ lib, config, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.expressvpn;
in
{
options.plusultra.apps.expressvpn = {
enable = mkEnableOption "Express VPN";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
plusultra.expressvpn
] ++ optionals config.plusultra.desktop.gnome.enable [
gnomeExtensions.evpn-shell-assistant
];
boot.kernelModules = [ "tun" ];
systemd.services.expressvpn = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "network-online.target" ];
description = "ExpressVPN Daemon";
serviceConfig = {
ExecStart = "${pkgs.plusultra.expressvpn}/bin/expressvpnd";
Restart = "on-failure";
RestartSec = 5;
};
};
};
}

View file

@ -0,0 +1,66 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.firefox;
defaultSettings = {
"browser.aboutwelcome.enabled" = false;
"browser.meta_refresh_when_inactive.disabled" = true;
"browser.startup.homepage" = "https://hamho.me";
"browser.bookmarks.showMobileBookmarks" = true;
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.aboutConfig.showWarning" = false;
"browser.ssb.enabled" = true;
};
in
{
options.plusultra.apps.firefox = with types; {
enable = mkBoolOpt false "Whether or not to enable Firefox.";
extraConfig =
mkOpt str "" "Extra configuration for the user profile JS file.";
userChrome =
mkOpt str "" "Extra configuration for the user chrome CSS file.";
settings = mkOpt attrs defaultSettings "Settings to apply to the profile.";
};
config = mkIf cfg.enable {
plusultra.desktop.addons.firefox-nordic-theme = enabled;
services.gnome.gnome-browser-connector.enable = config.plusultra.desktop.gnome.enable;
plusultra.home = {
file = {
".mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json".source = "${pkgs.browserpass}/lib/mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json";
".mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = mkIf config.plusultra.desktop.gnome.enable "${pkgs.chrome-gnome-shell}/lib/mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
};
extraOptions = {
programs.firefox = {
enable = true;
package = pkgs.firefox.override (
{
cfg = {
enableBrowserpass = true;
enableGnomeExtensions = config.plusultra.desktop.gnome.enable;
};
extraNativeMessagingHosts =
optional
config.plusultra.desktop.gnome.enable
pkgs.gnomeExtensions.gsconnect;
}
);
profiles.${config.plusultra.user.name} = {
inherit (cfg) extraConfig userChrome settings;
id = 0;
name = config.plusultra.user.name;
};
};
};
};
};
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.frappe-books;
in
{
options.plusultra.apps.frappe-books = with types; {
enable = mkBoolOpt false "Whether or not to enable FrappeBooks.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ plusultra.frappe-books ];
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.freetube;
in
{
options.plusultra.apps.freetube = with types; {
enable = mkBoolOpt false "Whether or not to enable FreeTube.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ freetube ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.gimp;
in
{
options.plusultra.apps.gimp = with types; {
enable = mkBoolOpt false "Whether or not to enable Gimp.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ gimp ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.gparted;
in
{
options.plusultra.apps.gparted = with types; {
enable = mkBoolOpt false "Whether or not to enable gparted.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ gparted ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.hey;
in
{
options.plusultra.apps.hey = with types; {
enable = mkBoolOpt false "Whether or not to enable HEY.";
};
config = mkIf cfg.enable { environment.systemPackages = with pkgs.plusultra; [ hey ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.inkscape;
in
{
options.plusultra.apps.inkscape = with types; {
enable = mkBoolOpt false "Whether or not to enable Inkscape.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ inkscape-with-extensions google-fonts ];
};
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.logseq;
in
{
options.plusultra.apps.logseq = with types; {
enable = mkBoolOpt false "Whether or not to enable logseq.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ logseq ]; };
}

View file

@ -0,0 +1,9 @@
[input]
escapeKey=56
rawMouse=yes
mouseSens=6
[win]
size=1920x1080
autoResize=yes
quickSplash=yes

View file

@ -0,0 +1,23 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.looking-glass-client;
user = config.plusultra.user;
in
{
options.plusultra.apps.looking-glass-client = with types; {
enable =
mkBoolOpt false "Whether or not to enable the Looking Glass client.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ looking-glass-client ];
environment.etc."looking-glass-client.ini" = {
user = "+${toString config.users.users.${user.name}.uid}";
source = ./client.ini;
};
};
}

View file

@ -0,0 +1,21 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.lutris;
in
{
options.plusultra.apps.lutris = with types; {
enable = mkBoolOpt false "Whether or not to enable Lutris.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
lutris
# Needed for some installers like League of Legends
openssl
gnome.zenity
];
};
}

View file

@ -0,0 +1,25 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.obs;
in
{
options.plusultra.apps.obs = with types; {
enable = mkBoolOpt false "Whether or not to enable support for OBS.";
};
config = mkIf cfg.enable {
environment.systemPackages = [
(pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-multi-rtmp
obs-move-transition
looking-glass-obs
];
})
];
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.pcsx2;
in
{
options.plusultra.apps.pcsx2 = with types; {
enable = mkBoolOpt false "Whether or not to enable PCSX2.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ pcsx2 ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.pitivi;
in
{
options.plusultra.apps.pitivi = with types; {
enable = mkBoolOpt false "Whether or not to enable Pitivi.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ pitivi ]; };
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.pocketcasts;
in
{
options.plusultra.apps.pocketcasts = with types; {
enable = mkBoolOpt false "Whether or not to enable Pocketcasts.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs.plusultra; [ pocketcasts ];
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.prismlauncher;
in
{
options.plusultra.apps.prismlauncher = with types; {
enable = mkBoolOpt false "Whether or not to enable Prism Launcher.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ prismlauncher ]; };
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.protontricks;
in
{
options.plusultra.apps.protontricks = with types; {
enable = mkBoolOpt false "Whether or not to enable Protontricks.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ protontricks ];
};
}

View file

@ -0,0 +1,18 @@
{ options
, config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.apps.r2modman;
in
{
options.plusultra.apps.r2modman = with types; {
enable = mkBoolOpt false "Whether or not to enable r2modman.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ r2modman ]; };
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.rpcs3;
in
{
options.plusultra.apps.rpcs3 = with types; {
enable = mkBoolOpt false "Whether or not to enable rpcs3.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ rpcs3 ];
};
}

View file

@ -0,0 +1,30 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.steam;
in
{
options.plusultra.apps.steam = with types; {
enable = mkBoolOpt false "Whether or not to enable support for Steam.";
};
config = mkIf cfg.enable {
programs.steam.enable = true;
programs.steam.remotePlay.openFirewall = true;
hardware.steam-hardware.enable = true;
# Enable GameCube controller support.
services.udev.packages = [ pkgs.dolphinEmu ];
environment.systemPackages = with pkgs.plusultra; [
steam
];
environment.sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "$HOME/.steam/root/compatibilitytools.d";
};
};
}

View file

@ -0,0 +1,18 @@
{ lib, pkgs, config, ... }:
let
cfg = config.plusultra.apps.steamtinkerlaunch;
inherit (lib) mkIf mkEnableOption;
in
{
options.plusultra.apps.steamtinkerlaunch = {
enable = mkEnableOption "Steam Tinker Launch";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
steamtinkerlaunch
];
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.twitter;
in
{
options.plusultra.apps.twitter = with types; {
enable = mkBoolOpt false "Whether or not to enable Twitter.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs.plusultra; [ twitter ]; };
}

View file

@ -0,0 +1,23 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.ubports-installer;
in
{
options.plusultra.apps.ubports-installer = with types; {
enable = mkBoolOpt false "Whether or not to enable the UBPorts Installer.";
};
config =
mkIf cfg.enable {
environment.systemPackages = with pkgs.plusultra; [
ubports-installer
];
services.udev.packages = with pkgs.plusultra; [
ubports-installer-udev-rules
];
};
}

View file

@ -0,0 +1,21 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.virtualbox;
in
{
options.plusultra.apps.virtualbox = with types; {
enable = mkBoolOpt false "Whether or not to enable Virtualbox.";
};
config = mkIf cfg.enable {
virtualisation.virtualbox.host = {
enable = true;
enableExtensionPack = true;
};
plusultra.user.extraGroups = [ "vboxusers" ];
};
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.vlc;
in
{
options.plusultra.apps.vlc = with types; {
enable = mkBoolOpt false "Whether or not to enable vlc.";
};
config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ vlc ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.vscode;
in
{
options.plusultra.apps.vscode = with types; {
enable = mkBoolOpt false "Whether or not to enable vscode.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ vscode ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.winetricks;
in
{
options.plusultra.apps.winetricks = with types; {
enable = mkBoolOpt false "Whether or not to enable Winetricks.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ winetricks ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.yt-music;
in
{
options.plusultra.apps.yt-music = with types; {
enable = mkBoolOpt false "Whether or not to enable YouTube Music.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs.plusultra; [ yt-music ]; };
}

View file

@ -0,0 +1,17 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.yubikey;
in
{
options.plusultra.apps.yubikey = with types; {
enable = mkBoolOpt false "Whether or not to enable Yubikey.";
};
config = mkIf cfg.enable {
services.yubikey-agent.enable = true;
environment.systemPackages = with pkgs; [ yubikey-manager-qt ];
};
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.yuzu;
in
{
options.plusultra.apps.yuzu = with types; {
enable = mkBoolOpt false "Whether or not to enable Yuzu.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ yuzu-mainline ];
};
}

View file

@ -0,0 +1,22 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.archetypes.gaming;
in
{
options.plusultra.archetypes.gaming = with types; {
enable = mkBoolOpt false "Whether or not to enable the gaming archetype.";
};
config = mkIf cfg.enable {
plusultra.suites = {
common = enabled;
desktop = enabled;
games = enabled;
social = enabled;
media = enabled;
};
};
}

View file

@ -0,0 +1,26 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.archetypes.server;
in
{
options.plusultra.archetypes.server = with types; {
enable =
mkBoolOpt false "Whether or not to enable the server archetype.";
};
config = mkIf cfg.enable {
plusultra = {
suites = {
common-slim = enabled;
};
cli-apps = {
neovim = enabled;
tmux = enabled;
};
};
};
}

View file

@ -0,0 +1,29 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.archetypes.workstation;
in
{
options.plusultra.archetypes.workstation = with types; {
enable =
mkBoolOpt false "Whether or not to enable the workstation archetype.";
};
config = mkIf cfg.enable {
plusultra = {
suites = {
common = enabled;
desktop = enabled;
development = enabled;
art = enabled;
video = enabled;
social = enabled;
media = enabled;
};
tools = {
appimage-run = enabled;
};
};
};
}

18
modules/nixos/cache/public/default.nix vendored Normal file
View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cache.public;
in
{
options.plusultra.cache.public = {
enable = mkEnableOption "Plus Ultra public cache";
};
config = mkIf cfg.enable {
plusultra.nix.extra-substituters = {
"https://attic.ruby.hamho.me/public".key = "public:QUkZTErD8fx9HQ64kuuEUZHO9tXNzws7chV8qy/KLUk=";
};
};
}

View file

@ -0,0 +1,18 @@
inputs@{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.flake;
in
{
options.plusultra.cli-apps.flake = with types; {
enable = mkBoolOpt false "Whether or not to enable flake.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
snowfallorg.flake
];
};
}

View file

@ -0,0 +1,47 @@
inputs @ { options
, config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.neovim;
in
{
options.plusultra.cli-apps.neovim = with types; {
enable = mkBoolOpt false "Whether or not to enable neovim.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
# FIXME: As of today (2022-12-09), `page` no longer works with my Neovim
# configuration. Either something in my configuration is breaking it or `page` is busted.
# page
plusultra.neovim
];
environment.variables = {
# PAGER = "page";
# MANPAGER =
# "page -C -e 'au User PageDisconnect sleep 100m|%y p|enew! |bd! #|pu p|set ft=man'";
PAGER = "less";
MANPAGER = "less";
NPM_CONFIG_PREFIX = "$HOME/.npm-global";
EDITOR = "nvim";
};
plusultra.home = {
configFile = {
"dashboard-nvim/.keep".text = "";
};
extraOptions = {
# Use Neovim for Git diffs.
programs.zsh.shellAliases.vimdiff = "nvim -d";
programs.bash.shellAliases.vimdiff = "nvim -d";
programs.fish.shellAliases.vimdiff = "nvim -d";
};
};
};
}

View file

@ -0,0 +1,31 @@
{ lib, pkgs, config, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.prisma;
in
{
options.plusultra.cli-apps.prisma = with types; {
enable = mkBoolOpt false "Whether or not to install Prisma";
pkgs = {
npm = mkOpt package pkgs.nodePackages.prisma "The NPM package to install";
engines = mkOpt package pkgs.prisma-engines
"The package to get prisma engines from";
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.pkgs.npm ];
plusultra.home.extraOptions = {
programs.zsh.initExtra = ''
export PRISMA_MIGRATION_ENGINE_BINARY="${cfg.pkgs.engines}/bin/migration-engine"
export PRISMA_QUERY_ENGINE_BINARY="${cfg.pkgs.engines}/bin/query-engine"
export PRISMA_QUERY_ENGINE_LIBRARY="${cfg.pkgs.engines}/lib/libquery_engine.node"
export PRISMA_INTROSPECTION_ENGINE_BINARY="${cfg.pkgs.engines}/bin/introspection-engine"
export PRISMA_FMT_BINARY="${cfg.pkgs.engines}/bin/prisma-fmt"
'';
};
};
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.proton;
in
{
options.plusultra.cli-apps.proton = with types; {
enable = mkBoolOpt false "Whether or not to enable Proton.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ proton-caller ];
};
}

View file

@ -0,0 +1,20 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.thaw;
in
{
options.plusultra.cli-apps.thaw = with types; {
enable = mkBoolOpt false "Whether or not to enable thaw.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
snowfallorg.thaw
];
};
}

View file

@ -0,0 +1,5 @@
# Enable saving sessions.
set -g @continuum-restore 'on'
# Save every 30 minutes.
set -g @continuum-save-interval '30'

View file

@ -0,0 +1,15 @@
# Create a vertical split to show search & results to keep
# the content visible.
set -g @extrakto_split_direction "v"
# Override the way that Extrakto copies text. By default
# it was trying to use xclip and would not properly pick
# up on $XDG_SESSION_TYPE being wayland. Instead, use
# Tmux's built-in clipboard functionality.
set -g @extrakto_clip_tool_run "tmux_osc52"
# FIXME: The current version of Extrakto in
# NixPkgs is out of date and does not support wayland.
# This overrides the clipping tool to ensure that it works
# under wayland.
set -g @extrakto_clip_tool "wl-copy"

View file

@ -0,0 +1,2 @@
# Change default keybinding.
TMUX_FZF_LAUNCH_KEY="C-f"

View file

@ -0,0 +1,38 @@
# Lower delay waiting for chord after escape key press.
set -g escape-time 0
# Change the prefix from C-b to C-s to make it easier to type.
set -g prefix C-s
unbind C-b
bind C-s send-prefix
# Start window numbers at 1 rather than 0.
set -g base-index 1
# Use h, j, k, l for movement between panes.
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Fix colors being wrong in programs like Neovim.
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Expand the left status to accomodate longer session names.
set-option -g status-left-length 20
# One of the plugins binds C-l, make sure we have accces to it.
unbind C-l
bind -n C-l send-keys C-l
# Don't require a prompt to detach from the current session.
unbind -n M-E
bind -n M-E detach-client
# Reload tmux configuration from ~/.config/tmux/tmux.conf instead
# of Tilish's default of ~/.tmux.conf.
unbind -n M-C
bind -n M-C source-file "~/.config/tmux/tmux.conf"
# Use M-z to zoom and unzoom panes.
bind -n M-z resize-pane -Z

View file

@ -0,0 +1,21 @@
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'M-h' select-pane -L
bind-key -T copy-mode-vi 'M-j' select-pane -D
bind-key -T copy-mode-vi 'M-k' select-pane -U
bind-key -T copy-mode-vi 'M-l' select-pane -R
bind-key -T copy-mode-vi 'M-p' select-pane -l

View file

@ -0,0 +1,37 @@
# Copyright (C) 2017-present Arctic Ice Studio <development@arcticicestudio.com>
# Copyright (C) 2017-present Sven Greb <development@svengreb.de>
# Copyright (C) 2022-present Jake Hamilton <jake.hamilton@hey.com>
# Project: Nord tmux
# Repository: https://github.com/arcticicestudio/nord-tmux
# License: MIT
#+----------------+
#+ Plugin Support +
#+----------------+
#+--- tmux-prefix-highlight ---+
set -g @prefix_highlight_output_prefix "#[fg=brightcyan]#[bg=black]#[nobold]#[noitalics]#[nounderscore]#[bg=brightcyan]#[fg=black]"
set -g @prefix_highlight_output_suffix ""
set -g @prefix_highlight_copy_mode_attr "fg=brightcyan,bg=black,bold"
#+--------+
#+ Status +
#+--------+
#+--- Bars ---+
set -g status-left "#[fg=brightblack,bg=black]#[fg=white,bg=brightblack,bold] #S #[fg=brightblack,bg=black,nobold,noitalics,nounderscore]"
set -g status-right "#{prefix_highlight}#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack,nobold] #H #[fg=brightblack,bg=black,nobold]"
#+--- Windows ---+
set -g window-status-format "#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] #I#[fg=white,bg=brightblack,nobold,noitalics,nounderscore]: #W #[fg=brightblack,bg=black,nobold,noitalics,nounderscore]"
set -g window-status-current-format "#[fg=#5e81ac,bg=black]#[fg=white,bg=#5e81ac,bold,noitalics,nounderscore] #I#[fg=white,bg=#5e81ac,bold,noitalics,nounderscore]: #W #[fg=#5e81ac,bg=black,nobold,noitalics,nounderscore]"
set -g window-status-separator " "
# Center the window list (yes, this value has to be written as "centre").
set -g status-justify centre
#+----------------+
#+ Windows +
#+----------------+
#+--- Bars ---+
set -g pane-active-border-style "bg=default fg=blue"

View file

@ -0,0 +1,12 @@
# Integrate Tmux and Neovim movement.
set -g @tilish-navigator "on"
# Default to splitting once vertically and then splitting horizontally
# after that.
select-layout "main-vertical"
select-layout -E
set -g @tilish-default "main-vertical"
bind-key -n "M-q" kill-pane

View file

@ -0,0 +1,20 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.tmux;
in
{
options.plusultra.cli-apps.tmux = {
enable = mkEnableOption "Tmux";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
plusultra.tmux
];
};
}

View file

@ -0,0 +1,20 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.wine;
in
{
options.plusultra.cli-apps.wine = with types; {
enable = mkBoolOpt false "Whether or not to enable Wine.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
winePackages.unstable
winetricks
wine64Packages.unstable
];
};
}

View file

@ -0,0 +1,17 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.wshowkeys;
in
{
options.plusultra.cli-apps.wshowkeys = with types; {
enable = mkBoolOpt false "Whether or not to enable wshowkeys.";
};
config = mkIf cfg.enable {
plusultra.user.extraGroups = [ "input" ];
environment.systemPackages = with pkgs; [ wshowkeys ];
};
}

Some files were not shown because too many files have changed in this diff Show more