nix/home.nix
Tristan Druyen 8a23a33c52
Add some style
- Update flakes
- Add set-background service which sets background image to
  ~/.background if it exists
- Add .background to home.nix
2023-09-19 15:14:49 +02:00

355 lines
8.6 KiB
Nix

{
pkgs,
customPkgs,
config,
inputs,
...
}: let
wallpaper = inputs.nix-wallpaper.packages.${pkgs.system}.default.override {
logoSize = 24;
preset = "gruvbox-dark-rainbow";
};
wallpaperPath = "${wallpaper}/share/wallpapers/nixos-wallpaper.png";
in {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
programs.alacritty = {
enable = true;
settings = {
window.opacity = 0.88;
window.dimensions = {
lines = 40;
columns = 150;
};
};
};
services.emacs = {
enable = true;
defaultEditor = true;
package = customPkgs.emacs-unstable-pgtk;
};
programs.fish = {
enable = true;
functions = {
ec = "emacsclient $argv";
ecc = "emacsclient -c $argv";
ecr = "emacsclient -r $argv";
ecrr = "emacsclient -r $argv";
};
};
programs.firefox = {
enable = true;
profiles = {
default = {
isDefault = true;
settings = {
# Extensions are managed with Nix, so don't update.
"extensions.update.autoUpdateDefault" = false;
"extensions.update.enabled" = false;
# Sync
# "services.sync.username" = config.etu.user.email;
"services.sync.engine.addons" = false; # Do not sync extensions.
"general.autoScroll" = true; # Middle click to scroll
"browser.startup.page" = 3; # Restore previous windows and tabs.
# Privacy enhancements
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
"browser.newtabpage.activity-stream.telemetry" = false;
"browser.newtabpage.activity-stream.feeds.snippets" = false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
# Improve performance
"gfx.webrender.all" = true;
# Do Not Track header
"privacy.donottrackheader.enabled" = true;
"privacy.donottrackheader.value" = 1;
# Enable userChrome customisations
# "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
extensions = with config.nur.repos.rycee.firefox-addons; [
bitwarden
clearurls
consent-o-matic
darkreader
localcdn
plasma-integration
privacy-badger
rust-search-extension
skip-redirect
sponsorblock
tab-stash
ublock-origin
unpaywall
];
search = {
force = true;
default = "DuckDuckGo";
order = ["DuckDuckGo" "Nix Packages" "Nix Options" "NixOS Wiki"];
engines = {
"DuckDuckGo".metaData = {
alias = "@ddg";
};
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@np"];
};
"Nix Options" = {
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "type";
value = "options";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@no"];
};
"Home-Manager Options" = {
urls = [
{
template = "https://mipmip.github.io/home-manager-option-search";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@ho"];
};
"NixOS Wiki" = {
urls = [
{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}
];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = ["@nw"];
};
"Bing".metaData.hidden = true;
"Amazon.de".metaData.hidden = true;
"Google".metaData = {
alias = "@g";
hidden = true;
};
};
};
bookmarks = [
{
toolbar = true;
bookmarks = [
{
name = "Home Manager";
url = "https://nixos.wiki/wiki/Home_Manager";
}
];
}
{
name = "wikipedia";
tags = ["wiki"];
keyword = "wiki";
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
}
{
name = "kernel.org";
url = "https://www.kernel.org";
}
{
name = "Nix sites";
bookmarks = [
{
name = "homepage";
url = "https://nixos.org/";
}
{
name = "wiki";
tags = ["wiki" "nix"];
url = "https://nixos.wiki/";
}
{
name = "Nix sites";
bookmarks = [
{
name = "homepage";
url = "https://nixos.org/";
}
{
name = "wiki";
url = "https://nixos.wiki/";
}
];
}
];
}
];
};
};
};
programs.git = {
enable = true;
userName = "Tristan Druyen";
userEmail = "tristan@vault81.de";
aliases = {
ci = "commit";
co = "checkout";
s = "status";
};
extraConfig = {
user.signingkey = "/home/tristand/.ssh/id_ed25519";
commit.gpgsign = true;
gpg.format = "ssh";
};
};
programs.ssh = {
enable = true;
matchBlocks = {
"he3" = {
host = "he3";
hostname = "he3.vault81.de";
user = "root";
identityFile = "~/.ssh/id_hetz_ed25519";
};
"he2" = {
host = "he2";
hostname = "he2.vault81.de";
user = "root";
identityFile = "~/.ssh/id_v81_ed25519";
};
"desk-arch" = {
host = "desk-arch";
hostname = "tristan-desk-arch";
user = "tristand";
identityFile = "~/.ssh/id_v81_ed25519";
};
};
};
programs.gpg = {
enable = true;
};
services.gpg-agent = {
enable = true;
enableExtraSocket = true;
enableSshSupport = true;
};
home.username = "tristand";
home.homeDirectory = "/home/tristand";
home.file.".background".source = wallpaperPath;
home.packages = with pkgs; [
alejandra
atool
alacritty
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
aspellDicts.de
bitwarden
binutils
brave
btop
direnv
cmake
customPkgs.emacs-unstable-pgtk
firefox
jellyfin-media-player
neofetch
nodejs_20
kate
rcm
rustup
rust-motd
(ripgrep.override {withPCRE2 = true;})
gnutls
gnumake
gcc
libtool
fd
imagemagick
pinentry-emacs
python311Full
zstd
rnix-lsp
texlive.combined.scheme-medium
signal-desktop
statix
tailscale
tokei
thunderbird
zellij
];
home.sessionVariables = {
BROWSER = "firefox";
TERMINAL = "alacritty";
};
home.stateVersion = "23.05";
}