os/home.nix

156 lines
5.6 KiB
Nix
Raw Normal View History

2024-07-01 22:52:04 +02:00
{config, lib, pkgs, inputs, ...}: {
home.file.".mozilla/firefox/default/chrome/firefox-gnome-theme".source = inputs.firefox-gnome-theme;
programs.firefox.enable = true;
programs.firefox.package = pkgs.librewolf-wayland;
home.file.".librewolf".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.mozilla" ;
programs.firefox.profiles.default = {
userChrome = ''
@import "firefox-gnome-theme/userChrome.css";
'';
userContent = ''
@import "firefox-gnome-theme/userContent.css";
'';
settings = {
# Firefox gnome theme ## - https://github.com/rafaelmardojai/firefox-gnome-theme/blob/7cba78f5216403c4d2babb278ff9cc58bcb3ea66/configuration/user.js
# (copied into here because home-manager already writes to user.js)
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Enable customChrome.cs
"browser.uidensity" = 0; # Set UI density to normal
"svg.context-properties.content.enabled" = true; # Enable SVG context-propertes
"browser.theme.dark-private-windows" = false; # Disable private window dark theme
};
};
home.stateVersion = "22.05";
home.packages = [ pkgs.fortune ];
programs.home-manager.enable = true;
programs.bash.enable = true;
programs.bash.bashrcExtra = ''
# Prompt
if [ -n "$PS1" ]; then
# A temporary variable to contain our prompt command
NEW_PROMPT_COMMAND='
MY_PWD="$PWD"
[[ "$MY_PWD" =~ ^"$HOME"(/|$) ]] && MY_PWD="~''${MY_PWD#$HOME}"
TRIMMED_PWD=''${MY_PWD: -40};
TRIMMED_PWD=''${TRIMMED_PWD:-$MY_PWD}
[[ "''${#MY_PWD}" -ge 41 ]] && TRIMMED_PWD="…$TRIMMED_PWD"
SHELL_PREFIX=""
[[ -n "$IN_NIX_SHELL" ]] && SHELL_PREFIX="$SHELL_PREFIX "
[[ -n "$AWS_VAULT" ]] && SHELL_PREFIX="$SHELL_PREFIX 🔓"
[[ -n "$FLUTTER_ENV" ]] && SHELL_PREFIX="$SHELL_PREFIX "
[[ -n "$REACTNATIVE_ENV" ]] && SHELL_PREFIX="$SHELL_PREFIX "
'
# If there's an existing prompt command, let's not
# clobber it
if [ -n "''${PROMPT_COMMAND// /}" ]; then
PROMPT_COMMAND="$PROMPT_COMMAND
$NEW_PROMPT_COMMAND"
else
PROMPT_COMMAND="$NEW_PROMPT_COMMAND"
fi
# We're done with our temporary variable
unset NEW_PROMPT_COMMAND
# Set PS1 with our new variable
# \h - hostname, \u - username
# PS1='\u@\h:$TRIMMED_PWD\$ '
export PS1="[\t \[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]]"'$SHELL_PREFIX'" \[\e[36m\]"'$TRIMMED_PWD'"\[\e[m\] \$ "
fi
eval "$(direnv hook bash)"
'';
programs.bash.shellAliases = {
chmod = "chmod --preserve-root";
chown = "chown --preserve-root";
ls = "ls -Isnap --color";
df = "df -h -x squashfs -x tmpfs -x devtmpfs -x overlay -x revokefs-fuse";
free = "free -h";
toupper = "tr [:lower:] [:upper:]";
tolower = "tr [:upper:] [:lower:]";
rebuild = ''
nixos-rebuild switch --flake "$HOME/.local/os#" --use-remote-sudo
'';
":r" = "!!";
};
programs.bash.sessionVariables = {
NIX_SHELL_PRESERVE_PROMPT = 1;
};
programs.tmux.enable = true;
programs.tmux.terminal = "xterm-256color";
programs.tmux.baseIndex = 1;
programs.tmux.clock24 = true;
programs.tmux.prefix = "C-a";
programs.tmux.escapeTime = 0;
programs.tmux.extraConfig = ''
set-option -g status-position top
setw -g automatic-rename on
set -g renumber-windows on
set -g set-titles on
set -g set-titles-string "#T"
'';
dconf.settings = {
"org/gnome/desktop/wm/keybindings" = {
move-to-workspace-left = ["<Alt><Super>Left"];
move-to-workspace-right = ["<Alt><Super>Right"];
switch-to-workspace-left = ["<Super>Left"];
switch-to-workspace-right = ["<Super>Right"];
switch-applications = ["<Super>Tab"];
switch-applications-backward = ["<Shift><Super>Tab"];
switch-windows = ["<Alt>Tab"];
switch-windows-backward = ["<Shift><Alt>Tab"];
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = ["/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Super>t";
command = "kgx";
name = "gnome-console";
};
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
};
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/shell" = rec {
enabled-extensions = [
"trayIconsReloaded@selfmade.pl"
"AlphabeticalAppGrid@stuarthayhurst"
"clipboard-history@alexsaveau.dev"
"noannoyance@daase.net"
];
# disabled-extensions = builtins.filter (x: ! builtins.elem x enabled-extensions) disabled-extensions;
favorite-apps = [
"librewolf.desktop"
"chromium-browser.desktop"
"org.gnome.Console.desktop"
"org.gnome.Nautilus.desktop"
"org.gnome.Geary.desktop"
"org.gnome.Calendar.desktop"
"org.gnome.Todo.desktop"
"telegramdesktop.desktop"
"schildichat-desktop.desktop"
"im.dino.Dino.desktop"
"com.github.bleakgrey.tootle.desktop"
];
};
};
}