diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 120000 index 0000000..f3a9e8f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1 @@ +/nix/store/n5fhskmgj8mcv6c7n7bnrswi48czqsx2-pre-commit-config.json \ No newline at end of file diff --git a/common.nix b/common.nix new file mode 100644 index 0000000..d857041 --- /dev/null +++ b/common.nix @@ -0,0 +1,641 @@ +{ + lib, + pkgs, + config, + ... +}: +with lib; + +let + cfg = config.common; + + dynamicForwardModule = types.submodule { options = bindOptions; }; + + forwardModule = types.submodule { + options = { + bind = bindOptions; + + host = { + address = mkOption { + type = types.nullOr types.str; + default = null; + example = "example.org"; + description = "The address where to forward the traffic to."; + }; + + port = mkOption { + type = types.nullOr types.port; + default = null; + example = 80; + description = "Specifies port number to forward the traffic to."; + }; + }; + }; + }; + + matchBlockModule = types.submodule ( + { dagName, ... }: + { + options = { + host = mkOption { + type = types.nullOr types.str; + default = null; + example = "*.example.org"; + description = '' + `Host` pattern used by this conditional block. + See + {manpage}`ssh_config(5)` + for `Host` block details. + This option is ignored if + {option}`ssh.matchBlocks.*.match` + if defined. + ''; + }; + + match = mkOption { + type = types.nullOr types.str; + default = null; + example = '' + host canonical + host exec "ping -c1 -q 192.168.17.1"''; + description = '' + `Match` block conditions used by this block. See + {manpage}`ssh_config(5)` + for `Match` block details. + This option takes precedence over + {option}`ssh.matchBlocks.*.host` + if defined. + ''; + }; + + port = mkOption { + type = types.nullOr types.port; + default = null; + description = "Specifies port number to connect on remote host."; + }; + + forwardAgent = mkOption { + default = null; + type = types.nullOr types.bool; + description = '' + Whether the connection to the authentication agent (if any) + will be forwarded to the remote machine. + ''; + }; + + forwardX11 = mkOption { + type = types.bool; + default = false; + description = '' + Specifies whether X11 connections will be automatically redirected + over the secure channel and {env}`DISPLAY` set. + ''; + }; + + forwardX11Trusted = mkOption { + type = types.bool; + default = false; + description = '' + Specifies whether remote X11 clients will have full access to the + original X11 display. + ''; + }; + + identitiesOnly = mkOption { + type = types.bool; + default = false; + description = '' + Specifies that ssh should only use the authentication + identity explicitly configured in the + {file}`~/.ssh/config` files or passed on the + ssh command-line, even if {command}`ssh-agent` + offers more identities. + ''; + }; + + identityFile = mkOption { + type = with types; either (listOf str) (nullOr str); + default = [ ]; + apply = + p: + if p == null then + [ ] + else if isString p then + [ p ] + else + p; + description = '' + Specifies files from which the user identity is read. + Identities will be tried in the given order. + ''; + }; + + user = mkOption { + type = types.nullOr types.str; + default = null; + description = "Specifies the user to log in as."; + }; + + hostname = mkOption { + type = types.nullOr types.str; + default = null; + description = "Specifies the real host name to log into."; + }; + + serverAliveInterval = mkOption { + type = types.int; + default = 0; + description = "Set timeout in seconds after which response will be requested."; + }; + + serverAliveCountMax = mkOption { + type = types.ints.positive; + default = 3; + description = '' + Sets the number of server alive messages which may be sent + without SSH receiving any messages back from the server. + ''; + }; + + sendEnv = mkOption { + type = types.listOf types.str; + default = [ ]; + description = '' + Environment variables to send from the local host to the + server. + ''; + }; + + setEnv = mkOption { + type = + with types; + attrsOf (oneOf [ + str + path + int + float + ]); + default = { }; + description = '' + Environment variables and their value to send to the server. + ''; + }; + + compression = mkOption { + type = types.nullOr types.bool; + default = null; + description = '' + Specifies whether to use compression. Omitted from the host + block when `null`. + ''; + }; + + checkHostIP = mkOption { + type = types.bool; + default = true; + description = '' + Check the host IP address in the + {file}`known_hosts` file. + ''; + }; + + proxyCommand = mkOption { + type = types.nullOr types.str; + default = null; + description = "The command to use to connect to the server."; + }; + + proxyJump = mkOption { + type = types.nullOr types.str; + default = null; + description = "The proxy host to use to connect to the server."; + }; + + certificateFile = mkOption { + type = with types; either (listOf str) (nullOr str); + default = [ ]; + apply = + p: + if p == null then + [ ] + else if isString p then + [ p ] + else + p; + description = '' + Specifies files from which the user certificate is read. + ''; + }; + + addressFamily = mkOption { + default = null; + type = types.nullOr ( + types.enum [ + "any" + "inet" + "inet6" + ] + ); + description = '' + Specifies which address family to use when connecting. + ''; + }; + + localForwards = mkOption { + type = types.listOf forwardModule; + default = [ ]; + example = literalExpression '' + [ + { + bind.port = 8080; + host.address = "10.0.0.13"; + host.port = 80; + } + ]; + ''; + description = '' + Specify local port forwardings. See + {manpage}`ssh_config(5)` for `LocalForward`. + ''; + }; + + remoteForwards = mkOption { + type = types.listOf forwardModule; + default = [ ]; + example = literalExpression '' + [ + { + bind.port = 8080; + host.address = "10.0.0.13"; + host.port = 80; + } + ]; + ''; + description = '' + Specify remote port forwardings. See + {manpage}`ssh_config(5)` for `RemoteForward`. + ''; + }; + + dynamicForwards = mkOption { + type = types.listOf dynamicForwardModule; + default = [ ]; + example = literalExpression '' + [ { port = 8080; } ]; + ''; + description = '' + Specify dynamic port forwardings. See + {manpage}`ssh_config(5)` for `DynamicForward`. + ''; + }; + + extraOptions = mkOption { + type = types.attrsOf types.str; + default = { }; + description = "Extra configuration options for the host."; + }; + }; + } + ); +in +{ + options.programs.ssh = { + customMatchBlocks = mkOption { + type = hm.types.dagOf matchBlockModule; + default = { }; + example = literalExpression '' + { + "john.example.com" = { + hostname = "example.com"; + user = "john"; + }; + foo = lib.hm.dag.entryBefore ["john.example.com"] { + hostname = "example.com"; + identityFile = "/home/john/.ssh/foo_rsa"; + }; + }; + ''; + description = '' + Specify per-host settings. Note, if the order of rules matter + then use the DAG functions to express the dependencies as + shown in the example. + + See + {manpage}`ssh_config(5)` + for more information. + ''; + }; + }; + + options.common = { + userHome = mkOption { + type = types.str; + default = null; + example = "/home/user"; + description = "Sets the user's home path."; + }; + }; + + config = { + + xdg.mimeApps = { + enable = true; + + defaultApplications = { + "text/html" = "firefox.desktop"; + "x-scheme-handler/http" = "firefox.desktop"; + "x-scheme-handler/https" = "firefox.desktop"; + "x-scheme-handler/about" = "firefox.desktop"; + "x-scheme-handler/unknown" = "firefox.desktop"; + "application/pdf" = "org.pwmt.zathura-ps.desktop"; + "x-scheme-handler/mailto" = "userapp-Thunderbird-3NBJQ2.desktop"; + "x-scheme-handler/mid" = "userapp-Thunderbird-3NBJQ2.desktop"; + "x-scheme-handler/news" = "userapp-Thunderbird-QJOCQ2.desktop"; + "x-scheme-handler/snews" = "userapp-Thunderbird-QJOCQ2.desktop"; + "x-scheme-handler/nntp" = "userapp-Thunderbird-QJOCQ2.desktop"; + "x-scheme-handler/feed" = "userapp-Thunderbird-EIXEQ2.desktop"; + "application/rss+xml" = "userapp-Thunderbird-EIXEQ2.desktop"; + "application/x-extension-rss" = "userapp-Thunderbird-EIXEQ2.desktop"; + "x-scheme-handler/webcal" = "userapp-Thunderbird-LBFEQ2.desktop"; + "x-scheme-handler/webcals" = "userapp-Thunderbird-LBFEQ2.desktop"; + + "message/rfc822" = "userapp-Thunderbird-3NBJQ2.desktop"; + "text/calendar" = "userapp-Thunderbird-LBFEQ2.desktop"; + "application/x-extension-ics" = "userapp-Thunderbird-LBFEQ2.desktop"; + "application/x-bittorrent;x-scheme-handler/magnet" = "transmission-remote-gtk.desktop"; + }; + }; + + xdg.portal = { + enable = true; + configPackages = with pkgs; [ hyprland ]; + extraPortals = with pkgs; [ hyprland ]; + }; + + # Allow unfree packages (crying FSF noises) + nixpkgs.config.allowUnfree = true; + nixpkgs.config.packageOverrides = pkgs: { + nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { + inherit pkgs; + }; + }; + + # Packages that should be installed to the user profile. + home.packages = with pkgs; [ + prismlauncher # Minecraft + element-desktop # Matrix Desktop Client + tidal-hifi # Tidal Web Client + helvum # pipewire patchbay + bitwarden-cli # password and secret manager + ansible # declarative server managment + packwiz # Minecraft mod pack managment + just # A handy way to save and run project-specific commands + ydotool # wayland automation tool + lunarvim # IDE layer for Neovim + cloudflared # cloudflare things + + sbctl # For debugging and troubleshooting Secure Boot + killall # killall + dmenu # (program) picker for Xorg + xorg.xauth # Dependency of startx (??) + wl-clipboard # Wayland clipboard functionality + bottom # htop, but in Rust and better + tree # tree + fzf # Fuzzy Find + pwvucontrol # pipewire volume control + brave # Chromium based fallback browser + qalculate-gtk # Best calculator ever + #home-manager # Nix's Home-Manager + catppuccin-cursors.mochaDark # Catppuccin Mouse Cursors + wofi # dmenu, but for wlroots wayland + kitty # kitty terminal emulator + waybar # Status bar for wayland compositors + grim # screenshot tool + playerctl # Media control + slurp # selection tool + mako # Notification Daemon + nmap # port scanning tool + libreoffice-qt # Office Suite + hunspell # Spellchecking + hunspellDicts.de_DE # German Spellcheck + hunspellDicts.en_US # English Spellcheck + shellcheck # Shell linter + jq # JSON utility + texlive.combined.scheme-full # LaTeX + zathura # minimal PDF Viewer + gimp # gnu image manipulation program + p7zip # (7)zip tool + zip # standard unix zip tool + thunderbird # E-Mail & Calendar + signal-desktop # Signal Desktop Client + lazygit # Terminal git frontend + mpv # Video Playback + vlc # media playback + imv # minimal image viewer + celluloid # mpv frontend + mumble # FOSS Steam Speak + easyeffects # some audio effects + hypridle # idle daemon for hyprland + hyprpaper # Hyprpland backgrounds + brightnessctl # brightness control cli + rustc # rust compiler + rust-analyzer # Rust LSP + cargo # rust build tool + gcc # GNU Compiler Collections + clang-tools # LSP Server + formatter + nodePackages.vscode-json-languageserver # ZED Json LSP + ddcutil # Screen controls + wireguard-tools # Wireguard + man-pages # dev man pages + man-pages-posix # dev man pages + #(catppuccin-sddm.override { + # flavor = "mocha"; + # font = "Fira Sans"; + # fontSize = "9"; + # backgroundbin = "$XDG_PICTURES_DIR/Wallpapers/current"; + # loginBackground = true; + #}) + steamcmd # steamcmd + wget # downloader + xclip # Clipboard + wine # win translator + protontricks # Managment of proton enabled games + lutris # Linux Game Manager + discord # !delete voip/messenger + brasero # Disc-Burner + cdrtools # CD tools + cdrdao # CD tools + dvdplusrwtools # DVD + Blu-ray tools + tidal-dl # Tidal ripper + vscodium-fhs # VS Code + niv # Nix dependency managment + bottles # WINE Prefix manager + transmission-remote-gtk # Torrent Client + qemu # Virtualization/Emulation + bash # Compat + jetbrains.idea-ultimate # IntelliJ Ultimate + jetbrains.idea-community # IntelliJ Community + maven # Java Build tool + jdk # Java development kit + nixfmt-rfc-style # official nix formatter + ]; + + programs = { + zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + autocd = true; + shellAliases = { + git-list-untracked = ''git fetch --prune && git branch -r | awk "{print \$1}" | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk "{print \$1}"''; + git-remove-untracked = ''git fetch --prune && git branch -r | awk "{print \$1}" | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk "{print \$1}" | xargs git branch -d''; + }; + }; + bash.enable = true; + kitty = { + enable = true; + themeFile = "Catppuccin-Mocha"; + font = { + name = "Fira Code"; + package = pkgs.fira-code; + }; + settings = { + enable_audio_bell = false; + background_opacity = 0.85; + }; + }; + + git = { + enable = true; + userName = "Leon Wilzer"; + userEmail = "git@komu.boo"; + aliases = { + ci = "commit"; + co = "checkout"; + s = "status"; + undo = "reset --soft 'HEAD^'"; + a = "add"; + p = "push"; + cl = "clone"; + }; + extraConfig = { + push = { + autoSetupRemote = true; + }; + }; + }; + + gpg = { + enable = true; + }; + + ssh = + let + sshDir = "${cfg.userHome}/.ssh"; + startAgent = true; + in + { + enable = true; + addKeysToAgent = "yes"; + matchBlocks = { + "libre.moe *.libre.moe" = { + user = "leon"; + identityFile = "${sshDir}/libremoe"; + }; + "komu.boo *.komu.boo" = { + user = "root"; + identityFile = "${sshDir}/komuboo"; + }; + "github.com" = { + user = "git"; + identityFile = "${sshDir}/github"; + }; + } // config.programs.ssh.customMatchBlocks; + }; + + neovim = { + enable = true; + defaultEditor = true; + vimAlias = true; + viAlias = true; + extraConfig = '' + " General + set number + set relativenumber + set cc=120 + set tabstop=4 + set softtabstop=0 noexpandtab + set shiftwidth=4 + colorscheme catppuccin-mocha + + " VimTex + filetype plugin indent on + syntax enable + let g:vimtex_view_method = 'zathura' + + " Vim-LaTeX-live-preview + let g:livepreview_previewer = 'zathura' + ''; + plugins = with pkgs.vimPlugins; [ + vimtex + vim-latex-live-preview + catppuccin-nvim + ]; + }; + + hyprlock.enable = true; + zed-editor.enable = true; + # Let Home Manager install and manage itself. + home-manager.enable = true; + + }; + + # X11 + xsession.enable = true; + xsession.windowManager.command = "dwm"; + + gtk = { + enable = true; + theme = { + name = "Catppuccin Mocha"; + package = pkgs.catppuccin-gtk; + }; + }; + qt = { + enable = true; + platformTheme.name = "gtk"; + style = { + name = "Catppuccin Mocha"; + package = pkgs.catppuccin; + }; + }; + + services = { + mako = { + enable = true; + defaultTimeout = 8000; + }; + + gpg-agent = { + enable = true; + }; + }; + dconf.settings = { + "org/virt-manager/virt-manager/connections" = { + autoconnect = [ "qemu:///system" ]; + uris = [ "qemu:///system" ]; + }; + }; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "24.05"; + }; +} diff --git a/firefox.nix b/firefox.nix new file mode 100644 index 0000000..508fbd4 --- /dev/null +++ b/firefox.nix @@ -0,0 +1,291 @@ +{ + lib, + pkgs, + config, + ... +}: +with lib; +let + cfg = config.programs.firefox; +in +{ + options.programs.firefox.forcePrivateBrowsing = mkOption { + type = lib.types.bool; + default = true; + example = true; + description = "Whether to force private browsing."; + }; + + config = { + programs.firefox = { + enable = true; + languagePacks = [ + "en-US" + "de" + ]; + + # ---- POLICIES ---- + # Check about:policies#documentation for options. + policies = { + Authentication = { + "SPNEGO" = [ + "upb.de" + "uni-paderborn.de" + "cs.uni-paderborn.de" + ]; + "NTLM" = [ + "upb.de" + "uni-paderborn.de" + "cs.uni-paderborn.de" + ]; + }; + BlockAboutAddons = false; + BlockAboutConfig = false; + BlockAboutProfiles = false; + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + AppAutoUpdate = false; + DontCheckDefaultBrowser = true; + PrimaryPassword = false; + OfferToSaveLoginsDefault = false; + PasswordManagerEnabled = false; + DisableMasterPasswordCreation = true; + AutofillAddressEnabled = false; + HttpsOnlyMode = "force_enabled"; + AutofillCreditCardEnabled = false; + DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" + DisplayMenuBar = "never"; # alternatives: "always", "never" or "default-on" + NoDefaultBookmarks = true; + SearchSuggestEnabled = false; + PrivateBrowsingModeAvailability = if cfg.forcePrivateBrowsing then 2 else 0; + FirefoxHome = { + Search = true; + TopSites = false; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + Locked = false; + }; + PopupBlocking = { + Allow = [ + "https://vault.cs.uni-paderborn.de:8200" + "https://vault.prod.cs.uni-paderborn.de:8200" + "https://vault.staging.cs.uni-paderborn.de:8200" + "https://vault.dev.cs.uni-paderborn.de:8200" + "https://tickets.cs.uni-paderborn.de" + "https://tickets-dev.cs.uni-paderborn.de" + ]; + }; + SearchBar = "unified"; # alternative: "separate" + ExtensionSettings = { + "*" = { + installation_mode = "blocked"; + blocked_install_message = "Addons have to be configured through home-manager!"; + allowed_types = [ ]; + }; + # uBlock Origin + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "normal_installed"; + }; + # Catppuccin Mocha Blue + "{2adf0361-e6d8-4b74-b3bc-3f450e8ebb69}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/{2adf0361-e6d8-4b74-b3bc-3f450e8ebb69}/latest.xpi"; + installation_mode = "normal_installed"; + }; + # Privacy Badger + "jid1-MnnxcxisBPnSXQ@jetpack" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/jid1-MnnxcxisBPnSXQ@jetpack/latest.xpi"; + installation_mode = "normal_installed"; + }; + # Bitwarden + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/{446900e4-71c2-419f-a6a7-df9c091e268b}/latest.xpi"; + installation_mode = "normal_installed"; + }; + # LanguageTool + "languagetool-webextension@languagetool.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/languagetool-webextension@languagetool.org/latest.xpi"; + installation_mode = "normal_installed"; + }; + # Tree Style Tab + "treestyletab@piro.sakura.ne.jp" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/treestyletab@piro.sakura.ne.jp/latest.xpi"; + installation_mode = "normal_installed"; + }; + # Dark Reader + "addon@darkreader.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/addon@darkreader.org/latest.xpi"; + installation_mode = "normal_installed"; + }; + }; + }; + + # ---- PREFERENCES ---- + # Check about:config for options. + #preferencesStatus = "locked"; # locks all settings + profiles.default = { + containersForce = true; + isDefault = true; + settings = { + "browser.contentblocking.category" = "strict"; + "extensions.pocket.enabled" = false; + "extensions.screenshots.disabled" = true; + "browser.topsites.contile.enabled" = false; + "browser.formfill.enable" = false; + "browser.search.suggest.enabled" = false; + "browser.search.suggest.enabled.private" = false; + "browser.urlbar.suggest.searches" = false; + "browser.urlbar.showSearchSuggestionsFirst" = false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.feeds.snippets" = false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; + "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false; + "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false; + "browser.newtabpage.activity-stream.section.highlights.includeVisited" = false; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.system.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "extensions.autoDisableScopes" = 0; + "browser.translations.neverTranslateLanguages" = true; + "browser.translations.alwaysTranslateLanguages" = false; + "browser.warnOnQuit" = false; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "dom.security.https_only_mode" = true; + "browser.privatebrowsing.autostart" = cfg.forcePrivateBrowsing; + "extensions.activeThemeID" = "{2adf0361-e6d8-4b74-b3bc-3f450e8ebb69}"; + }; + + search = { + force = true; + default = "DuckDuckGo"; + engines = { + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ ":np" ]; + }; + + "NixOS Wiki" = { + urls = [ { template = "https://wiki.nixos.org/index.php?search={searchTerms}"; } ]; + iconUpdateURL = "https://wiki.nixos.org/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ ":nw" ]; + }; + + "ArchWiki" = { + urls = [ { template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; } ]; + iconUpdateURL = "https://wiki.archlinux.org/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ ":aw" ]; + }; + + "Ecosia" = { + urls = [ { template = "https://www.ecosia.org/search?q={searchTerms}"; } ]; + iconUpdateURL = "https://ecosia.org/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@eco" ]; + }; + + "Wikipedia (de)" = { + urls = [ { template = "https://de.wikipedia.org/w/index.php?search={searchTerms}"; } ]; + iconUpdateURL = "https://wikipedia.org/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ ":wd" ]; + }; + + "IMDb" = { + urls = [ { template = "https://www.imdb.com/find/?q={searchTerms}"; } ]; + iconUpdateURL = "https://imdb.com/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ ":f" ]; + }; + + "dict.cc (de<->en)" = { + urls = [ { template = "https://www.dict.cc/?s={searchTerms}"; } ]; + iconUpdateURL = "https://dict.cc/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ ":d" ]; + }; + + "MyNixOS" = { + urls = [ { template = "https://mynixos.com/search?q={searchTerms}"; } ]; + iconUpdateURL = "https://mynixos.com/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ ":mn" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.hidden = true; + "DuckDuckGo".metaData.alias = "@ddg"; # builtin engines only support specifying one additional alias + "Wikipedia (en)".metaData.alias = ":w"; # builtin engines only support specifying one additional alias + }; + + order = [ + "DuckDuckGo" + "Nix Packages" + "ArchWiki" + "Nix Wiki" + "Ecosia" + ]; + }; + + bookmarks = [ + + ]; + + userChrome = '' + /*** Remove items from image context menu ***/ + + /* Email Image... */ + #context-sendimage, + + /* Set Image as Desktop Background... (and preceding separator) */ + #context-sep-setbackground, #context-setDesktopBackground, + + /* Inspect Accessibility Properties */ + #context-inspect-a11y { display: none !important; } + + /* Disable Firefox View */ + #firefox-view-button { display: none !important; } + + /* Disable Tab Bar ('cause TST) */ + #TabsToolbar-customization-target { visibility: collapse !important; } + + /* Remove flexible spaces + #customizableui-special-spring1 { display: non !important; } + #customizableui-special-spring4 { display: non !important; } + ''; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock index 9ba97ae..c9dbdba 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,42 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -36,10 +73,64 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1730768919, + "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1732021966, + "narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "3308484d1a443fc5bc92012435d79e80458fe43c", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" } } }, diff --git a/flake.nix b/flake.nix index 58065f8..94e9d70 100644 --- a/flake.nix +++ b/flake.nix @@ -1,29 +1,69 @@ { - description = "NixOS configuration"; + description = "Home Manager configuration of Leon Wilzer"; inputs = { + # Specify the source of Home Manager and Nixpkgs. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + pre-commit-hooks.url = "github:cachix/git-hooks.nix"; }; - outputs = inputs@{ nixpkgs, home-manager, ... }: { - nixosConfigurations = { - hostname = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./configuration.nix - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.leon = import ./home.nix; + outputs = + { + self, + nixpkgs, + home-manager, + ... + }@inputs: + let + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in + { - # Optionally, use home-manager.extraSpecialArgs to pass - # arguments to home.nix - } + checks = forAllSystems (system: { + pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + nixfmt-rfc-style.enable = true; + }; + }; + }); + + devShells = forAllSystems (system: { + default = nixpkgs.legacyPackages.${system}.mkShell { + inherit (self.checks.${system}.pre-commit-check) shellHook; + buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; + }; + }); + + homeConfigurations."lwilzer" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ + ./work.nix + ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + + homeConfigurations."leon" = home-manager.lib.homeManagerConfiguration { + modules = [ + ./home.nix ]; }; }; - }; } diff --git a/home.nix b/home.nix index 5d2664b..3590d0d 100644 --- a/home.nix +++ b/home.nix @@ -5,948 +5,39 @@ let homeDir = "/home/${username}"; in { - #imports = - #[ - # ./hypr.nix - #]; + imports = [ + # ./hypr.nix + ./common.nix + ./firefox.nix + ]; # Home Manager needs a bit of information about you and the # paths it should manage. home.username = username; home.homeDirectory = homeDir; - xdg.mimeApps = { - enable = true; - - defaultApplications = { - "text/html" = "firefox.desktop"; - "x-scheme-handler/http" = "firefox.desktop"; - "x-scheme-handler/https" = "firefox.desktop"; - "x-scheme-handler/about" = "firefox.desktop"; - "x-scheme-handler/unknown" = "firefox.desktop"; - "application/pdf" = "org.pwmt.zathura-ps.desktop"; - "x-scheme-handler/mailto" = "userapp-Thunderbird-3NBJQ2.desktop"; - "x-scheme-handler/mid" = "userapp-Thunderbird-3NBJQ2.desktop"; - "x-scheme-handler/news" = "userapp-Thunderbird-QJOCQ2.desktop"; - "x-scheme-handler/snews" = "userapp-Thunderbird-QJOCQ2.desktop"; - "x-scheme-handler/nntp" = "userapp-Thunderbird-QJOCQ2.desktop"; - "x-scheme-handler/feed" = "userapp-Thunderbird-EIXEQ2.desktop"; - "application/rss+xml" = "userapp-Thunderbird-EIXEQ2.desktop"; - "application/x-extension-rss" = "userapp-Thunderbird-EIXEQ2.desktop"; - "x-scheme-handler/webcal" = "userapp-Thunderbird-LBFEQ2.desktop"; - "x-scheme-handler/webcals" = "userapp-Thunderbird-LBFEQ2.desktop"; - - "message/rfc822" = "userapp-Thunderbird-3NBJQ2.desktop"; - "text/calendar" = "userapp-Thunderbird-LBFEQ2.desktop"; - "application/x-extension-ics" = "userapp-Thunderbird-LBFEQ2.desktop"; - "application/x-bittorrent;x-scheme-handler/magnet" = "transmission-remote-gtk.desktop"; + programs.firefox = { + forcePrivateBrowsing = false; + policies.DNSOverHTTPS = { + Enabled = true; + ProviderURL = "https://family.cloudflare-dns.com/dns-query"; + Locked = true; + Fallback = false; }; }; - # Allow unfree packages (crying FSF noises) - nixpkgs.config.allowUnfree = true; - nixpkgs.config.packageOverrides = pkgs: { - nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { - inherit pkgs; - }; - }; - - # Packages that should be installed to the user profile. - home.packages = with pkgs; [ - prismlauncher # Minecraft - element-desktop # Matrix Desktop Client - tidal-hifi # Tidal Web Client - helvum # pipewire patchbay - bitwarden-cli # password and secret manager - ansible # declarative server managment - packwiz # Minecraft mod pack managment - just # A handy way to save and run project-specific commands - ydotool # wayland automation tool - lunarvim # IDE layer for Neovim - cloudflared # cloudflare things - - sbctl # For debugging and troubleshooting Secure Boot - killall # killall - dmenu # (program) picker for Xorg - xorg.xauth # Dependency of startx (??) - wl-clipboard # Wayland clipboard functionality - bottom # htop, but in Rust and better - tree # tree - fzf # Fuzzy Find - pwvucontrol # pipewire volume control - brave # Chromium based fallback browser - qalculate-gtk # Best calculator ever - #home-manager # Nix's Home-Manager - catppuccin-cursors.mochaDark # Catppuccin Mouse Cursors - wofi # dmenu, but for wlroots wayland - kitty # kitty terminal emulator - waybar # Status bar for wayland compositors - grim # screenshot tool - playerctl # Media control - slurp # selection tool - mako # Notification Daemon - nmap # port scanning tool - libreoffice-qt # Office Suite - hunspell # Spellchecking - hunspellDicts.de_DE # German Spellcheck - hunspellDicts.en_US # English Spellcheck - shellcheck # Shell linter - jq # JSON utility - texlive.combined.scheme-full # LaTeX - zathura # minimal PDF Viewer - gimp # gnu image manipulation program - p7zip # (7)zip tool - zip # standard unix zip tool - thunderbird # E-Mail & Calendar - signal-desktop # Signal Desktop Client - lazygit # Terminal git frontend - mpv # Video Playback - vlc # media playback - imv # minimal image viewer - celluloid # mpv frontend - mumble # FOSS Steam Speak - easyeffects # some audio effects - hypridle # idle daemon for hyprland - hyprpaper # Hyprpland backgrounds - brightnessctl # brightness control cli - rustc # rust compiler - rust-analyzer # Rust LSP - cargo # rust build tool - gcc # GNU Compiler Collections - clang-tools # LSP Server + formatter - nodePackages.vscode-json-languageserver # ZED Json LSP - ddcutil # Screen controls - wireguard-tools # Wireguard - man-pages # dev man pages - man-pages-posix # dev man pages - #(catppuccin-sddm.override { - # flavor = "mocha"; - # font = "Fira Sans"; - # fontSize = "9"; - # backgroundbin = "$XDG_PICTURES_DIR/Wallpapers/current"; - # loginBackground = true; - #}) - steamcmd # steamcmd - wget # downloader - xclip # Clipboard - wine # win translator - protontricks # Managment of proton enabled games - lutris # Linux Game Manager - discord # !delete voip/messenger - brasero # Disc-Burner - cdrtools # CD tools - cdrdao # CD tools - dvdplusrwtools # DVD + Blu-ray tools - tidal-dl # Tidal ripper - vscodium-fhs # VS Code - niv # Nix dependency managment - bottles # WINE Prefix manager - transmission-remote-gtk # Torrent Client - qemu # Virtualization/Emulation - bash # Compat - jetbrains.idea-ultimate # IntelliJ Ultimate - jetbrains.idea-community # IntelliJ Community - maven # Java Build tool - jdk # Java development kit - nixfmt-rfc-style # official nix formatter - ]; - - programs = { - zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - autocd = true; - shellAliases = { - git-list-untracked = ''git fetch --prune && git branch -r | awk "{print \$1}" | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk "{print \$1}"''; - git-remove-untracked = ''git fetch --prune && git branch -r | awk "{print \$1}" | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk "{print \$1}" | xargs git branch -d''; - }; - }; - bash.enable = true; - kitty = { - enable = true; - themeFile = "Catppuccin-Mocha"; - font = { - name = "Fira Code"; - package = pkgs.fira-code; - }; - settings = { - enable_audio_bell = false; - background_opacity = 0.85; + programs.ssh.customMatchBlocks = + let + sshDir = "${homeDir}/.ssh"; + in + { + "uni-paderborn.de upb.de *.uni-paderborn.de *.upb.de" = { + user = "lwilzer"; + identityFile = "${sshDir}/unipaderborn"; }; }; - git = { - enable = true; - userName = "Leon Wilzer"; - userEmail = "git@komu.boo"; - aliases = { - ci = "commit"; - co = "checkout"; - s = "status"; - undo = "reset --soft 'HEAD^'"; - a = "add"; - p = "push"; - cl = "clone"; - }; - signing = { - signByDefault = true; - key = "0x645EFCD19E59ED05"; - }; - extraConfig = { - push = { - autoSetupRemote = true; - }; - }; - }; - - gpg = { - enable = true; - }; - - ssh = - let - sshDir = "${homeDir}/.ssh"; - startAgent = true; - in - { - enable = true; - matchBlocks = { - "libre.moe *.libre.moe" = { - user = "leon"; - identityFile = "${sshDir}/libremoe"; - }; - "komu.boo *.komu.boo" = { - user = "root"; - identityFile = "${sshDir}/komuboo"; - }; - "uni-paderborn.de upb.de *.uni-paderborn.de *.upb.de" = { - user = "lwilzer"; - identityFile = "${sshDir}/unipaderborn"; - }; - }; - }; - - neovim = { - enable = true; - defaultEditor = true; - vimAlias = true; - viAlias = true; - extraConfig = '' - " General - set number - set relativenumber - set cc=120 - set tabstop=4 - set softtabstop=0 noexpandtab - set shiftwidth=4 - colorscheme catppuccin-mocha - - " VimTex - filetype plugin indent on - syntax enable - let g:vimtex_view_method = 'zathura' - - " Vim-LaTeX-live-preview - let g:livepreview_previewer = 'zathura' - ''; - plugins = with pkgs.vimPlugins; [ - vimtex - vim-latex-live-preview - catppuccin-nvim - ]; - }; - - hyprlock.enable = true; - zed-editor.enable = true; - - firefox = { - enable = true; - languagePacks = [ - "en-US" - "de" - ]; - - # ---- POLICIES ---- - # Check about:policies#documentation for options. - policies = { - BlockAboutAddons = true; - BlockAboutConfig = false; - BlockAboutProfiles = true; - DisableTelemetry = true; - DisableFirefoxStudies = true; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - DisablePocket = true; - DisableFirefoxAccounts = true; - DisableAccounts = true; - DisableFirefoxScreenshots = true; - OverrideFirstRunPage = ""; - OverridePostUpdatePage = ""; - AppAutoUpdate = false; - DontCheckDefaultBrowser = true; - PrimaryPassword = false; - OfferToSaveLoginsDefault = false; - PasswordmanagerEnabled = false; - DisableMasterPasswordCreation = true; - AutofillAddressEnabled = false; - HttpsOnlyMode = "force_enabled"; - AutofillCreditCardEnabled = false; - DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" - DisplayMenuBar = "never"; # alternatives: "always", "never" or "default-on" - NoDefaultBookmarks = true; - SearchEngines = { - PreventInstalls = true; - Default = "DuckDuckGo"; - Remove = [ - "Google" - "Bing" - ]; - }; - SearchSuggestEnabled = false; - FirefoxHome = { - Search = true; - TopSites = false; - SponsoredTopSites = false; - Highlights = false; - Pocket = false; - SponsoredPocket = false; - Snippets = false; - Locked = false; - }; - - SearchBar = "unified"; # alternative: "separate" - DNSOverHTTPS = { - Enabled = true; - ProviderURL = "https://family.cloudflare-dns.com/dns-query"; - Locked = true; - Fallback = false; - }; - }; - - # ---- PREFERENCES ---- - # Check about:config for options. - #preferencesStatus = "locked"; # locks all settings - profiles.default = { - containersForce = true; - isDefault = true; - settings = { - "browser.contentblocking.category" = "strict"; - "extensions.pocket.enabled" = false; - "extensions.screenshots.disabled" = true; - "browser.topsites.contile.enabled" = false; - "browser.formfill.enable" = false; - "browser.search.suggest.enabled" = false; - "browser.search.suggest.enabled.private" = false; - "browser.urlbar.suggest.searches" = false; - "browser.urlbar.showSearchSuggestionsFirst" = false; - "browser.newtabpage.activity-stream.feeds.section.topstories" = false; - "browser.newtabpage.activity-stream.feeds.snippets" = false; - "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; - "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false; - "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false; - "browser.newtabpage.activity-stream.section.highlights.includeVisited" = false; - "browser.newtabpage.activity-stream.showSponsored" = false; - "browser.newtabpage.activity-stream.system.showSponsored" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "extensions.autoDisableScopes" = 0; - "browser.translations.neverTranslateLanguages" = true; - "browser.translations.alwaysTranslateLanguages" = false; - "browser.warnOnQuit" = false; - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - }; - - search = { - force = true; - default = "DuckDuckGo"; - engines = { - "Nix Packages" = { - urls = [ - { - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - } - ]; - - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ ":np" ]; - }; - - "NixOS Wiki" = { - urls = [ { template = "https://wiki.nixos.org/index.php?search={searchTerms}"; } ]; - iconUpdateURL = "https://wiki.nixos.org/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ ":nw" ]; - }; - - "ArchWiki" = { - urls = [ { template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; } ]; - iconUpdateURL = "https://wiki.archlinux.org/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ ":aw" ]; - }; - - "Ecosia" = { - urls = [ { template = "https://www.ecosia.org/search?q={searchTerms}"; } ]; - iconUpdateURL = "https://ecosia.org/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@eco" ]; - }; - - "Wikipedia (de)" = { - urls = [ { template = "https://de.wikipedia.org/w/index.php?search={searchTerms}"; } ]; - iconUpdateURL = "https://wikipedia.org/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ ":wd" ]; - }; - - "IMDb" = { - urls = [ { template = "https://www.imdb.com/find/?q={searchTerms}"; } ]; - iconUpdateURL = "https://imdb.com/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ ":f" ]; - }; - - "dict.cc (de<->en)" = { - urls = [ { template = "https://www.dict.cc/?s={searchTerms}"; } ]; - iconUpdateURL = "https://dict.cc/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ ":d" ]; - }; - - "Bing".metaData.hidden = true; - "Google".metaData.hidden = true; - "DuckDuckGo".metaData.alias = "@ddg"; # builtin engines only support specifying one additional alias - "Wikipedia (en)".metaData.alias = ":w"; # builtin engines only support specifying one additional alias - }; - - order = [ - "DuckDuckGo" - "Nix Packages" - "ArchWiki" - "Nix Wiki" - "Ecosia" - ]; - }; - - userChrome = '' - /*** Remove items from image context menu ***/ - - /* Email Image... */ - #context-sendimage, - - /* Set Image as Desktop Background... (and preceding separator) */ - #context-sep-setbackground, #context-setDesktopBackground, - - /* Inspect Accessibility Properties */ - #context-inspect-a11y - { - display: none !important; - } - - /* Disable Firefox View */ - #firefox-view-button - { - display: none !important; - } - ''; - -# userChrome = '' -# * e.g. playing indicator (the text, not the icon) */ -#.tab-secondary-label { display: none !important; } -# -#/*---+---+---+---+---+---+---+ -# | C | O | L | O | U | R | S | -# +---+---+---+---+---+---+---*/ -# -# -#@media (prefers-color-scheme: dark) { :root { -# -# /* These colours are (mainly) used by the -# Container Tabs Plugin */ -# --uc-identity-colour-blue: #7ED6DF; -# --uc-identity-colour-turquoise: #55E6C1; -# --uc-identity-colour-green: #B8E994; -# --uc-identity-colour-yellow: #F7D794; -# --uc-identity-colour-orange: #F19066; -# --uc-identity-colour-red: #FC5C65; -# --uc-identity-colour-pink: #F78FB3; -# --uc-identity-colour-purple: #786FA6; -# -# /* Cascades main Colour Scheme */ -# --uc-base-colour: #1E2021; -# --uc-highlight-colour: #191B1C; -# --uc-inverted-colour: #FAFAFC; -# --uc-muted-colour: #AAAAAC; -# --uc-accent-colour: var(--uc-identity-colour-purple); -# -#}} -# -# -#@media (prefers-color-scheme: light) { :root { -# -# /* These colours are (mainly) used by the -# Container Tabs Plugin */ -# --uc-identity-colour-blue: #1D65F5; -# --uc-identity-colour-turquoise: #209FB5; -# --uc-identity-colour-green: #40A02B; -# --uc-identity-colour-yellow: #E49320; -# --uc-identity-colour-orange: #FE640B; -# --uc-identity-colour-red: #FC5C65; -# --uc-identity-colour-pink: #EC83D0; -# --uc-identity-colour-purple: #822FEE; -# -# /* Cascades main Colour Scheme */ -# --uc-base-colour: #FAFAFC; -# --uc-highlight-colour: #DADADC; -# --uc-inverted-colour: #1E2021; -# --uc-muted-colour: #191B1C; -# --uc-accent-colour: var(--uc-identity-colour-purple); -# -#}} -# -# -# -# -# -# -#/* Down here I'm just reassigning variables based on the colours set above. -# Feel free to play around with these but there is no editing necessary below this line. c: -# */ -# -#:root { -# -# --lwt-frame: var(--uc-base-colour) !important; -# --lwt-accent-color: var(--lwt-frame) !important; -# --lwt-text-color: var(--uc-inverted-colour) !important; -# -# --toolbar-field-color: var(--uc-inverted-colour) !important; -# -# --toolbar-field-focus-color: var(--uc-inverted-colour) !important; -# --toolbar-field-focus-background-color: var(--uc-highlight-colour) !important; -# --toolbar-field-focus-border-color: transparent !important; -# -# --toolbar-field-background-color: var(--lwt-frame) !important; -# --lwt-toolbar-field-highlight: var(--uc-inverted-colour) !important; -# --lwt-toolbar-field-highlight-text: var(--uc-highlight-colour) !important; -# --urlbar-popup-url-color: var(--uc-accent-colour) !important; -# -# --lwt-tab-text: var(--lwt-text-colour) !important; -# -# --lwt-selected-tab-background-color: var(--uc-highlight-colour) !important; -# -# --toolbar-bgcolor: var(--lwt-frame) !important; -# --toolbar-color: var(--lwt-text-color) !important; -# --toolbarseparator-color: var(--uc-accent-colour) !important; -# --toolbarbutton-hover-background: var(--uc-highlight-colour) !important; -# --toolbarbutton-active-background: var(--toolbarbutton-hover-background) !important; -# -# --lwt-sidebar-background-color: var(--lwt-frame) !important; -# --sidebar-background-color: var(--lwt-sidebar-background-color) !important; -# -# --urlbar-box-bgcolor: var(--uc-highlight-colour) !important; -# --urlbar-box-text-color: var(--uc-muted-colour) !important; -# --urlbar-box-hover-bgcolor: var(--uc-highlight-colour) !important; -# --urlbar-box-hover-text-color: var(--uc-inverted-colour) !important; -# --urlbar-box-focus-bgcolor: var(--uc-highlight-colour) !important; -# -#} -# -# -# -#.identity-color-blue { --identity-tab-color: var(--uc-identity-colour-blue) !important; --identity-icon-color: var(--uc-identity-colour-blue) !important; } -#.identity-color-turquoise { --identity-tab-color: var(--uc-identity-colour-turquoise) !important; --identity-icon-color: var(--uc-identity-colour-turquoise) !important; } -#.identity-color-green { --identity-tab-color: var(--uc-identity-colour-green) !important; --identity-icon-color: var(--uc-identity-colour-green) !important; } -#.identity-color-yellow { --identity-tab-color: var(--uc-identity-colour-yellow) !important; --identity-icon-color: var(--uc-identity-colour-yellow) !important; } -#.identity-color-orange { --identity-tab-color: var(--uc-identity-colour-orange) !important; --identity-icon-color: var(--uc-identity-colour-orange) !important; } -#.identity-color-red { --identity-tab-color: var(--uc-identity-colour-red) !important; --identity-icon-color: var(--uc-identity-colour-red) !important; } -#.identity-color-pink { --identity-tab-color: var(--uc-identity-colour-pink) !important; --identity-icon-color: var(--uc-identity-colour-pink) !important; } -#.identity-color-purple { --identity-tab-color: var(--uc-identity-colour-purple) !important; --identity-icon-color: var(--uc-identity-colour-purple) !important; } -# -#:root { -# -# --toolbarbutton-border-radius: var(--uc-border-radius) !important; -# --tab-border-radius: var(--uc-border-radius) !important; -# --arrowpanel-border-radius: var(--uc-border-radius) !important; -# -#} -# -# -# -# -# -##main-window, -##toolbar-menubar, -##TabsToolbar, -##navigator-toolbox, -##sidebar-box, -##nav-bar { box-shadow: none !important; } -# -# -##main-window, -##toolbar-menubar, -##TabsToolbar, -##PersonalToolbar, -##navigator-toolbox, -##sidebar-box, -##nav-bar { border: none !important; } -# -# -#/* remove "padding" left and right from tabs */ -#.titlebar-spacer { display: none !important; } -# -#/* fix Shield Icon padding */ -##urlbar-input-container[pageproxystate="valid"] -# > #tracking-protection-icon-container -# > #tracking-protection-icon-box -# > #tracking-protection-icon { -# padding-bottom: 1px; -#} -# -# -# -# -# -##PersonalToolbar { -# -# padding: 6px !important; -# box-shadow: inset 0 0 50vh rgba(0, 0, 0, var(--uc-darken-toolbar)) !important;; -# -#} -# -# -# -# -# -##statuspanel #statuspanel-label { -# -# border: none !important; -# border-radius: var(--uc-border-radius) !important; -# -#} -# -#@media (min-width: 1000px) { -# -# -# #navigator-toolbox { display: flex; flex-wrap: wrap; flex-direction: row; } -# -# -# #nav-bar { -# -# order: var(--uc-urlbar-position); -# width: var(--uc-urlbar-min-width); -# -# } -# -# #nav-bar #urlbar-container { min-width: 0px !important; width: auto !important; } -# -# -# #titlebar { -# -# order: 2; -# width: calc(100vw - var(--uc-urlbar-min-width) - 1px); -# -# } -# -# -# #PersonalToolbar { -# -# order: var(--uc-toolbar-position); -# width: 100%; -# -# } -# -# -# #navigator-toolbox:focus-within #nav-bar { width: var(--uc-urlbar-max-width); } -# #navigator-toolbox:focus-within #titlebar { width: calc(100vw - var(--uc-urlbar-max-width) - 1px); } -# -# -#} -# -##statuspanel #statuspanel-label { margin: 0 0 var(--uc-status-panel-spacing) var(--uc-status-panel-spacing) !important; } -# -##navigator-toolbox:not(:-moz-lwtheme) { background: var(--toolbar-field-background-color) !important; } -# -# -# -##nav-bar { -# -# padding-block-start: 0px !important; -# -# border: none !important; -# box-shadow: none !important; -# background: transparent !important; -# -#} -# -# -##urlbar, -##urlbar * { -# -# padding-block-start: var(--uc-urlbar-top-spacing) !important; -# -# outline: none !important; -# box-shadow: none !important; -# -#} -# -# -##urlbar-background { border: transparent !important; } -# -##urlbar[focused='true'] -# > #urlbar-background, -##urlbar:not([open]) -# > #urlbar-background { background: var(--toolbar-field-background-color) !important; } -# -# -##urlbar[open] -# > #urlbar-background { background: var(--toolbar-field-background-color) !important; } -# -# -#.urlbarView-row:hover -# > .urlbarView-row-inner, -#.urlbarView-row[selected] -# > .urlbarView-row-inner { background: var(--toolbar-field-focus-background-color) !important; } -# -# -#.urlbar-icon, #urlbar-go-button { margin: auto; } -#.urlbar-page-action { padding: 0 inherit !important; } -#.urlbar-page-action .urlbar-icon { margin-top: 6px !important; } -# -#/* remove gap after pinned tabs */ -##tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs]) -# > #tabbrowser-arrowscrollbox -# > .tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])) { margin-inline-start: 0 !important; } -# -# -#/* Hides the list-all-tabs button*/ -##alltabs-button { display: var(--uc-show-all-tabs-button) !important; } -# -# -#/* remove tab shadow */ -#.tabbrowser-tab -# >.tab-stack -# > .tab-background { box-shadow: none !important; } -# -# -#/* multi tab selection */ -##tabbrowser-tabs:not([noshadowfortests]) .tabbrowser-tab:is([multiselected]) -# > .tab-stack -# > .tab-background:-moz-lwtheme { outline-color: var(--toolbarseparator-color) !important; } -# -# -# -# -# -#/* tab close button options */ -#.tabbrowser-tab:not([pinned]) .tab-close-button { display: var(--show-tab-close-button) !important; } -#.tabbrowser-tab:not([pinned]):hover .tab-close-button { display: var(--show-tab-close-button-hover) !important } -# -# -# -# -# -#/* adaptive tab width */ -#.tabbrowser-tab[selected][fadein]:not([pinned]) { max-width: var(--uc-active-tab-width) !important; } -#.tabbrowser-tab[fadein]:not([selected]):not([pinned]) { max-width: var(--uc-inactive-tab-width) !important; } -# -# -# -# -# -#/* container tabs indicator */ -#.tabbrowser-tab[usercontextid] -# > .tab-stack -# > .tab-background -# > .tab-context-line { -# -# margin: -1px var(--container-tabs-indicator-margin) 0 var(--container-tabs-indicator-margin) !important; -# height: 1px !important; -# -# box-shadow: var(--uc-identity-glow) var(--identity-tab-color) !important; -# -#} -# -# -# -# -# -#/* show favicon when media is playing but tab is hovered */ -#.tab-icon-image:not([pinned]) { opacity: 1 !important; } -# -# -#/* Makes the speaker icon to always appear if the tab is playing (not only on hover) */ -#.tab-icon-overlay:not([crashed]), -#.tab-icon-overlay[pinned][crashed][selected] { -# -# top: 5px !important; -# z-index: 1 !important; -# -# padding: 1.5px !important; -# inset-inline-end: -8px !important; -# width: 16px !important; height: 16px !important; -# -# border-radius: 10px !important; -# -#} -# -# -#/* style and position speaker icon */ -#.tab-icon-overlay:not([sharing], [crashed]):is([soundplaying], [muted], [activemedia-blocked]) { -# -# stroke: transparent !important; -# background: transparent !important; -# opacity: 1 !important; fill-opacity: 0.8 !important; -# -# color: currentColor !important; -# -# stroke: var(--toolbar-bgcolor) !important; -# background-color: var(--toolbar-bgcolor) !important; -# -#} -# -# -#/* change the colours of the speaker icon on active tab to match tab colours */ -#.tabbrowser-tab[selected] .tab-icon-overlay:not([sharing], [crashed]):is([soundplaying], [muted], [activemedia-blocked]) { -# -# stroke: var(--toolbar-bgcolor) !important; -# background-color: var(--toolbar-bgcolor) !important; -# -#} -# -# -#.tab-icon-overlay:not([pinned], [sharing], [crashed]):is([soundplaying], [muted], [activemedia-blocked]) { margin-inline-end: 9.5px !important; } -# -# -#.tabbrowser-tab:not([image]) .tab-icon-overlay:not([pinned], [sharing], [crashed]) { -# -# top: 0 !important; -# -# padding: 0 !important; -# margin-inline-end: 5.5px !important; -# inset-inline-end: 0 !important; -# -#} -# -# -#.tab-icon-overlay:not([crashed])[soundplaying]:hover, -#.tab-icon-overlay:not([crashed])[muted]:hover, -#.tab-icon-overlay:not([crashed])[activemedia-blocked]:hover { -# -# color: currentColor !important; -# stroke: var(--toolbar-color) !important; -# background-color: var(--toolbar-color) !important; -# fill-opacity: 0.95 !important; -# -#} -# -# -#.tabbrowser-tab[selected] .tab-icon-overlay:not([crashed])[soundplaying]:hover, -#.tabbrowser-tab[selected] .tab-icon-overlay:not([crashed])[muted]:hover, -#.tabbrowser-tab[selected] .tab-icon-overlay:not([crashed])[activemedia-blocked]:hover { -# -# color: currentColor !important; -# stroke: var(--toolbar-color) !important; -# background-color: var(--toolbar-color) !important; -# fill-opacity: 0.95 !important; -# -#} -# -# -#/* speaker icon colour fix */ -##TabsToolbar .tab-icon-overlay:not([crashed])[soundplaying], -##TabsToolbar .tab-icon-overlay:not([crashed])[muted], -##TabsToolbar .tab-icon-overlay:not([crashed])[activemedia-blocked] { color: var(--toolbar-color) !important; } -# -# -#/* speaker icon colour fix on hover */ -##TabsToolbar .tab-icon-overlay:not([crashed])[soundplaying]:hover, -##TabsToolbar .tab-icon-overlay:not([crashed])[muted]:hover, -##TabsToolbar .tab-icon-overlay:not([crashed])[activemedia-blocked]:hover { color: var(--toolbar-bgcolor) !important; } -# -#/* selected tab colour fix*/ -#.tabbrowser-tab[selected] .tab-content { -# background-color: var(--uc-highlight-colour) !important; -#} -# ''; - - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - ublock-origin - bitwarden - darkreader - privacy-badger - languagetool - ]; - }; - }; - }; - - xdg.portal = { - enable = true; - configPackages = with pkgs; [ hyprland ]; - extraPortals = with pkgs; [ hyprland ]; - }; - - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. - # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - home.stateVersion = "24.05"; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - - # X11 - xsession.enable = true; - xsession.windowManager.command = "dwm"; - - gtk = { - enable = true; - theme = { - name = "Catppuccin Mocha"; - package = pkgs.catppuccin-gtk; - }; - }; - qt = { - enable = true; - platformTheme.name = "gtk"; - style = { - name = "Catppuccin Mocha"; - package = pkgs.catppuccin; - }; - }; - - services = { - mako = { - enable = true; - defaultTimeout = 8000; - }; - - gpg-agent = { - enable = true; - }; - }; - dconf.settings = { - "org/virt-manager/virt-manager/connections" = { - autoconnect = [ "qemu:///system" ]; - uris = [ "qemu:///system" ]; - }; + programs.git.signing = { + signByDefault = true; + key = "0x645EFCD19E59ED05"; }; } diff --git a/hypr.nix b/hypr.nix index dbdaa2e..a3cce6d 100644 --- a/hypr.nix +++ b/hypr.nix @@ -1,80 +1,76 @@ -{...}: +{ ... }: { - #imports = [ - # ./theme.nix - #]; - ### Hyprland - wayland.windowManager.hyprland = - { - enable = true; - settings = { - ### DEBUG - debug = { - disable_logs = false; - }; + #imports = [ + # ./theme.nix + #]; + ### Hyprland + wayland.windowManager.hyprland = { + enable = true; + settings = { + ### DEBUG + debug = { + disable_logs = false; + }; - ### Refer to the wiki for more information. - ### https://wiki.hyprland.org/Configuring/Configuring-Hyprland/ + ### Refer to the wiki for more information. + ### https://wiki.hyprland.org/Configuring/Configuring-Hyprland/ - ### Theme - source = [ "$XDG_CONFIG_HOME/hypr/mocha.conf" ]; + ### Theme + source = [ "$XDG_CONFIG_HOME/hypr/mocha.conf" ]; - ### Fuck you NVIDIA! - cursor = { - no_hardware_cursors = true; - }; - - ### Monitors - # See https://wiki.hyprland.org/Configuring/Monitors/ - monitor = [ - " , preferred, auto, 1" - "DP-1, preferred, auto, 1, bitdepth, 10" - ]; + ### Fuck you NVIDIA! + cursor = { + no_hardware_cursors = true; + }; - ### Programs + ### Monitors + # See https://wiki.hyprland.org/Configuring/Monitors/ + monitor = [ + " , preferred, auto, 1" + "DP-1, preferred, auto, 1, bitdepth, 10" + ]; - ## Defaults - "$terminal" = "kitty"; - "$menu" = "wofi --show drun"; + ### Programs - ## Autostart - exec-once = [ - # Status bar - "waynbar" - # Display Random Wallpaper - "unlink $XDG_PICTURES_DIR/Wallpapers/current ; ln -s $XDG_PICTURES_DIR/Wallpapers/$(ls $XDG_PICTURES_DIR/Wallpapers | sort -R | tail -1) $XDG_PICTURES_DIR/Wallpapers/current && hyprpaper" - # Notification Daemon - "mako" - # Idle Manager - "hypridle" - ]; + ## Defaults + "$terminal" = "kitty"; + "$menu" = "wofi --show drun"; - ### Environment Variables - env = - [ - "LIBVA_DRIVER_NAME,nvidia" # fNVIDIA - "XDG_SESSION_TYPE,wayland" # fNVIDIA - "GBM_BACKEND,nvidia-drm" # fNVIDIA - "__GLX_VENDOR_LIBRARY_NAME,nvidia" # fNVIDIA - "NVD_BACKEND,direct" # fNVIDIA - "ELECTRON_OZONE_PLATFORM_HINT,auto" # fNVIDIA - "XCURSOR_SIZE,24" - "HYPRCURSOR_SIZE,24" - ]; + ## Autostart + exec-once = [ + # Status bar + "waynbar" + # Display Random Wallpaper + "unlink $XDG_PICTURES_DIR/Wallpapers/current ; ln -s $XDG_PICTURES_DIR/Wallpapers/$(ls $XDG_PICTURES_DIR/Wallpapers | sort -R | tail -1) $XDG_PICTURES_DIR/Wallpapers/current && hyprpaper" + # Notification Daemon + "mako" + # Idle Manager + "hypridle" + ]; - ### Look and Feel - # Refer to https://wiki.hyprland.org/Configuring/Variables/ - # https://wiki.hyprland.org/Configuring/Variables/#general - general = - { - gaps_in = 4; - gaps_out = 8; + ### Environment Variables + env = [ + "LIBVA_DRIVER_NAME,nvidia" # fNVIDIA + "XDG_SESSION_TYPE,wayland" # fNVIDIA + "GBM_BACKEND,nvidia-drm" # fNVIDIA + "__GLX_VENDOR_LIBRARY_NAME,nvidia" # fNVIDIA + "NVD_BACKEND,direct" # fNVIDIA + "ELECTRON_OZONE_PLATFORM_HINT,auto" # fNVIDIA + "XCURSOR_SIZE,24" + "HYPRCURSOR_SIZE,24" + ]; - border_size = 2; - - - }; - }; - }; + ### Look and Feel + # Refer to https://wiki.hyprland.org/Configuring/Variables/ + # https://wiki.hyprland.org/Configuring/Variables/#general + general = { + gaps_in = 4; + gaps_out = 8; + + border_size = 2; + + }; + }; + }; } diff --git a/theme.nix b/theme.nix index cac68c7..e893585 100644 --- a/theme.nix +++ b/theme.nix @@ -1,43 +1,49 @@ -{ pkgs, inputs, ...}: +{ pkgs, inputs, ... }: { - inputs = { - nixpkgs.url = "nixpkgs/nixos-unstable"; - catppuccin.url = "github:catppuccin/nix"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = { nixpkgs, catppuccin, home-manager }: { - # for nixos module home-manager installations - nixosConfigurations.Zuse1 = pkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - catppuccin.nixosModules.catppuccin - # if you use home-manager - home-manager.nixosModules.home-manager - - { - # if you use home-manager - home-manager.users.leon = { - imports = [ - ./home.nix - catppuccin.homeManagerModules.catppuccin - ]; - }; - } - ]; - }; - - # for standalone home-manager installations - homeConfigurations.leon = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; - modules = [ - ./home.nix - catppuccin.homeManagerModules.catppuccin - ]; + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + catppuccin.url = "github:catppuccin/nix"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; + + outputs = + { + nixpkgs, + catppuccin, + home-manager, + }: + { + # for nixos module home-manager installations + nixosConfigurations.Zuse1 = pkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + catppuccin.nixosModules.catppuccin + # if you use home-manager + home-manager.nixosModules.home-manager + + { + # if you use home-manager + home-manager.users.leon = { + imports = [ + ./home.nix + catppuccin.homeManagerModules.catppuccin + ]; + }; + } + ]; + }; + + # for standalone home-manager installations + homeConfigurations.leon = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + modules = [ + ./home.nix + catppuccin.homeManagerModules.catppuccin + ]; + }; + }; } diff --git a/work.nix b/work.nix new file mode 100644 index 0000000..dfe87e5 --- /dev/null +++ b/work.nix @@ -0,0 +1,44 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: + +let + username = "lwilzer"; + homeDir = "/upb/users/l/${username}/profiles/unix/cs"; +in +{ + imports = [ + ./common.nix + ./firefox.nix + # ./hypr.nix + ]; + + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = username; + home.homeDirectory = homeDir; + + programs.firefox.forcePrivateBrowsing = true; + + common.userHome = homeDir; + + programs.ssh.customMatchBlocks = + let + sshDir = "${homeDir}/.ssh"; + in + { + "swtpra-9.cs.uni-paderborn.de" = { + user = "cocs-ansible"; + identityFile = "${sshDir}/ansible"; + }; + }; + + programs.git.signing = { + signByDefault = true; + key = "0xBE429D525C136DEB"; + }; +}