diff --git a/.gitignore b/.gitignore index 2bf06b8..871886a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -firmware -hardware-configuration.nix +system/hosts/peach/firmware/* +result +*.qcow2 diff --git a/README.md b/README.md new file mode 100644 index 0000000..554d992 --- /dev/null +++ b/README.md @@ -0,0 +1,152 @@ +# NixOS Configuration + +This repository contains the personal **NixOS** and **Home Manager** configuration for **Sean Kovacs** (`sckova`). It utilizes **Nix Flakes** to manage reproducible system states across disparate hardware architectures, specifically targeting high-performance x86_64 gaming desktops and Apple Silicon laptops. + +## 🖥️ Hosts + +The configuration defines three distinct system profiles via `flake.nix`: + +### 👽 `alien` (x86_64-linux) + +The primary high-performance desktop and gaming workstation. + +* **Kernel:** Uses the **CachyOS** kernel (`linux-cachyos-lts`) via `nix-cachyos-kernel` overlay for scheduler and performance optimizations. +* **Graphics:** Nvidia proprietary drivers (Stable) with Open kernel modules disabled. +#### Gaming Stack: +* **Steam**: Enabled with Gamescope session and Proton-GE. +* **Optimization**: `ananicy-cpp` enabled with specific rules for Gamescope (nice -20). +* **Streaming**: Sunshine game streaming service enabled and auto-started. +* **RGB**: OpenRGB and `ddcutil` for hardware lighting and display control. + +* **Virtualization:** Podman (Docker compatible) and Hyper-V guest support enabled. +* **Hardware:** Specific monitor configuration defined in Niri settings (Dual 4K @ 144Hz + Portrait 1440p). + +### 🍑 `peach` (aarch64-linux) + +A configuration tailored for Apple Silicon hardware using **Asahi Linux**. + +#### **System-specific setup**: +* GPU-accelerated desktop via Apple Silicon drivers. +* Touchpad configuration with natural scrolling. +* Specific notch handling and boot logo customization with plymouth & m1n1. +* Configures docker in a rootless setup. + +* **Kernel**: Patched `linuxPackages_asahi` with Apple Mailbox and RTKit support. + +### 💻 `vm-generic` + +A generic template for virtual machines, supported on both `x86_64-linux` and `aarch64-linux`. + +## 🎨 Desktop Environment + +The system uses a highly customized Wayland environment centered around **Niri**. + +### Window Manager: **Niri** + +#### Type: +* Scrollable-tiling Wayland compositor. +#### Style: +* Tightly separated windows with 2px borders and 4px gaps. +* Animations and window rounding (8px radius). +#### **Input**: +* Focus follows mouse +* Adaptive acceleration +* Natural scrolling enabled +#### **Keybinds**: +* Super+Shift+? preserved for showing the custom keybinds. + +### Shell & Widgets: **Noctalia** + +* **Bar**: Custom top bar with workspaces, system monitor, media controls, and tray. +* **Notifications**: Integrated notification daemon with "Do Not Disturb" capabilities. +* **Control Center**: Quick access to network, bluetooth, and power profiles. +* **Launcher**: Fuzzel app launcher with clipboard history support. + +### Theming: **Base16/24** + +A centralized theme configuration module propagates and builds colors across the system's applications and toolkits. + +#### Scheme: +* Can use any scheme declared in the [tinted-gallery](https://tinted-theming.github.io/tinted-gallery/). +#### Accent: +* Orange for peach +* Blue for alien +* Green for the VM +#### Cursor: +* Catppuccin Mocha Peach (Size 24). +#### Fonts: +* Sans: Noto Sans +* Serif: Noto Serif +* Mono: FiraMono Nerd Font + +## 📦 Software Stack + +### Terminal & Editors + +#### **Terminal**: **Kitty** +* Fish shell integration +* Scrollback buffering +* Custom theme +* Wayland-specific integrations +#### **Shell**: **Fish** +* Customized prompt +* Modern alternatives to ls `eza`, cat `bat`, and gzip `pigz`. +* `btop` is used as a system monitor. +#### **Editor**: **Neovim** (via `nixvim`) configured with: +* LSP support (`nixd`, `qmlls`). +* `conform-nvim` for formatting (Prettier, Stylua, Black). +* `cmp` for autocompletion. +* `fzf-lua` for fuzzy finding. + +### Applications + +#### Browser: **Firefox** with extensive hardening +* Telemetry, Pocket, and AI features disabled. +* Custom userChrome theme. +* Vertical tabs enabled. +* Extensions managed via Nix (uBlock Origin, SponsorBlock, Bitwarden, etc.). +* PWA support via `firefoxpwa`. +* SearXNG metasearch engine set up and enabled as the default search engine and homepage. + +#### Social +* **Vesktop**: Discord client. +* Dynamically generated base16 theme. +* Numerous plugins (MessageLogger, FakeNitro, etc.) enabled. +* **Fractal**: Matrix client. +* **Tuba**: Mastodon client. + +#### Media +* **MPV** with `uosc` UI and `mpris` support. +* **Spotify**: Custom `riff` package (Rust-based client) and `spotify-webapp`. +* **Spicetify**: CLI Spotify client theming. +* **Strawberry**: Music client. +* **Audacity**, **Musescore**: Musical workstations. + +### Services + +* **Wallpaper**: Automated daily **Bing Wallpaper** downloader service. +* **Storage**: **Synology NAS** mounting via Rclone systemd service. +* **Network**: **Tailscale** mesh networking. + +## 🛠️ Usage + +### Rebuilding the System + +To apply the configuration for a specific host: + +```bash +# Rebuild NixOS configuration and switch +sudo nixos-rebuild switch --flake .#systemName + +# Rebuild NixOS configuration for next boot +sudo nixos-rebuild boot --flake .#systemName --install-bootloader +``` + +### VM Testing + +To build and run the generic VM: + +```bash +nixos-rebuild build-vm --flake .#vm-generic +./result/bin/run-vm-generic-vm +``` diff --git a/configuration.nix b/configuration.nix deleted file mode 100755 index 3ac1a30..0000000 --- a/configuration.nix +++ /dev/null @@ -1,208 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, lib, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - #./apple-silicon-support - ]; - - # Bootloader. - # boot.loader.systemd-boot = { - # enable = true; - # # configurationLimit = null; - # }; - # boot.loader.efi.canTouchEfiVariables = false; - - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - - home-manager.users.sckova = { - imports = [ - ./home.nix - ]; - }; - - boot = { - loader = { - timeout = 3; - systemd-boot = { - enable = true; - configurationLimit = null; - # consoleMode = "max"; - }; - efi = { - canTouchEfiVariables = false; - }; - }; - # Silent Boot - # https://wiki.archlinux.org/title/Silent_boot - kernelParams = [ - "quiet" - "splash" - "vga=current" - "rd.systemd.show_status=false" - "rd.udev.log_level=3" - "udev.log_priority=3" - "boot.shell_on_fail" - "apple_dcp.show_notch=1" - ]; - consoleLogLevel = 0; - # https://github.com/NixOS/nixpkgs/pull/108294 - initrd.verbose = false; - }; - - swapDevices = [{ - device = "/swapfile"; - size = 32000; # 32GB - }]; - - # networking.hostName = "peach"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "America/New_York"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # Enable OpenGL - hardware.graphics = { - enable = true; - }; - - services = { - desktopManager.plasma6.enable = true; - displayManager.sddm = { - enable = true; - wayland.enable = true; - enableHidpi = true; - }; - libinput.enable = true; - tailscale = { - enable = true; - useRoutingFeatures = "client"; - }; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound with pipewire. - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.sckova = { - isNormalUser = true; - description = "Sean Kovacs"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; []; - hashedPassword = "$6$bvwRUFaJNMpH8rm3$FGDWFN6tBScJ/2DynAjnlZE8JRfyADN78d6c4GawxpAjyNLNE/AjQzMA09tLRqpKX7WnN5PIUZLAm2bT9/RbG0"; - }; - security.sudo.wheelNeedsPassword = false; - - programs.bash = { - interactiveShellInit = '' - if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] - then - shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" - exec ${pkgs.fish}/bin/fish $LOGIN_OPTION - fi - ''; - }; - - # Install firefox. - programs.firefox.enable = true; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment = { - systemPackages = with pkgs; [ - rclone - git - ]; - }; - - fileSystems."/mnt/nas" = { - device = "synology:/home"; - fsType = "rclone"; - options = [ - "nodev" - "nofail" - "allow_other" - "args2env" - "config=/etc/nixos/configs/rclone.conf" - ]; - }; - - - # programs.nix-ld.enable = true; - # programs.nix-ld.libraries = with pkgs; [ - # # Add any missing dynamic libraries for unpackaged programs - # # here, NOT in environment.systemPackages - # ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - networking.firewall.enable = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "25.05"; # Did you read the comment? - -} - diff --git a/flake.lock b/flake.lock index 9e5e604..c059b64 100644 --- a/flake.lock +++ b/flake.lock @@ -1,18 +1,37 @@ { "nodes": { - "apple-silicon": { + "aerothemeplasma-nix": { "inputs": { - "flake-compat": "flake-compat", + "flake-parts": "flake-parts", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1761514810, - "narHash": "sha256-rOEir3x37RRWO+lFia8C9HAThARg+pubRF2hrWQeeEE=", + "lastModified": 1771513958, + "narHash": "sha256-KoDcVuYgmP/kX6pd9uCW5Wo5Xn3y0SumrMaCLu5ojdY=", + "owner": "nyakase", + "repo": "aerothemeplasma-nix", + "rev": "348cbf661738840d0ae02d5eda7f4c076e59b733", + "type": "github" + }, + "original": { + "owner": "nyakase", + "repo": "aerothemeplasma-nix", + "type": "github" + } + }, + "apple-silicon": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1771511514, + "narHash": "sha256-qhtonMK07BCVC/wZ+pZ9/MKhcTric7YUaCpW6pOg8IM=", "owner": "nix-community", "repo": "nixos-apple-silicon", - "rev": "e01011ebc0aa7a0ae6444a8429e91196addd45f4", + "rev": "2b92d495204be0b10845c66361444dbc8441c68d", "type": "github" }, "original": { @@ -21,33 +40,95 @@ "type": "github" } }, - "catppuccin": { + "base16": { "inputs": { - "nixpkgs": [ - "nixpkgs" - ] + "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1762198582, - "narHash": "sha256-P9giW/1Crn7ekQt4YIbONJ/hKFaHkTwyhz82FCjh+OM=", + "lastModified": 1755819240, + "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-discord": { + "flake": false, + "locked": { + "lastModified": 1771164756, + "narHash": "sha256-6NU5HQZVZ1mSNaIyZxE+U35nF46uXH/768y3auhQdiI=", + "owner": "imbypass", + "repo": "base16-discord", + "rev": "8b005607e5783f751fe369f0442965a86eed8051", + "type": "github" + }, + "original": { + "owner": "imbypass", + "repo": "base16-discord", + "type": "github" + } + }, + "cachyos-kernel": { + "flake": false, + "locked": { + "lastModified": 1771263855, + "narHash": "sha256-akyds1g8cb742d2OrnQ4YciscpynsQ0+0YD2a8aZdvo=", + "owner": "CachyOS", + "repo": "linux-cachyos", + "rev": "5ece16c7b4a7d1261da68153cafc318a60b78ce8", + "type": "github" + }, + "original": { + "owner": "CachyOS", + "repo": "linux-cachyos", + "type": "github" + } + }, + "cachyos-kernel-patches": { + "flake": false, + "locked": { + "lastModified": 1771399550, + "narHash": "sha256-Q2rMJcwZiI1rn8H27gLleKA3ATW/EykukyGR6S1tBPk=", + "owner": "CachyOS", + "repo": "kernel-patches", + "rev": "021aae790c8555a4bb6e2135c6b777bf6fdcba02", + "type": "github" + }, + "original": { + "owner": "CachyOS", + "repo": "kernel-patches", + "type": "github" + } + }, + "catppuccin-discord": { + "flake": false, + "locked": { + "lastModified": 1770426312, + "narHash": "sha256-rxvHIifq5CYIBPwFA2SpOrWT+sG/z0ItXT3sx2wbEqg=", "owner": "catppuccin", - "repo": "nix", - "rev": "08716214674ca27914daa52e6fa809cc022b581e", + "repo": "discord", + "rev": "b9b5547f0b32296d2389716ef606de87b3c1e7c7", "type": "github" }, "original": { "owner": "catppuccin", - "repo": "nix", + "repo": "discord", "type": "github" } }, "flake-compat": { "locked": { - "lastModified": 1746162366, - "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=", + "lastModified": 1761640442, + "narHash": "sha256-AtrEP6Jmdvrqiv4x2xa5mrtaIp3OEe8uBYCDZDS+hu8=", "owner": "nix-community", "repo": "flake-compat", - "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b", + "rev": "4a56054d8ffc173222d09dad23adf4ba946c8884", "type": "github" }, "original": { @@ -56,6 +137,116 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1768135262, + "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -63,11 +254,11 @@ ] }, "locked": { - "lastModified": 1762351818, - "narHash": "sha256-0ptUDbYwxv1kk/uzEX4+NJjY2e16MaAhtzAOJ6K0TG0=", + "lastModified": 1771519029, + "narHash": "sha256-H59Qf82wv5kBXVoyXsmUKW+9J3o8FqgY4uKaLdsLdLg=", "owner": "nix-community", "repo": "home-manager", - "rev": "b959c67241cae17fc9e4ee7eaf13dfa8512477ea", + "rev": "167e0b6837115e672ec5f58e2b0ea39093abe807", "type": "github" }, "original": { @@ -76,13 +267,112 @@ "type": "github" } }, + "kvlibadwaita": { + "flake": false, + "locked": { + "lastModified": 1757782301, + "narHash": "sha256-jCXME6mpqqWd7gWReT04a//2O83VQcOaqIIXa+Frntc=", + "owner": "GabePoel", + "repo": "KvLibadwaita", + "rev": "1f4e0bec44b13dabfa1fe4047aa8eeaccf2f3557", + "type": "github" + }, + "original": { + "owner": "GabePoel", + "repo": "KvLibadwaita", + "type": "github" + } + }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixpkgs-stable" + ], + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1771514840, + "narHash": "sha256-t3WbZvwoDj/75YDX/nwkZuxanZLZaWr9meSfKswaN6g=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "4f69ab280e9bb34e2c0b67fdfa6f0978a170ef56", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1756556321, + "narHash": "sha256-RLD89dfjN0RVO86C/Mot0T7aduCygPGaYbog566F0Qo=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "01be0e65f4eb91a9cd624ac0b76aaeab765c7294", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.08", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1771305475, + "narHash": "sha256-lqweVTwHhYc+9T33cysp38gVwxaibGJHriOPZXWyhCY=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "a2a52911757cb3b497db9407592f9b4c439571ea", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, + "nix-cachyos-kernel": { + "inputs": { + "cachyos-kernel": "cachyos-kernel", + "cachyos-kernel-patches": "cachyos-kernel-patches", + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1771438239, + "narHash": "sha256-/d5FnrQ1nvZ9n1I7o/hMTzjd8tTBvV5rT24Nh7h59RQ=", + "owner": "xddxdd", + "repo": "nix-cachyos-kernel", + "rev": "58f338b00bc5619144a6f3082eed5c83e79b279b", + "type": "github" + }, + "original": { + "owner": "xddxdd", + "ref": "release", + "repo": "nix-cachyos-kernel", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1762111121, - "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", + "lastModified": 1768305791, + "narHash": "sha256-AIdl6WAn9aymeaH/NvBj0H9qM+XuAuYbGMZaP0zcXAQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4", + "rev": "1412caf7bf9e660f2f962917c14b1ea1c3bc695e", "type": "github" }, "original": { @@ -92,12 +382,311 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1765674936, + "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1769909678, + "narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "72716169fe93074c333e8d0173151350670b824c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1771419570, + "narHash": "sha256-bxAlQgre3pcQcaRUm/8A0v/X8d2nhfraWSFqVmMcBcU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6d41bc27aaf7b6a3ba6b169db3bd5d6159cfaa47", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1771369470, + "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0182a361324364ae3f436a63005877674cf45efb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1771353015, + "narHash": "sha256-gvMwFEdFCM2zFxLVDaAbhV2N9zK0IW/RceBundHUdZs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "931ef4db402cdab9dfe66fe4a2b01d50f6fe435d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1771135771, + "narHash": "sha256-wyvBIhDuyCRyjB3yPg77qoyxrlgQtBR1rVW3c9knV3E=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "ed0424f0b08d303a7348f52f7850ad1b2704f9ba", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "noctalia": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771513929, + "narHash": "sha256-dPeHevAT1Cb2w/Wrfz/d5i6RfO8bvbGl/KrTPxU2l3w=", + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "rev": "9c47ce03f200e0b8fc515d973440d5bc3e359785", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771516225, + "narHash": "sha256-G2cPs4Ic8Z1Aq8QfMa1VwJoBwIhVpwzcQ036ZhI4oXc=", + "owner": "nix-community", + "repo": "NUR", + "rev": "d4694f0614419034910767b5a036384ab358b138", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "openmw": { + "flake": false, + "locked": { + "lastModified": 1770694146, + "narHash": "sha256-zTN+f21TF0Y53J+BAPDo3pvcI1+f3cc/7xG4AAK/+gs=", + "owner": "OpenMW", + "repo": "openmw", + "rev": "01bcd6a6369fe461caaf900354967b4751aede7a", + "type": "gitlab" + }, + "original": { + "owner": "OpenMW", + "repo": "openmw", + "rev": "01bcd6a6369fe461caaf900354967b4751aede7a", + "type": "gitlab" + } + }, + "plasma-manager": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770766818, + "narHash": "sha256-12RCFLyAedyMOdenUi7cN3ioJPEGjA/ZG1BLjugfUVs=", + "owner": "nix-community", + "repo": "plasma-manager", + "rev": "44b928068359b7d2310a34de39555c63c93a2c90", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "plasma-manager", + "type": "github" + } + }, "root": { "inputs": { + "aerothemeplasma-nix": "aerothemeplasma-nix", "apple-silicon": "apple-silicon", - "catppuccin": "catppuccin", + "base16": "base16", + "base16-discord": "base16-discord", + "catppuccin-discord": "catppuccin-discord", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "kvlibadwaita": "kvlibadwaita", + "niri": "niri", + "nix-cachyos-kernel": "nix-cachyos-kernel", + "nixpkgs": [ + "nixpkgs-unstable" + ], + "nixpkgs-stable": "nixpkgs-stable", + "nixpkgs-unstable": "nixpkgs-unstable", + "nixvim": "nixvim", + "noctalia": "noctalia", + "nur": "nur", + "openmw": "openmw", + "plasma-manager": "plasma-manager", + "spicetify-nix": "spicetify-nix", + "tt-schemes": "tt-schemes" + } + }, + "spicetify-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1771268051, + "narHash": "sha256-nGqPcngnezoT+/xAvw3UDjwdKP2MC4fO315A/Otb9eE=", + "owner": "Gerg-L", + "repo": "spicetify-nix", + "rev": "b930de84c561f62a0c39a6a57c2ab553a97e8495", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "spicetify-nix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tt-schemes": { + "flake": false, + "locked": { + "lastModified": 1770951657, + "narHash": "sha256-A9KDJ0/yL3iek7mN6p0BF+1+dVGi4l/YCquRmTGFO7I=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "b9f335ad6a0b7d85b9c2eb932c3215f7429f7d11", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "rev": "b9f335ad6a0b7d85b9c2eb932c3215f7429f7d11", + "type": "github" + } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1755491097, + "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "388d291e82ffbc73be18169d39470f340707edaa", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.7", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1771195969, + "narHash": "sha256-BUE41HjLIGPjq3U8VXPjf8asH8GaMI7FYdgrIHKFMXA=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "536bd32efc935bf876d6de385ec18a1b715c9358", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 70d4d69..1585a9e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,11 +2,29 @@ description = "My NixOS Configuration"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - catppuccin = { - url = "github:catppuccin/nix"; - inputs.nixpkgs.follows = "nixpkgs"; + # edit this to switch between stable and unstable + nixpkgs.follows = "nixpkgs-unstable"; + + nix-cachyos-kernel = { + url = "github:xddxdd/nix-cachyos-kernel/release"; + # inputs.nixpkgs.follows = "nixpkgs"; + }; + + base16 = { + url = "github:SenchoPens/base16.nix"; + }; + + tt-schemes = { + url = "github:tinted-theming/schemes/b9f335ad6a0b7d85b9c2eb932c3215f7429f7d11"; + flake = false; + }; + + base16-discord = { + url = "github:imbypass/base16-discord"; + flake = false; }; home-manager = { @@ -14,58 +32,324 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + + aerothemeplasma-nix = { + url = "github:nyakase/aerothemeplasma-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + niri = { + url = "github:sodiboo/niri-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixpkgs-stable.follows = "nixpkgs-stable"; + # inputs.niri-stable.follows = "niri-blur"; + # inputs.niri-unstable.follows = "niri-blur"; + }; + + # niri-blur = { + # url = "github:visualglitch91/niri/feat/blur"; + # flake = false; + # }; + + noctalia = { + url = "github:noctalia-dev/noctalia-shell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + spicetify-nix = { + url = "github:Gerg-L/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nur = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + apple-silicon = { url = "github:nix-community/nixos-apple-silicon"; - inputs.nixpkgs.follows = "nixpkgs"; + # inputs.nixpkgs.follows = "nixpkgs"; + }; + + openmw = { + url = "gitlab:OpenMW/openmw/01bcd6a6369fe461caaf900354967b4751aede7a"; + flake = false; + }; + + catppuccin-discord = { + url = "github:catppuccin/discord"; + flake = false; + }; + + kvlibadwaita = { + url = "github:GabePoel/KvLibadwaita"; + flake = false; }; }; - outputs = { nixpkgs, catppuccin, home-manager, apple-silicon, ... }: + outputs = + { + nixpkgs, + nixpkgs-unstable, + nix-cachyos-kernel, + base16, + tt-schemes, + base16-discord, + home-manager, + plasma-manager, + aerothemeplasma-nix, + niri, + noctalia, + spicetify-nix, + nur, + nixvim, + apple-silicon, + openmw, + catppuccin-discord, + kvlibadwaita, + ... + }: let - mkNixosSystem = { name, system, hostModule, extraModules ? [] }: + # All systems we want to support for the generic VM + # to run the vm: + # nixos-rebuild build-vm --flake ~/nix#$(nix eval --raw --impure --expr 'builtins.currentSystem') + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + # Shared config for all package sets + pkgConfig = { + allowUnfree = true; + }; + + mkNixosSystem = + { + hostname, + system, + extraModules ? [ ], + extraSpecialArgs ? { }, + }: nixpkgs.lib.nixosSystem { inherit system; - specialArgs = { inherit catppuccin; }; + specialArgs = { + inherit system; + pkgs-unstable = import nixpkgs-unstable { + inherit system; + config = pkgConfig; + }; + } + // extraSpecialArgs; modules = [ - ./configuration.nix - hostModule - catppuccin.nixosModules.catppuccin + { + nixpkgs = { + config = pkgConfig; + overlays = [ + niri.overlays.niri + noctalia.overlays.default + nur.overlays.default + (final: prev: { + openmw-git = openmw; + catppuccin-discord-git = catppuccin-discord; + kvlibadwaita-git = kvlibadwaita; + base16-discord-git = base16-discord; + }) + (import ./packages/overlay.nix) + ]; + }; + nix = { + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + + substituters = [ + "https://attic.xuyh0120.win/lantian" + "https://cache.garnix.io" + "https://nixos-apple-silicon.cachix.org" + ]; + + trusted-public-keys = [ + "lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "nixos-apple-silicon.cachix.org-1:8psDu5SA5dAD7qA0zMy5UT292TxeEPzIz8VVEr2Js20=" + ]; + + trusted-users = [ + "root" + "sckova" + ]; + + # Increase file descriptor limit for builds + # sandbox = "relaxed"; + # extra-sandbox-paths = [ ]; + # build-users-group = "nixbld"; + }; + + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + }; + + networking.hostName = hostname; + + users.users.sckova = { + isNormalUser = true; + description = "Sean Kovacs"; + extraGroups = [ + "wheel" + "networkmanager" + "podman" + ]; + hashedPassword = "$6$bvwRUFaJNMpH8rm3$FGDWFN6tBScJ/2DynAjnlZE8JRfyADN78d6c4GawxpAjyNLNE/AjQzMA09tLRqpKX7WnN5PIUZLAm2bT9/RbG0"; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCn/eXMq04vcXNqGVzlZOw2C2dQYBqzWsoigdFW09XqC2WPaGljbAIayzaD7Q1tIlPGGy10+nipAXAk1CHAnrQ2KSg4v/SwFphF48V3joeQmideC4vo0EIQEQibbMtj3oFezqRcRZINl/1hr4t0myZ3zkoTjh3HCkqJEMGUdArDMEVPA5mwcKSLsyshW9LMG/3C9YKKPU1/lVsoeDkj8AVZA0srhkApuRKF0IVu8KoPd6ldvSWgpQ1iuQ+MEMSeOUJytieBkzeY9zEVePaQ86oIMDUzqq8OTN37RyShiJKPskKyj12rJI2eFtI/viGaj8P6/yvKqMp3F4kAsPAuvMLLAIYCNa+139rDpkkIKB6lVtgq0jnJGRywaYXGIRyExNcVAr8I9wrNnNN2M4whVeYBxfLMzKZ+VvfK39AaGvnzPuFDLqUC87sN4c/1KZQo+TCtlaxcYvqowWylw5JHUt8uwFcO/dUebQxxAv8EdyPZGJ/54y19PsTbu9KyxSc2gIU= sckova" + ]; + }; + } + ./system + ./system/searxng + ./system/widevine + ./system/shell/fish.nix + ./system/tailscale + ./system/hosts/${hostname} + ./hardware/${hostname} + aerothemeplasma-nix.nixosModules.aerothemeplasma-nix + niri.nixosModules.niri home-manager.nixosModules.home-manager - ] ++ extraModules; + noctalia.nixosModules.default + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.sckova = { + imports = [ + ./home + ./options.nix + ./home/apps + ./home/games + ./home/hosts/${hostname} + ./home/kde + ./home/services + ./home/terminal + ./home/tiling + ]; + }; + sharedModules = [ + base16.nixosModule + ( + { config, ... }: + { + scheme = "${tt-schemes}/base24/${config.colors.scheme}.yaml"; + } + ) + aerothemeplasma-nix.homeModules.aerothemeplasma-nix + plasma-manager.homeModules.plasma-manager + noctalia.homeModules.default + spicetify-nix.homeManagerModules.default + nixvim.homeModules.nixvim + ]; + extraSpecialArgs = { + inherit spicetify-nix; + pkgs-unstable = import nixpkgs-unstable { + inherit system; + config = pkgConfig; + }; + }; + }; + } + ] + ++ extraModules; }; - mkHomeConfig = { user, system }: + mkHomeConfig = + { + user, + hostname, + system, + }: home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { inherit system; }; + pkgs = import nixpkgs { + inherit system; + config = pkgConfig; + }; + pkgs-unstable = import nixpkgs-unstable { + inherit system; + config = pkgConfig; + }; + home.username = user; + home.homeDirectory = "/home/${user}"; modules = [ - ./home.nix - catppuccin.homeModules.catppuccin + ./home + ./home/hosts/${hostname}.nix + home-manager.homeModules.home-manager + plasma-manager.homeModules.plasma-manager + niri.homeModules.default + noctalia.homeModules.noctalia + nixvim.homeModules.nixvim ]; }; in { nixosConfigurations = { peach = mkNixosSystem { - name = "peach"; + hostname = "peach"; system = "aarch64-linux"; - hostModule = ./hosts/peach.nix; extraModules = [ apple-silicon.nixosModules.default { nixpkgs.overlays = [ apple-silicon.overlays.apple-silicon-overlay ]; } ]; }; - alien = mkNixosSystem { - name = "alien"; - system = "x86_64-linux"; - hostModule = ./hosts/alien.nix; - }; + alien = + mkNixosSystem { + hostname = "alien"; + system = "x86_64-linux"; + extraModules = [ + { nixpkgs.overlays = [ nix-cachyos-kernel.overlays.pinned ]; } + ]; + } + // nixpkgs.lib.genAttrs supportedSystems ( + system: + mkNixosSystem { + hostname = "vm-generic"; + inherit system; + } + ); }; homeConfigurations = { - peach = mkHomeConfig { user = "sckova"; system = "aarch64-linux"; }; - alien = mkHomeConfig { user = "sckova"; system = "x86_64-linux"; }; - }; + peach = mkHomeConfig { + user = "sckova"; + hostname = "peach"; + system = "aarch64-linux"; + }; + alien = mkHomeConfig { + user = "sckova"; + hostname = "alien"; + system = "x86_64-linux"; + }; + } + // nixpkgs.lib.genAttrs supportedSystems ( + system: + mkHomeConfig { + user = "sckova"; + hostname = "vm-generic"; + inherit system; + } + ); }; } - diff --git a/hardware/alien/default.nix b/hardware/alien/default.nix new file mode 100755 index 0000000..8e3eb20 --- /dev/null +++ b/hardware/alien/default.nix @@ -0,0 +1,101 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "sd_mod" + ]; + + fileSystems = { + "/" = { + label = "nixos"; + fsType = "btrfs"; + options = [ + "subvol=root" + "compress=zstd" + "relatime" + ]; + }; + + "/boot" = { + label = "EFI"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + "umask=0077" + ]; + }; + + "/home" = { + label = "nixos"; + fsType = "btrfs"; + options = [ + "subvol=home" + "compress=zstd" + "relatime" + ]; + }; + + "/nix" = { + label = "nixos"; + fsType = "btrfs"; + options = [ + "subvol=nix" + "compress=zstd" + "noatime" + ]; + }; + + "/snapshots" = { + label = "nixos"; + fsType = "btrfs"; + options = [ + "subvol=snapshots" + "compress=zstd" + "noatime" + ]; + }; + + "/mnt/storage" = { + label = "storage"; + fsType = "btrfs"; + options = [ + "compress=zstd" + "nofail" + "relatime" + ]; + }; + }; + + swapDevices = [ + { label = "swap"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hardware/peach/default.nix b/hardware/peach/default.nix new file mode 100644 index 0000000..b3b57a2 --- /dev/null +++ b/hardware/peach/default.nix @@ -0,0 +1,74 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "usb_storage" + "sdhci_pci" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems = { + "/" = { + label = "nixos"; + fsType = "btrfs"; + options = [ + "subvol=root" + "compress=zstd" + "relatime" + ]; + }; + + "/home" = { + label = "nixos"; + fsType = "btrfs"; + options = [ + "subvol=home" + "compress=zstd" + "relatime" + ]; + }; + + "/nix" = { + label = "nixos"; + fsType = "btrfs"; + options = [ + "subvol=nix" + "compress=zstd" + "noatime" + ]; + }; + + "/boot" = { + label = "efi"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + "umask=0077" + ]; + }; + }; + + swapDevices = [ + { + label = "swap"; + } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/hardware/vm-generic/default.nix b/hardware/vm-generic/default.nix new file mode 100644 index 0000000..2273e45 --- /dev/null +++ b/hardware/vm-generic/default.nix @@ -0,0 +1,45 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + lib, + system, + ... +}: +{ + imports = [ ]; + + boot.initrd.availableKernelModules = [ + "ehci_pci" + "xhci_pci" + "usbhid" + "sr_mod" + ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/swap"; } + ]; + + # Set platform from the system argument passed by the flake + nixpkgs.hostPlatform = lib.mkDefault system; + + # Enable Parallels tools only on aarch64 + hardware.parallels.enable = lib.mkIf (system == "aarch64-linux") true; + nixpkgs.config.allowUnfreePredicate = lib.mkIf (system == "aarch64-linux") ( + pkg: builtins.elem (lib.getName pkg) [ "prl-tools" ] + ); +} diff --git a/home.nix b/home.nix deleted file mode 100755 index 9fca78e..0000000 --- a/home.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ config, pkgs, ... }: - -{ - # Home Manager needs a bit of information about you and the - # paths it should manage. - home.username = "sckova"; - home.homeDirectory = "/home/sckova"; - - home.packages = with pkgs; [ - vesktop - fish - gh - adwsteamgtk - prismlauncher - tmux - fastfetch - btop - neovim - killall - wget - ripgrep - kitty - ncdu - fzf - wl-clipboard - - kde-rounded-corners - kdePackages.partitionmanager - ]; - - catppuccin = { - enable = true; - flavor = "mocha"; - firefox = { - force = true; - }; - }; - - # 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 = "25.05"; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; -} diff --git a/home/apps/default.nix b/home/apps/default.nix new file mode 100644 index 0000000..69a251c --- /dev/null +++ b/home/apps/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./discord.nix + ./firefox.nix + ./mpv.nix + # ./vscode.nix + ]; +} diff --git a/home/apps/discord.nix b/home/apps/discord.nix new file mode 100644 index 0000000..e488076 --- /dev/null +++ b/home/apps/discord.nix @@ -0,0 +1,87 @@ +{ + config, + pkgs, + ... +}: +let + mergedThemes = pkgs.runCommand "mergedConfig" { } '' + mkdir -p $out + cp -rvf ${pkgs.base16-discord-git}/base16.css $out/base16.css + ''; + + vesktopSettings = { + discordBranch = "stable"; + minimizeToTray = true; + arRPC = true; + splashColor = config.scheme.withHashtag.base05; + splashBackground = config.scheme.withHashtag.base00; + spellCheckLanguages = [ + "en-US" + "en" + ]; + disableMinSize = true; + }; + + stateConfig = { + firstLaunch = false; + windowBounds = { + x = 0; + y = 0; + width = 853; + height = 1071; + }; + }; +in +{ + home.packages = with pkgs; [ vesktop ]; + + home.file.".config/vesktop/settings.json" = { + text = builtins.toJSON vesktopSettings; + force = true; + }; + + home.file.".config/vesktop/settings/settings.json" = { + text = builtins.toJSON (import ./vencord.nix); + force = true; + }; + + home.file.".config/vesktop/settings/quickCss.css" = with config.scheme.withHashtag; { + text = '' + * { + font-family: "${config.userOptions.fontSans.name}" !important; + font-size: ${toString config.userOptions.fontSans.size}px; + } + + :root { + --base00: ${base00}; + --base01: ${base01}; + --base02: ${base02}; + --base03: ${base03}; + --base04: ${base04}; + --base05: ${base05}; + --base06: ${base06}; + --base07: ${base07}; + --base08: ${base08}; + --base09: ${base09}; + --base0A: ${base0A}; + --base0B: ${base0B}; + --base0C: ${base0C}; + --base0D: ${base0D}; + --base0E: ${base0E}; + --base0F: ${base0F}; + } + ''; + force = true; + }; + + home.file.".config/vesktop/state.json" = { + text = builtins.toJSON stateConfig; + force = true; + }; + + home.file.".config/vesktop/themes" = { + source = mergedThemes; + recursive = true; + force = true; + }; +} diff --git a/home/apps/firefox.nix b/home/apps/firefox.nix new file mode 100644 index 0000000..402c099 --- /dev/null +++ b/home/apps/firefox.nix @@ -0,0 +1,388 @@ +# https://discourse.nixos.org/t/combining-best-of-system-firefox-and-home-manager-firefox-settings/37721 +# https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265 +{ + pkgs, + config, + ... +}: +{ + home.file.".mozilla/firefox/default/chrome/" = { + source = ./firefox_css; + force = true; + recursive = true; + }; + + home.file.".mozilla/firefox/default/chrome/colors.css" = with config.scheme.withHashtag; { + text = '' + * { + --accent: ${config.scheme.withHashtag.${config.colors.accent}}; + --rosewater: ${base06}; + --flamingo: ${base0F}; + --pink: ${base17}; + --mauve: ${base0E}; + --red: ${base08}; + --maroon: ${base12}; + --peach: ${base09}; + --yellow: ${base0A}; + --green: ${base0B}; + --teal: ${base0C}; + --sky: ${base15}; + --sapphire: ${base16}; + --blue: ${base0D}; + --lavender: ${base07}; + --text: ${base05}; + --subtext1: ${base04}; + --subtext0: ${base04}; + --overlay2: ${base03}; + --overlay1: ${base03}; + --overlay0: ${base03}; + --surface2: ${base02}; + --surface1: ${base01}; + --surface0: ${base01}; + --base: ${base00}; + --mantle: ${base10}; + --crust: ${base11}; + } + ''; + force = true; + }; + + home.file.".local/share/firefoxpwa/profiles/01KEYXH9TC4B54J5CTPNE75JP0/prefs.js" = { + text = '' + user_pref("firefoxpwa.alwaysUseNativeWindowControls", true); + user_pref("firefoxpwa.displayUrlBar", 1); + user_pref("firefoxpwa.enableHidingIconBar", true); + user_pref("firefoxpwa.dynamicWindowTitle", true); + user_pref("ui.key.menuAccessKeyFocuses", false); + user_pref("browser.aboutConfig.showWarning", false); + user_pref("browser.ml.enable", false); + ''; + force = true; + }; + + programs = { + firefoxpwa = { + enable = true; + settings.config = { + always_patch = false; + runtime_enable_wayland = true; + runtime_use_xinput2 = true; + runtime_use_portals = true; + use_linked_runtime = false; + }; + profiles = { + "01KEYXH9TC4B54J5CTPNE75JP0".sites."01KEYXHK7XQQJ0M3J7SX4VD9PG" = { + name = "WhatsApp"; + url = "https://web.whatsapp.com/"; + manifestUrl = "https://web.whatsapp.com/data/manifest.json"; + desktopEntry = { + icon = "${pkgs.colloid-icon-theme}/share/icons/Colloid/apps/scalable/whatsapp.svg"; + categories = [ + "Network" + "Chat" + "Telephony" + ]; + }; + }; + }; + }; + firefox = { + enable = true; + package = pkgs.firefox.override { + nativeMessagingHosts = with pkgs; [ + firefoxpwa + ]; + }; + policies = { + BlockAboutConfig = false; + DefaultDownloadDirectory = "\${home}/Downloads"; + # Check about:support for extension/add-on ID strings. + # Valid strings for installation_mode are "allowed", "blocked", + # "force_installed" and "normal_installed". + ExtensionSettings = { + "*".installation_mode = "blocked"; + "uBlock0@raymondhill.net".installation_mode = "allowed"; + "gdpr@cavi.au.dk".installation_mode = "allowed"; + "{5cce4ab5-3d47-41b9-af5e-8203eea05245}".installation_mode = "allowed"; + "plasma-browser-integration@kde.org".installation_mode = "allowed"; + "jid1-MnnxcxisBPnSXQ@jetpack".installation_mode = "allowed"; + "firefoxpwa@filips.si".installation_mode = "allowed"; + "sponsorBlocker@ajay.app".installation_mode = "allowed"; + "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}".installation_mode = "allowed"; + "{aecec67f-0d10-4fa7-b7c7-609a2db280cf}".installation_mode = "allowed"; + "{446900e4-71c2-419f-a6a7-df9c091e268b}".installation_mode = "allowed"; + "CanvasBlocker@kkapsner.de".installation_mode = "allowed"; + "shinigamieyes@shinigamieyes".installation_mode = "allowed"; + }; + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "newtab"; # alternatives: "always" or "newtab" + DisplayMenuBar = "always"; # alternatives: "always", "never" or "default-on" + SearchBar = "unified"; # alternative: "separate" + }; + profiles = { + default = { + id = 0; + name = "default"; + isDefault = true; + extensions = { + force = true; + packages = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + plasma-integration + stylus + violentmonkey + consent-o-matic + privacy-badger + sponsorblock + pwas-for-firefox + control-panel-for-twitter + bitwarden + canvasblocker + shinigami-eyes + ]; + settings = { + "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}".settings = { + force = true; + settings = { + dbInChromeStorage = true; + }; + }; + }; + }; + settings = { + "extensions.autoDisableScopes" = 0; # enables all extensions automatically + "xpinstall.signatures.required" = false; + "extensions.update.autoUpdateDefault" = false; + "extensions.update.enabled" = false; + "browser.search.defaultenginename" = "searxng"; + "browser.search.order.1" = "searxng"; + "browser.toolbars.bookmarks.visibility" = "newtab"; + + "signon.rememberSignons" = false; + "widget.use-xdg-desktop-portal.file-picker" = 1; + "browser.aboutConfig.showWarning" = false; + "browser.compactmode.show" = true; + "browser.cache.disk.enable" = true; # Set to false if you have a HDD + "browser.warnOnQuitShortcut" = false; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "widget.disable-workspace-management" = true; + "browser.contentblocking.category" = { + Value = "strict"; + Status = "locked"; + }; + "widget.gtk.global-menu.enabled" = true; + "widget.gtk.global-menu.wayland.enabled" = true; + "browser.tabs.inTitlebar" = 0; + "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.feeds.topsites" = 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; + "browser.newtabpage.activity-stream.showWeather" = false; + "browser.download.autoHideButton" = false; + "browser.startup.homepage" = "http://localhost:8080/"; + + # Disable Firefox's machine learning (AI) features + "browser.ml.enable" = false; + + # For browser toolbox/live editing user CSS + "devtools.chrome.enabled" = true; + "devtools.debugger.remote-enabled" = true; + + # Vertical tabs + "sidebar.verticalTabs" = true; + "sidebar.verticalTabs.dragToPinPromo.dismissed" = true; + "browser.uiCustomization.state" = { + placements = { + widget-overflow-fixed-list = [ ]; + unified-extensions-area = [ + "sponsorblocker_ajay_app-browser-action" + "ublock0_raymondhill_net-browser-action" + "jid1-mnnxcxisbpnsxq_jetpack-browser-action" + "gdpr_cavi_au_dk-browser-action" + "firefoxpwa_filips_si-browser-action" + "plasma-browser-integration_kde_org-browser-action" + "canvasblocker_kkapsner_de-browser-action" + "_5cce4ab5-3d47-41b9-af5e-8203eea05245_-browser-action" + "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" + "_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action" + "_7a7a4a92-a2a0-41d1-9fd7-1e92480d612d_-browser-action" + ]; + nav-bar = [ + # "sidebar-button" + "back-button" + "forward-button" + "stop-reload-button" + "urlbar-container" + "unified-extensions-button" + "downloads-button" + ]; + toolbar-menubar = [ "menubar-items" ]; + TabsToolbar = [ ]; + vertical-tabs = [ "tabbrowser-tabs" ]; + PersonalToolbar = [ "personal-bookmarks" ]; + }; + seen = [ + "gdpr_cavi_au_dk-browser-action" + "firefoxpwa_filips_si-browser-action" + "plasma-browser-integration_kde_org-browser-action" + "jid1-mnnxcxisbpnsxq_jetpack-browser-action" + "canvasblocker_kkapsner_de-browser-action" + "_5cce4ab5-3d47-41b9-af5e-8203eea05245_-browser-action" + "ublock0_raymondhill_net-browser-action" + "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" + "_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action" + "_7a7a4a92-a2a0-41d1-9fd7-1e92480d612d_-browser-action" + "sponsorblocker_ajay_app-browser-action" + "developer-button" + ]; + dirtyAreaCache = [ + "unified-extensions-area" + "nav-bar" + "TabsToolbar" + "vertical-tabs" + "PersonalToolbar" + "toolbar-menubar" + ]; + currentVersion = 23; + newElementCount = 1; + }; + + "privacy.resistFingerprinting" = false; + "privacy.clearOnShutdown.history" = false; + "privacy.clearOnShutdown.downloads" = false; + "webgl.disabled" = false; + "privacy.clearOnShutdown_v2.cookiesAndStorage" = false; + }; + bookmarks = { + force = true; + settings = [ + { + name = "Nix sites"; + toolbar = true; + bookmarks = [ + { + name = "NixOS"; + url = "https://nixos.org/"; + } + { + name = "Home Manager Appendix A"; + url = "https://nix-community.github.io/home-manager/options.xhtml"; + } + { + name = "NixOS config"; + url = "https://ovips.us.to/git/sckova/nix"; + } + ]; + } + ]; + }; + search = + let + nixIcon = "${pkgs.colloid-icon-theme}/share/icons/Colloid/apps/scalable/nix-snowflake.svg"; + searchIcon = "${pkgs.colloid-icon-theme}/share/icons/Colloid-Dark/places/symbolic/folder-saved-search-symbolic.svg"; + in + { + force = true; + default = "searxng"; + order = [ + "searxng" + ]; + engines = { + nix-packages = { + name = "Nix Packages"; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + + icon = nixIcon; + definedAliases = [ "@np" ]; + }; + + nix-options = { + name = "Nix Options"; + urls = [ + { + template = "https://search.nixos.org/options"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + + icon = nixIcon; + definedAliases = [ "@no" ]; + }; + + nixos-wiki = { + name = "NixOS Wiki"; + urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ]; + icon = nixIcon; + definedAliases = [ "@nw" ]; + }; + + searxng = { + name = "SearXNG"; + urls = [ { template = "http://localhost:8080/search?q={searchTerms}"; } ]; + icon = searchIcon; + definedAliases = [ "@go" ]; + }; + + wikipedia = { + name = "Wikipedia"; + urls = [ { template = "https://en.wikipedia.org/w/index.php?search={searchTerms}"; } ]; + definedAliases = [ "@wi" ]; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/home/apps/firefox_css/theme/hide.css b/home/apps/firefox_css/theme/hide.css new file mode 100644 index 0000000..ba0975a --- /dev/null +++ b/home/apps/firefox_css/theme/hide.css @@ -0,0 +1,25 @@ +#tracking-protection-icon-container { + display: none; +} + +.bookmark-item[container] { + list-style-image: url("chrome://global/skin/dirListing/folder.png") !important; +} + +#toolbar-menubar { + display: none !important; +} + +#menubar-items { + visibility: hidden !important; +} + +.browserContainer { + border-radius: 8px !important; + margin: 6px !important; + background-color: transparent !important; +} + +browser { + border-radius: 8px !important; +} diff --git a/home/apps/firefox_css/theme/theme-new.css b/home/apps/firefox_css/theme/theme-new.css new file mode 100644 index 0000000..204e3df --- /dev/null +++ b/home/apps/firefox_css/theme/theme-new.css @@ -0,0 +1,459 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* DO NOT EDIT this file directly, instead modify design-tokens.json + * and run `npm run build` to see your changes. */ + +@import "../colors.css"; + +@layer tokens-foundation, tokens-prefers-contrast, tokens-forced-colors; + +@layer tokens-foundation { + :root, + :host(.anonymous-content-host) { + /** Background Color **/ + --background-color-box: var(--base) !important; + --background-color-critical: var(--maroon) !important; + --background-color-information: var(--sapphire) !important; + --background-color-success: var(--teal) !important; + --background-color-warning: var(--peach) !important; + --promo-background-color: var(--background-color-information) !important; + --table-row-background-color: var(--mantle) !important; + + /** Border **/ + --border-color-card: color-mix( + in srgb, + currentColor 10%, + transparent + ) !important; + --border-color-interactive-hover: var( + --border-color-interactive + ) !important; + --border-color-interactive-active: var( + --border-color-interactive + ) !important; + --border-color-interactive-disabled: var( + --border-color-interactive + ) !important; + --border-color-selected: var(--accent) !important; + --border-color-transparent: transparent !important; + --border-radius-circle: 9999px !important; + --border-radius-xsmall: 2px !important; + --border-radius-small: 4px !important; + --border-radius-medium: 8px !important; + --border-radius-large: 16px !important; + --border-width: 0px !important; + + /** Box Shadow **/ + --box-shadow-card: var(--box-shadow-level-2) !important; + --box-shadow-card-hover: var(--box-shadow-level-4) !important; + --box-shadow-color-darker-layer-1: rgba(0, 0, 0, 0.15) !important; + --box-shadow-color-darker-layer-2: rgba(0, 0, 0, 0.2) !important; + --box-shadow-color-lighter-layer-1: rgba(0, 0, 0, 0.05) !important; + --box-shadow-color-lighter-layer-2: rgba(0, 0, 0, 0.1) !important; + --box-shadow-level-1: + 0 0 1px var(--box-shadow-color-darker-layer-1), + 0 1px 2px var(--box-shadow-color-darker-layer-2) !important; + --box-shadow-level-2: + 0 0.25px 0.75px var(--box-shadow-color-lighter-layer-1), + 0 2px 6px var(--box-shadow-color-lighter-layer-2) !important; + --box-shadow-level-3: + 0 0.375px 1.5px var(--box-shadow-color-lighter-layer-1), + 0 3px 12px var(--box-shadow-color-lighter-layer-2) !important; + --box-shadow-level-4: + 0 0.5px 2px var(--box-shadow-color-lighter-layer-1), + 0 4px 16px var(--box-shadow-color-lighter-layer-2) !important; + --box-shadow-popup: var(--box-shadow-level-3) !important; + --box-shadow-tab: var(--box-shadow-level-1) !important; + + /** Button **/ + --button-background-color-disabled: var( + --button-background-color + ) !important; + --button-background-color-destructive: var(--red) !important; + --button-background-color-destructive-hover: color-mix( + in srgb, + var(--red), + var(--text) 10% + ) !important; + --button-background-color-destructive-active: color-mix( + in srgb, + var(--red), + var(--text) 20% + ) !important; + --button-background-color-destructive-disabled: var( + --button-background-color-destructive + ) !important; + --button-background-color-destructive-selected: var( + --button-background-color-destructive-active + ) !important; + --button-background-color-ghost: transparent !important; + --button-background-color-ghost-hover: var( + --button-background-color-hover + ) !important; + --button-background-color-ghost-active: var( + --button-background-color-active + ) !important; + --button-background-color-ghost-disabled: var( + --button-background-color-ghost + ) !important; + --button-background-color-ghost-selected: var( + --button-background-color-ghost-active + ) !important; + --button-background-color-primary: var(--accent) !important; + --button-background-color-primary-hover: color-mix( + in srgb, + var(--accent), + var(--text) 10% + ) !important; + --button-background-color-primary-active: color-mix( + in srgb, + var(--accent), + var(--text) 20% + ) !important; + --button-background-color-primary-disabled: var( + --button-background-color-primary + ) !important; + --button-background-color-primary-selected: var( + --button-background-color-primary-active + ) !important; + --button-background-color-selected: var( + --button-background-color-active + ) !important; + --button-border: var(--border-width) solid var(--button-border-color) !important; + --button-border-color: transparent !important; + --button-border-color-hover: var(--button-border-color) !important; + --button-border-color-active: var(--button-border-color) !important; + --button-border-color-disabled: var(--button-border-color) !important; + --button-border-color-destructive: transparent !important; + --button-border-color-destructive-hover: var( + --button-border-color-destructive + ) !important; + --button-border-color-destructive-active: var( + --button-border-color-destructive + ) !important; + --button-border-color-destructive-disabled: var( + --button-border-color-destructive + ) !important; + --button-border-color-destructive-selected: var( + --button-border-color-destructive-active + ) !important; + --button-border-color-ghost: var(--button-border-color) !important; + --button-border-color-ghost-hover: var( + --button-border-color-hover + ) !important; + --button-border-color-ghost-active: var( + --button-border-color-active + ) !important; + --button-border-color-ghost-disabled: var( + --button-border-color-disabled + ) !important; + --button-border-color-ghost-selected: var( + --button-border-color-ghost-active + ) !important; + --button-border-color-primary: transparent !important; + --button-border-color-primary-hover: var( + --button-border-color-primary + ) !important; + --button-border-color-primary-active: var( + --button-border-color-primary + ) !important; + --button-border-color-primary-disabled: var( + --button-border-color-primary + ) !important; + --button-border-color-primary-selected: var( + --button-border-color-primary-active + ) !important; + --button-border-color-selected: var( + --button-border-color-active + ) !important; + --button-border-radius: var(--border-radius-medium) !important; + --button-font-size: var(--font-size-root) !important; + --button-font-size-small: var(--font-size-small) !important; + --button-font-weight: var(--font-weight-semibold) !important; + --button-icon-fill: currentColor !important; + --button-icon-stroke: var(--button-icon-fill) !important; + --button-min-height: var(--size-item-large) !important; + --button-min-height-small: var(--size-item-medium) !important; + --button-opacity-disabled: 0.5 !important; + --button-padding: var(--space-xsmall) var(--space-large) !important; + --button-padding-icon: 0 !important; + --button-size-icon: var(--button-min-height) !important; + --button-size-icon-small: var(--button-min-height-small) !important; + --button-text-color-hover: var(--button-text-color) !important; + --button-text-color-active: var(--button-text-color) !important; + --button-text-color-disabled: var(--button-text-color) !important; + --button-text-color-destructive: var(--crust) !important; + --button-text-color-destructive-hover: var( + --button-text-color-destructive + ) !important; + --button-text-color-destructive-active: var( + --button-text-color-destructive + ) !important; + --button-text-color-destructive-disabled: var( + --button-text-color-destructive + ) !important; + --button-text-color-destructive-selected: var( + --button-text-color-destructive-active + ) !important; + --button-text-color-ghost: inherit !important; + --button-text-color-ghost-hover: inherit !important; + --button-text-color-ghost-active: inherit !important; + --button-text-color-ghost-disabled: inherit !important; + --button-text-color-ghost-selected: var( + --button-text-color-ghost-active + ) !important; + --button-text-color-primary-hover: var( + --button-text-color-primary + ) !important; + --button-text-color-primary-active: var( + --button-text-color-primary-hover + ) !important; + --button-text-color-primary-disabled: var( + --button-text-color-primary + ) !important; + --button-text-color-primary-selected: var( + --button-text-color-primary-active + ) !important; + --button-text-color-selected: var(--button-text-color-active) !important; + + /** Checkbox **/ + --checkbox-margin-inline: var(--space-small) !important; + --checkbox-size: var(--size-item-small) !important; + + /** Focus Outline **/ + --focus-outline: var(--focus-outline-width) solid var(--focus-outline-color) !important; + --focus-outline-color: var(--accent) !important; + --focus-outline-inset: calc(-1 * var(--focus-outline-width)) !important; + --focus-outline-offset: 2px !important; + --focus-outline-width: 2px !important; + + /** Font Weight **/ + --font-weight: normal !important; + --font-weight-bold: 700 !important; + --font-weight-semibold: 600 !important; + + /** Heading **/ + --heading-font-size-medium: var(--font-size-large) !important; + --heading-font-size-large: var(--font-size-xlarge) !important; + --heading-font-size-xlarge: var(--font-size-xxlarge) !important; + --heading-font-weight: var(--font-weight-semibold) !important; + + /** Icon **/ + --icon-color: var(--subtext1) !important; + --icon-color-critical: var(--red) !important; + --icon-color-information: var(--sky) !important; + --icon-color-success: var(--green) !important; + --icon-color-warning: var(--yellow) !important; + --icon-size: var(--icon-size-small) !important; + --icon-size-xsmall: var(--size-item-xsmall) !important; + --icon-size-small: var(--size-item-small) !important; + --icon-size-medium: 20px !important; + --icon-size-large: var(--size-item-medium) !important; + --icon-size-xlarge: var(--size-item-large) !important; + + /** Input - Text **/ + --input-text-min-height: var(--button-min-height) !important; + + /** Link **/ + --link-focus-outline-offset: 1px !important; + + /** Outline Color **/ + --outline-color-error: var(--red) !important; + + /** Size **/ + --size-item-xsmall: 12px !important; + --size-item-small: 16px !important; + --size-item-medium: 24px !important; + --size-item-large: 32px !important; + --size-item-xlarge: 48px !important; + + /** Space **/ + --space-xxsmall: calc(0.5 * var(--space-xsmall)) !important; + --space-xsmall: 0.267rem !important; + --space-small: calc(2 * var(--space-xsmall)) !important; + --space-medium: calc(3 * var(--space-xsmall)) !important; + --space-large: calc(4 * var(--space-xsmall)) !important; + --space-xlarge: calc(6 * var(--space-xsmall)) !important; + --space-xxlarge: calc(8 * var(--space-xsmall)) !important; + + /** Text **/ + --text-color-disabled: color-mix( + in srgb, + currentColor 40%, + transparent + ) !important; + --text-color-deemphasized: color-mix( + in srgb, + currentColor 69%, + transparent + ) !important; + --text-color-error: var(--red) !important; + } +} + +@layer tokens-prefers-contrast { + @media (prefers-contrast) { + :root, + :host(.anonymous-content-host) { + /** Attention Dot **/ + --attention-dot-color: var(--accent) !important; + + /** Background Color **/ + --background-color-box: var(--base) !important; + --background-color-box-info: var(--base) !important; + --background-color-canvas: var(--base) !important; + --background-color-critical: var(--base) !important; + --background-color-information: var(--base) !important; + --background-color-success: var(--base) !important; + --background-color-warning: var(--base) !important; + + /** Border **/ + --border-color: var(--text) !important; + --border-color-card: color-mix( + in srgb, + currentColor 41%, + transparent + ) !important; + --border-color-deemphasized: currentColor !important; + --border-color-interactive: var(--text) !important; + --border-color-transparent: var(--text) !important; + + /** Button **/ + --button-border-color: var(--button-text-color) !important; + --button-text-color-ghost-hover: var( + --button-text-color-hover + ) !important; + --button-text-color-ghost-active: var( + --button-text-color-active + ) !important; + + /** Icon **/ + --icon-color: var(--text) !important; + --icon-color-critical: var(--icon-color) !important; + --icon-color-information: var(--icon-color) !important; + --icon-color-success: var(--icon-color) !important; + --icon-color-warning: var(--icon-color) !important; + + /** Outline Color **/ + --outline-color-error: var(--border-color) !important; + + /** Text **/ + --text-color: var(--text) !important; + --text-color-deemphasized: inherit !important; + --text-color-error: inherit !important; + } + } +} + +@layer tokens-forced-colors { + @media (forced-colors) { + :root, + :host(.anonymous-content-host) { + /** Background Color **/ + --table-row-background-color-alternate: var(--base) !important; + + /** Border **/ + --border-color-card: var(--text) !important; + --border-color-deemphasized: var(--text) !important; + --border-color-interactive: var(--text) !important; + --border-color-interactive-hover: var(--accent) !important; + --border-color-interactive-active: var(--text) !important; + --border-color-interactive-disabled: var(--subtext0) !important; + --border-color-selected: var(--accent) !important; + + /** Button **/ + --button-background-color: var(--surface0) !important; + --button-background-color-hover: var(--crust) !important; + --button-background-color-active: var(--crust) !important; + --button-background-color-disabled: var(--surface0) !important; + --button-background-color-destructive: var( + --button-background-color-primary + ) !important; + --button-background-color-destructive-hover: var( + --button-background-color-primary-hover + ) !important; + --button-background-color-destructive-active: var( + --button-background-color-primary-active + ) !important; + --button-background-color-destructive-disabled: var( + --button-background-color-primary-disabled + ) !important; + --button-background-color-primary-disabled: var( + --button-text-color-disabled + ) !important; + --button-border-color: var(--border-color-interactive) !important; + --button-border-color-hover: var( + --border-color-interactive-hover + ) !important; + --button-border-color-active: var( + --border-color-interactive-active + ) !important; + --button-border-color-disabled: var( + --border-color-interactive-disabled + ) !important; + --button-border-color-destructive: var( + --button-border-color-primary + ) !important; + --button-border-color-destructive-hover: var( + --button-border-color-primary-hover + ) !important; + --button-border-color-destructive-active: var( + --button-border-color-primary-active + ) !important; + --button-border-color-destructive-disabled: var( + --button-border-color-primary-disabled + ) !important; + --button-border-color-primary: var(--surface0) !important; + --button-border-color-primary-hover: var(--crust) !important; + --button-border-color-primary-active: var(--text) !important; + --button-opacity-disabled: 1 !important; + --button-text-color: var(--text) !important; + --button-text-color-hover: var(--accent) !important; + --button-text-color-active: var(--accent) !important; + --button-text-color-disabled: var(--subtext0) !important; + --button-text-color-destructive: var( + --button-text-color-primary + ) !important; + --button-text-color-destructive-hover: var( + --button-text-color-primary-hover + ) !important; + --button-text-color-destructive-active: var( + --button-text-color-primary-active + ) !important; + --button-text-color-destructive-disabled: var( + --button-text-color-primary-disabled + ) !important; + --button-text-color-ghost-hover: var( + --button-text-color-hover + ) !important; + --button-text-color-ghost-active: var( + --button-text-color-active + ) !important; + --button-text-color-primary: var(--surface0) !important; + --button-text-color-primary-hover: var(--crust) !important; + + /** Color **/ + --color-accent-primary: var(--text) !important; + --color-accent-primary-hover: var(--accent) !important; + --color-accent-primary-active: var( + --color-accent-primary-hover + ) !important; + --color-accent-primary-selected: var(--accent) !important; + + /** Focus Outline **/ + --focus-outline-color: var(--text) !important; + + /** Link **/ + --link-color: var(--blue) !important; + --link-color-hover: var(--blue) !important; + --link-color-active: var(--red) !important; + --link-color-visited: var(--link-color) !important; + + /** Text **/ + --text-color-disabled: var(--subtext0) !important; + --text-color-accent-primary-selected: var(--crust) !important; + } + } +} diff --git a/home/apps/firefox_css/theme/theme.css b/home/apps/firefox_css/theme/theme.css new file mode 100644 index 0000000..cd48c8b --- /dev/null +++ b/home/apps/firefox_css/theme/theme.css @@ -0,0 +1,396 @@ +@import "../colors.css"; + +/* ======================================================================== + global variables + ======================================================================== */ +:root { + --border-color-card: 1px solid var(--surface0) !important; + --urlbar-container-border-width: 1px !important; + --urlbar-container-border-color: var(--surface0) !important; + + /* arrow panels */ + --arrowpanel-background: var(--surface0) !important; + --arrowpanel-border-color: var(--surface1) !important; + --arrowpanel-color: var(--text) !important; + --arrowpanel-dimmed-even-further: var(--overlay0) !important; + --arrowpanel-dimmed-further: var(--subtext1) !important; + --arrowpanel-dimmed: var(--subtext0) !important; + --default-arrowpanel-background: var(--surface0) !important; + --default-arrowpanel-border-color: var(--surface1) !important; + --default-arrowpanel-color: var(--text) !important; + + /* autocomplete & popups */ + --autocomplete-popup-background: var(--mantle) !important; + --autocomplete-popup-color: var(--text) !important; + --autocomplete-popup-highlight-background: var(--surface1) !important; + --autocomplete-popup-highlight-color: var(--text) !important; + --urlbar-popup-action-color: var(--accent) !important; + --urlbar-popup-url-color: var(--blue) !important; + --urlbar-separator-color: var(--surface0) !important; + + /* buttons (global) */ + --backbutton-active-background: var(--surface1) !important; + --backbutton-background: transparent !important; + --backbutton-border-color: transparent !important; + --backbutton-hover-background: var(--surface0) !important; + --cfr-active-color: var(--accent) !important; + --cfr-button-addons-icon: var(--text) !important; + --cfr-button-features-icon: var(--text) !important; + + /* color palette (blue) */ + --blue-40-a10: color-mix(in srgb, var(--blue), transparent 90%) !important; + --blue-40: var(--blue) !important; + --blue-50-a30: color-mix(in srgb, var(--blue), transparent 70%) !important; + --blue-50: var(--blue) !important; + --blue-60: var(--sapphire) !important; + --blue-70: var(--sky) !important; + --blue-80: var(--teal) !important; + + /* color palette (green) */ + --green-50: var(--green) !important; + --green-60: var(--green) !important; + --green-70: var(--teal) !important; + --green-80: var(--teal) !important; + --green-90: var(--teal) !important; + + /* color palette (grey/overlay) */ + --grey-20: var(--subtext1) !important; + --grey-30: var(--subtext0) !important; + --grey-40: var(--overlay2) !important; + --grey-60: var(--overlay0) !important; + --grey-70: var(--overlay2) !important; + --grey-80: var(--overlay2) !important; + --grey-90-a10: color-mix( + in srgb, + var(--surface1), + transparent 90% + ) !important; + --grey-90-a20: color-mix( + in srgb, + var(--surface1), + transparent 80% + ) !important; + --grey-90-a30: color-mix( + in srgb, + var(--surface1), + transparent 70% + ) !important; + --grey-90-a50: color-mix( + in srgb, + var(--surface1), + transparent 50% + ) !important; + --grey-90-a60: color-mix( + in srgb, + var(--surface1), + transparent 40% + ) !important; + --grey-90: var(--surface1) !important; + + /* color palette (misc) */ + --orange-50: var(--peach) !important; + --purple-70: var(--mauve) !important; + + /* color palette (red) */ + --red-50-a30: color-mix(in srgb, var(--red), transparent 70%) !important; + --red-50: var(--red) !important; + --red-60: var(--maroon) !important; + --red-70: var(--maroon) !important; + --red-80: var(--maroon) !important; + --red-90: var(--maroon) !important; + + /* color palette (yellow) */ + --yellow-10: var(--yellow) !important; + --yellow-50: var(--yellow) !important; + --yellow-60-a30: color-mix( + in srgb, + var(--yellow), + transparent 70% + ) !important; + --yellow-60: var(--yellow) !important; + --yellow-70: var(--peach) !important; + --yellow-80: var(--peach) !important; + --yellow-90: var(--peach) !important; + + /* context menus */ + --menu-background-color: var(--base) !important; + --menu-border-color: var(--surface1) !important; + --menu-color: var(--text) !important; + --menu-disabled-color: var(--overlay0) !important; + --menu-icon-opacity: 1 !important; + --menuitem-disabled-hover-background-color: transparent !important; + --menuitem-hover-background-color: var(--surface1) !important; + --panel-disabled-color: var(--overlay0) !important; + --panel-separator-color: var(--surface0) !important; + + /* in-content ui (cards & boxes) */ + --card-outline-color: var(--surface1) !important; + --card-shadow-focus: 0 0 0 2px var(--accent) !important; + --card-shadow-hover: 0 4px 8px + color-mix(in srgb, var(--crust), transparent 80%) !important; + --card-shadow: 0 1px 4px color-mix(in srgb, var(--crust), transparent 90%) !important; + --in-content-box-background-active: var(--surface1) !important; + --in-content-box-background-hover: var(--surface1) !important; + --in-content-box-background-odd: var(--mantle) !important; + --in-content-box-background: var(--surface0) !important; + --in-content-box-border-color: var(--surface1) !important; + --in-content-box-info-background: var(--surface0) !important; + + /* in-content ui (colors & text) */ + --in-content-deemphasized-text: var(--subtext0) !important; + --in-content-link-color-active: var(--sky) !important; + --in-content-link-color-hover: var(--sapphire) !important; + --in-content-link-color-visited: var(--lavender) !important; + --in-content-link-color: var(--blue) !important; + --in-content-page-background: var(--base) !important; + --in-content-page-color: var(--text) !important; + --in-content-selected-text: var(--surface2) !important; + --in-content-text-color: var(--text) !important; + + /* in-content ui (forms & buttons) */ + --in-content-border-active-shadow: 0 0 0 2px var(--accent) !important; + --in-content-border-active: var(--accent) !important; + --in-content-border-color: var(--surface1) !important; + --in-content-border-focus: var(--accent) !important; + --in-content-border-highlight: var(--blue) !important; + --in-content-border-hover: var(--surface2) !important; + --in-content-border-invalid-shadow: 0 0 0 2px var(--red) !important; + --in-content-border-invalid: var(--red) !important; + --in-content-button-background-active: var(--surface1) !important; + --in-content-button-background-hover: var(--surface2) !important; + --in-content-button-background: var(--surface0) !important; + --in-content-category-background-active: var(--surface1) !important; + --in-content-category-background-hover: var(--surface0) !important; + --in-content-category-background-selected-active: var(--surface2) !important; + --in-content-category-background-selected-hover: var(--surface1) !important; + --in-content-category-outline-focus: var(--accent) !important; + --in-content-category-text-selected-active: var(--accent) !important; + --in-content-category-text-selected: var(--accent) !important; + --in-content-item-hover: var(--surface0) !important; + --in-content-item-selected: var(--surface1) !important; + --in-content-primary-button-background-active: var(--maroon) !important; + --in-content-primary-button-background-hover: var(--peach) !important; + --in-content-primary-button-background: var(--accent) !important; + + /* in-content ui (misc) */ + --chrome-content-separator-color: var(--surface0) !important; + --in-content-dialog-header-background: var(--mantle) !important; + --in-content-tab-color: var(--subtext0) !important; + --in-content-table-background: var(--mantle) !important; + --in-content-table-border-dark-color: var(--surface1) !important; + --in-content-table-header-background: var(--surface0) !important; + --in-content-warning-container: var(--red) !important; + --shadow-10: 0 1px 2px color-mix(in srgb, var(--crust), transparent 90%) !important; + --shadow-30: 0 4px 8px color-mix(in srgb, var(--crust), transparent 80%) !important; + + /* lightweight theme (lwt) */ + --lwt-accent-color: var(--accent) !important; + --lwt-sidebar-background-color: var(--mantle) !important; + --lwt-sidebar-text-color: var(--text) !important; + --lwt-text-color: var(--text) !important; + --lwt-toolbar-field-background-color: var(--crust) !important; + --lwt-toolbar-field-border-color: var(--surface0) !important; + --lwt-toolbar-field-color: var(--text) !important; + --lwt-toolbar-field-focus-color: var(--text) !important; + --lwt-toolbar-field-focus: var(--accent) !important; + --lwt-toolbarbutton-icon-fill: var(--text) !important; + + /* navigator tabs */ + --tab-line-color: var(--accent) !important; + --tab-loading-fill: var(--accent) !important; + --tabs-border-color: var(--surface0) !important; + + /* new tab page */ + --newtab-background-color: var(--base) !important; + --newtab-border-primary-color: var(--surface1) !important; + --newtab-border-secondary-color: var(--surface0) !important; + --newtab-button-primary-color: var(--accent) !important; + --newtab-button-secondary-color: var(--surface0) !important; + --newtab-card-active-outline-color: var(--accent) !important; + --newtab-card-background-color: var(--surface0) !important; + --newtab-card-hairline-color: var(--surface1) !important; + --newtab-card-placeholder-color: var(--surface1) !important; + --newtab-card-shadow: 0 1px 4px + color-mix(in srgb, var(--crust), transparent 80%) !important; + --newtab-contextmenu-background-color: var(--surface0) !important; + --newtab-contextmenu-button-color: var(--text) !important; + --newtab-element-active-color: var(--surface1) !important; + --newtab-element-hover-color: var(--surface0) !important; + --newtab-feed-button-background-faded: var(--surface1) !important; + --newtab-feed-button-background: var(--surface0) !important; + --newtab-feed-button-spinner: var(--text) !important; + --newtab-feed-button-text-faded: var(--subtext0) !important; + --newtab-feed-button-text: var(--text) !important; + --newtab-icon-primary-color: var(--text) !important; + --newtab-icon-secondary-color: var(--subtext0) !important; + --newtab-icon-tertiary-color: var(--overlay0) !important; + --newtab-inner-box-shadow-color: color-mix( + in srgb, + var(--crust), + transparent 80% + ) !important; + --newtab-link-primary-color: var(--blue) !important; + --newtab-link-secondary-color: var(--sapphire) !important; + --newtab-modal-color: var(--base) !important; + --newtab-overlay-color: color-mix( + in srgb, + var(--crust), + transparent 40% + ) !important; + --newtab-search-border-color: var(--surface0) !important; + --newtab-search-dropdown-color: var(--mantle) !important; + --newtab-search-dropdown-header-color: var(--subtext1) !important; + --newtab-search-header-background-color: var(--base) !important; + --newtab-search-icon-color: var(--text) !important; + --newtab-search-icon: var(--text) !important; + --newtab-search-wordmark-color: var(--text) !important; + --newtab-section-active-contextmenu-color: var(--text) !important; + --newtab-section-header-text-color: var(--text) !important; + --newtab-section-navigation-text-color: var(--subtext0) !important; + --newtab-snippets-background-color: var(--surface0) !important; + --newtab-snippets-hairline-color: var(--surface1) !important; + --newtab-text-conditional-color: var(--red) !important; + --newtab-text-primary-color: var(--text) !important; + --newtab-text-secondary-color: var(--subtext0) !important; + --newtab-textbox-background-color: var(--crust) !important; + --newtab-textbox-border: var(--surface0) !important; + --newtab-textbox-focus-boxshadow: 0 0 0 2px var(--accent) !important; + --newtab-textbox-focus-color: var(--accent) !important; + --newtab-topsites-background-color: var(--base) !important; + --newtab-topsites-icon-shadow: none !important; + --newtab-topsites-label-color: var(--text) !important; + --trailhead-card-button-background-active-color: var(--accent) !important; + --trailhead-card-button-background-color: var(--surface1) !important; + --trailhead-card-button-background-hover-color: var(--surface2) !important; + --trailhead-cards-background-color: var(--surface0) !important; + --trailhead-header-text-color: var(--text) !important; + + /* notifications */ + --short-notification-background: var(--surface0) !important; + --short-notification-gradient: linear-gradient( + var(--surface0), + var(--surface0) + ) !important; + + /* sidebar */ + --sidebar-background-color: var(--mantle) !important; + --sidebar-border-color: var(--surface0) !important; + --sidebar-text-color: var(--text) !important; + + /* toolbar & urlbar */ + --toolbar-bgcolor: var(--mantle) !important; + --toolbar-color: var(--text) !important; + --toolbar-field-focus-border-color: var(--accent) !important; + --toolbar-non-lwt-bgcolor: var(--mantle) !important; + --toolbar-non-lwt-textcolor: var(--text) !important; + --toolbarbutton-active-background: var(--surface1) !important; + --toolbarbutton-focus-outline: var(--accent) !important; + --toolbarbutton-hover-background: var(--surface0) !important; + --toolbarbutton-icon-fill-attention: var(--blue) !important; +} + +/* ======================================================================== + global component styles + ======================================================================== */ + +#sidebar-main > *[expanded] { + background-color: var(--mantle) !important; +} + +*, +:root { + accent-color: var(--accent) !important; +} + +#TabsToolbar { + background-color: var(--mantle) !important; +} + +#sidebar-launcher-splitter:hover { + background-color: var(--accent) !important; +} + +[_moz-menuactive="true"] { + background-color: var(--accent) !important; + color: var(--mantle) !important; +} + +menupopup { + --panel-background: var(--base) !important; + --panel-border-color: var(--surface1) !important; + --panel-text: var(--text) !important; +} + +menuseparator { + border-color: var(--surface1) !important; +} + +/* ======================================================================== + overrides & media queries + ======================================================================== */ +@media { + #PersonalToolbar, + #nav-bar { + background-color: var(--mantle) !important; + } + + :root { + /* browser tabs */ + .tab-background[multiselected] { + --focus-outline-color: var(--surface0); + } + + .tab-background[selected]:not([multiselected]) { + outline: 1px solid var(--surface0); + outline-offset: -1px; + } + + .tabbrowser-tab[selected="true"] .tab-background { + border: 1px solid var(--surface0) !important; + } + + #tabbrowser-tabs { + --tab-loading-fill: var(--text) !important; + } + + /* general variable overrides */ + --arrowpanel-background: var(--surface0) !important; + --arrowpanel-border-color: var(--surface0) !important; + --arrowpanel-color: var(--text) !important; + --chrome-content-separator-color: var(--surface0) !important; + --input-bgcolor: var(--crust) !important; + --input-border-color: var(--mantle) !important; + --input-color: var(--text) !important; + --tab-selected-bgcolor: var(--base) !important; + --tab-selected-textcolor: var(--text) !important; + --toolbar-bgcolor: var(--mantle) !important; + --toolbar-field-background-color: var(--input-bgcolor) !important; + --toolbar-field-border-color: var(--input-border-color) !important; + --toolbar-field-color: var(--input-color) !important; + --toolbar-field-focus-background-color: var(--base) !important; + --toolbar-field-focus-border-color: var(--surface0) !important; + --toolbarseparator-color: var(--text) !important; + --toolbox-non-lwt-bgcolor: var(--crust) !important; + --toolbox-non-lwt-textcolor: var(--text) !important; + + /* inputs & selection */ + #urlbar-input:focus::selection, + .searchbar-textbox:focus::selection { + background-color: var(--text); + color: var(--surface0); + } + + /* toolbar buttons */ + --toolbarbutton-active-background: var(--overlay0) !important; + --toolbarbutton-icon-fill: var(--text) !important; + --toolbarbutton-icon-fill-attention: var(--text) !important; + + /* urlbar */ + --urlbarView-highlight-background: var(--overlay0) !important; + --urlbarView-highlight-color: var(--text) !important; + + &:where([tabsintitlebar]) { + --toolbox-non-lwt-bgcolor-inactive: var(--crust) !important; + } + } +} diff --git a/home/apps/firefox_css/userChrome.css b/home/apps/firefox_css/userChrome.css new file mode 100644 index 0000000..a93785e --- /dev/null +++ b/home/apps/firefox_css/userChrome.css @@ -0,0 +1,3 @@ +@import "./colors.css"; +@import "./theme/theme.css"; +@import "./theme/hide.css"; diff --git a/home/apps/mpv.nix b/home/apps/mpv.nix new file mode 100644 index 0000000..84717cf --- /dev/null +++ b/home/apps/mpv.nix @@ -0,0 +1,48 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + programs.mpv = { + enable = true; + package = pkgs.mpv; + bindings = { }; + config = with config.scheme.withHashtag; { + background-color = "#000000"; + osd-back-color = base11; + osd-border-color = base11; + osd-color = base05; + osd-shadow-color = base00; + sub-font = config.userOptions.fontSans.name; + osd-font = config.userOptions.fontSans.name; + }; + scripts = with pkgs.mpvScripts; [ + uosc + mpv-subtitle-lines # requires uosc + mpris + autosub + youtube-upnext + youtube-chat + mpv-notify-send + ]; + scriptOpts = { + uosc = { + color = + with config.scheme; + lib.concatStringsSep "," ( + lib.mapAttrsToList (key: value: "${key}=${value}") { + foreground = config.scheme.${config.colors.accent}; + foreground_text = base01; + background = base00; + background_text = base05; + curtain = base10; + success = base0B; + error = base08; + } + ); + }; + }; + }; +} diff --git a/home/apps/vencord.nix b/home/apps/vencord.nix new file mode 100644 index 0000000..39f7123 --- /dev/null +++ b/home/apps/vencord.nix @@ -0,0 +1,350 @@ +{ + autoUpdate = true; + autoUpdateNotification = true; + useQuickCss = true; + themeLinks = [ ]; + eagerPatches = false; + enabledThemes = [ "base16.css" ]; + enableReactDevtools = false; + frameless = false; + transparent = true; + winCtrlQ = false; + disableMinSize = true; + winNativeTitleBar = false; + plugins = { + BadgeAPI.enabled = true; + CommandsAPI.enabled = true; + ContextMenuAPI.enabled = true; + MemberListDecoratorsAPI.enabled = false; + MessageAccessoriesAPI.enabled = true; + MessageDecorationsAPI.enabled = false; + MessageEventsAPI.enabled = true; + MessagePopoverAPI.enabled = true; + NoticesAPI.enabled = true; + ServerListAPI.enabled = false; + SettingsStoreAPI.enabled = false; + NoTrack = { + enabled = true; + disableAnalytics = true; + }; + Settings = { + enabled = true; + settingsLocation = "aboveActivity"; + }; + SupportHelper.enabled = true; + AlwaysAnimate.enabled = false; + AlwaysTrust = { + enabled = true; + domain = true; + file = true; + }; + AnonymiseFileNames = { + enabled = false; + method = 0; + randomisedLength = 7; + anonymiseByDefault = true; + }; + "WebRichPresence (arRPC)".enabled = false; + BANger = { + enabled = false; + source = "https://i.imgur.com/wp5q52C.mp4"; + }; + BetterFolders = { + enabled = false; + sidebar = true; + showFolderIcon = 1; + closeAllHomeButton = false; + keepIcons = false; + sidebarAnim = true; + closeAllFolders = false; + forceOpen = false; + closeOthers = false; + }; + BetterGifAltText.enabled = false; + BetterNotesBox = { + enabled = false; + hide = false; + noSpellCheck = false; + }; + BetterRoleDot = { + enabled = false; + bothStyles = false; + copyRoleColorInProfilePopout = false; + }; + BetterUploadButton.enabled = false; + BiggerStreamPreview.enabled = true; + BlurNSFW = { + enabled = false; + blurAmount = 10; + }; + CallTimer = { + enabled = true; + format = "stopwatch"; + }; + ClearURLs.enabled = true; + ClientTheme = { + enabled = false; + color = "31363b"; + }; + ColorSighted.enabled = false; + ConsoleShortcuts.enabled = false; + CopyUserURLs.enabled = false; + CrashHandler.enabled = true; + CustomRPC.enabled = false; + Dearrow = { + enabled = false; + hideButton = false; + replaceElements = 0; + dearrowByDefault = true; + }; + Experiments = { + enabled = true; + toolbarDevMenu = false; + }; + F8Break.enabled = false; + FakeNitro = { + enabled = true; + enableEmojiBypass = true; + enableStickerBypass = true; + enableStreamQualityBypass = true; + transformStickers = true; + transformEmojis = true; + transformCompoundSentence = false; + emojiSize = 48; + stickerSize = 160; + useHyperLinks = true; + hyperLinkText = "{{NAME}}"; + disableEmbedPermissionCheck = false; + }; + FakeProfileThemes.enabled = false; + FavoriteEmojiFirst.enabled = false; + FavoriteGifSearch.enabled = false; + FixImagesQuality.enabled = false; + ForceOwnerCrown.enabled = false; + FriendInvites.enabled = false; + GameActivityToggle.enabled = false; + GifPaste.enabled = false; + GreetStickerPicker = { + enabled = true; + greetMode = "Greet"; + }; + iLoveSpam.enabled = false; + IgnoreActivities.enabled = false; + ImageZoom.enabled = false; + KeepCurrentChannel.enabled = false; + LastFMRichPresence.enabled = false; + LoadingQuotes.enabled = false; + MemberCount.enabled = false; + MessageClickActions.enabled = false; + MessageLinkEmbeds.enabled = false; + MessageLogger = { + enabled = true; + deleteStyle = "text"; + ignoreBots = false; + ignoreSelf = false; + ignoreUsers = ""; + ignoreChannels = ""; + ignoreGuilds = ""; + logEdits = true; + logDeletes = true; + collapseDeleted = false; + inlineEdits = true; + }; + MessageTags.enabled = false; + MoreCommands.enabled = false; + MoreKaomoji.enabled = false; + MoreUserTags.enabled = false; + Moyai.enabled = false; + MutualGroupDMs.enabled = false; + NoBlockedMessages.enabled = false; + NoDevtoolsWarning.enabled = false; + NoF1.enabled = false; + NoMosaic.enabled = false; + NoPendingCount = { + enabled = true; + hideFriendRequestsCount = true; + hideMessageRequestsCount = true; + hidePremiumOffersCount = true; + }; + NoProfileThemes.enabled = true; + NoReplyMention.enabled = false; + NoScreensharePreview.enabled = false; + NoTypingAnimation.enabled = false; + NoUnblockToJump.enabled = false; + NormalizeMessageLinks.enabled = false; + NSFWGateBypass.enabled = false; + OnePingPerDM.enabled = false; + oneko.enabled = false; + OpenInApp.enabled = false; + PermissionFreeWill.enabled = false; + PermissionsViewer.enabled = false; + petpet.enabled = false; + PictureInPicture.enabled = true; + PinDMs.enabled = false; + PlainFolderIcon.enabled = false; + PlatformIndicators.enabled = false; + PreviewMessage.enabled = false; + QuickMention.enabled = false; + QuickReply.enabled = false; + ReactErrorDecoder.enabled = false; + ReadAllNotificationsButton.enabled = false; + RelationshipNotifier.enabled = false; + RevealAllSpoilers.enabled = false; + ReverseImageSearch.enabled = false; + RoleColorEverywhere.enabled = false; + SecretRingToneEnabler.enabled = false; + SendTimestamps.enabled = false; + ServerListIndicators.enabled = false; + ShowAllMessageButtons.enabled = false; + ShowConnections.enabled = false; + ShowHiddenChannels = { + enabled = true; + showMode = 1; + hideUnreads = true; + defaultAllowedUsersAndRolesDropdownState = true; + }; + ShowMeYourName.enabled = false; + SilentMessageToggle.enabled = false; + SilentTyping.enabled = false; + SortFriendRequests.enabled = false; + SpotifyControls.enabled = false; + SpotifyCrack.enabled = false; + SpotifyShareCommands.enabled = false; + StartupTimings.enabled = true; + SuperReactionTweaks.enabled = false; + TextReplace.enabled = false; + ThemeAttributes.enabled = false; + TimeBarAllActivities.enabled = false; + Translate.enabled = false; + TypingIndicator.enabled = false; + TypingTweaks.enabled = false; + Unindent.enabled = false; + UnsuppressEmbeds.enabled = false; + UrbanDictionary.enabled = false; + UserVoiceShow.enabled = false; + USRBG = { + enabled = false; + voiceBackground = true; + nitroFirst = true; + }; + ValidUser.enabled = false; + VoiceChatDoubleClick.enabled = true; + VcNarrator.enabled = false; + ViewIcons.enabled = false; + ViewRaw = { + enabled = true; + clickMethod = "Left"; + }; + VoiceMessages = { + enabled = false; + noiseSuppression = true; + echoCancellation = true; + }; + WebContextMenus = { + enabled = false; + addBack = true; + }; + WebKeybinds.enabled = true; + WhoReacted.enabled = true; + Wikisearch.enabled = true; + Decor.enabled = false; + NotificationVolume.enabled = false; + FixSpotifyEmbeds.enabled = false; + InvisibleChat.enabled = false; + ShikiCodeblocks.enabled = false; + XSOverlay.enabled = false; + BetterGifPicker.enabled = false; + FixCodeblockGap.enabled = false; + ReviewDB = { + enabled = true; + notifyReviews = true; + showWarning = true; + hideTimestamps = false; + hideBlockedUsers = true; + }; + FixYoutubeEmbeds.enabled = false; + ChatInputButtonAPI.enabled = false; + DisableCallIdle.enabled = false; + NewGuildSettings.enabled = false; + BetterRoleContext.enabled = false; + FriendsSince.enabled = false; + ResurrectHome.enabled = false; + BetterSettings.enabled = false; + OverrideForumDefaults.enabled = false; + UnlockedAvatarZoom.enabled = false; + ShowHiddenThings.enabled = false; + BetterSessions.enabled = false; + ImplicitRelationships.enabled = false; + StreamerModeOnStream.enabled = false; + ImageLink.enabled = false; + MessageLatency.enabled = false; + PauseInvitesForever.enabled = false; + ReplyTimestamp.enabled = false; + VoiceDownload.enabled = true; + WebScreenShareFixes.enabled = true; + PartyMode.enabled = false; + AutomodContext.enabled = false; + CtrlEnterSend.enabled = false; + CustomIdle.enabled = false; + NoDefaultHangStatus.enabled = false; + NoServerEmojis.enabled = false; + ReplaceGoogleSearch.enabled = false; + ShowTimeoutDuration.enabled = false; + ValidReply.enabled = false; + DontRoundMyTimestamps.enabled = false; + MaskedLinkPaste.enabled = false; + Summaries.enabled = false; + ServerInfo.enabled = false; + YoutubeAdblock.enabled = false; + MessageUpdaterAPI.enabled = true; + UserSettingsAPI.enabled = true; + AppleMusicRichPresence.enabled = false; + ConsoleJanitor.enabled = false; + CopyEmojiMarkdown.enabled = false; + MentionAvatars.enabled = false; + NoOnboardingDelay.enabled = false; + SuncordToolbox.enabled = true; + AlwaysExpandRoles.enabled = false; + NoMaskedUrlPaste.enabled = false; + VencordToolbox.enabled = false; + AccountPanelServerProfile.enabled = false; + CopyFileContents.enabled = false; + StickerPaste.enabled = false; + VolumeBooster.enabled = false; + FullSearchContext.enabled = false; + UserMessagesPronouns = { + enabled = false; + showInMessages = true; + showSelf = true; + pronounSource = 0; + showInProfile = true; + pronounsFormat = "LOWERCASE"; + }; + DynamicImageModalAPI.enabled = false; + FullUserInChatbox.enabled = false; + HideMedia.enabled = false; + IrcColors.enabled = false; + DisableDeepLinks.enabled = true; + ExpressionCloner.enabled = true; + CopyStickerLinks.enabled = false; + ImageFilename.enabled = false; + }; + uiElements = { + chatBarButtons = { }; + messagePopoverButtons = { }; + }; + notifications = { + timeout = 5000; + position = "bottom-right"; + useNative = "not-focused"; + logLimit = 50; + }; + cloud = { + authenticated = false; + url = "https://api.vencord.dev/"; + settingsSync = false; + settingsSyncVersion = 1765984819568; + }; + notifyAboutUpdates = false; + macosTranslucency = false; +} diff --git a/home/apps/vscode.nix b/home/apps/vscode.nix new file mode 100644 index 0000000..3d35311 --- /dev/null +++ b/home/apps/vscode.nix @@ -0,0 +1,54 @@ +{ + config, + pkgs, + lib, + ... +}: +let + capitalize = + str: + (lib.toUpper (builtins.substring 0 1 str)) + (builtins.substring 1 (builtins.stringLength str) str); +in +{ + # home.sessionVariables = { + # EDITOR = "code"; + # }; + + catppuccin.vscode.profiles.default = { + enable = true; + settings = { + workbenchMode = "minimal"; + }; + }; + + programs.vscode = { + enable = true; + profiles.default = { + enableExtensionUpdateCheck = true; + enableMcpIntegration = true; + enableUpdateCheck = true; + # https://search.nixos.org/packages?query=vscode-extensions + extensions = with pkgs.vscode-extensions; [ + yzhang.markdown-all-in-one + jnoortheen.nix-ide + esbenp.prettier-vscode + ]; + userSettings = { + "window.menuBarVisibility" = "compact"; + "workbench.navigationControl.enabled" = false; + "window.commandCenter" = false; + "workbench.layoutControl.enabled" = false; + "window.titleBarStyle" = "native"; + "editor.minimap.enabled" = false; + "editor.semanticHighlighting.enabled" = true; + + # Disable AI "features" + ## Chat features + "chat.agent.enabled" = false; + "chat.commandCenter.enabled" = false; + "inlineChat.accessibleDiffView" = "off"; + "terminal.integrated.initialHint" = false; + }; + }; + }; +} diff --git a/home/default.nix b/home/default.nix new file mode 100755 index 0000000..53fa623 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,105 @@ +{ + config, + pkgs, + pkgs-unstable, + ... +}: +{ + + config = { + home.packages = with pkgs; [ + # cli utilities + tmux + fastfetch + btop + wget + ripgrep + ncdu + fzf + wl-clipboard + rclone + waypipe + spotdl + browsh + mosh + gh + + # development & tooling + jdk21_headless + quickemu + nerd-fonts.noto + noto-fonts + noto-fonts-color-emoji + nix-prefetch + prowlarr + radarr + sonarr + flaresolverr + nerd-fonts.fira-mono + ffmpeg-full + + # kde and kde theming + # kde-rounded-corners + kdePackages.partitionmanager + pkgs.catppuccin-cursors.mochaPeach + + # gui applications + input-leap + libreoffice-qt-fresh + # nur.repos.forkprince.helium-nightly + chromium + qbittorrent + nautilus + fractal + tuba + + # gui applications ( multimedia ) + audacity + strawberry + musescore + gimp + calibre + # riff + dissent + loupe + spotify-player + + # overrides + # (chromium.override { + # enableWideVine = true; + # }) + ]; + + services = { + spotifyd = { + enable = true; + package = pkgs-unstable.spotifyd; + settings = { + global = { + device_type = "computer"; + dbus_type = "session"; + disable_discovery = true; + use_mpris = true; + bitrate = 320; + initial_volume = 100; + volume_normalisation = true; + normalisation_pregain = 0; + }; + }; + }; + }; + + # 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 = "25.05"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + }; +} diff --git a/home/games/default.nix b/home/games/default.nix new file mode 100644 index 0000000..c7da03f --- /dev/null +++ b/home/games/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./minecraft.nix + ./morrowind.nix + ]; +} diff --git a/home/games/minecraft.nix b/home/games/minecraft.nix new file mode 100644 index 0000000..cfc1ffa --- /dev/null +++ b/home/games/minecraft.nix @@ -0,0 +1,17 @@ +{ + config, + pkgs, + ... +}: +{ + home.packages = with pkgs; [ + (prismlauncher.override { + jdks = [ + jdk25 + jdk21 + jdk17 + jdk8 + ]; + }) + ]; +} diff --git a/home/games/morrowind.nix b/home/games/morrowind.nix new file mode 100644 index 0000000..be92688 --- /dev/null +++ b/home/games/morrowind.nix @@ -0,0 +1,23 @@ +{ + config, + pkgs, + ... +}: +{ + home = { + packages = with pkgs; [ openmw ]; + sessionVariables = { + SDL_VIDEO_DRIVER = "wayland"; + }; + }; + + programs.firefox.profiles.default.search.engines.uesp = { + name = "Unofficial Elder Scrolls Pages"; + urls = [ + { + template = "https://en.uesp.net/w/index.php?title=Special%3ASearch&search={searchTerms}&button="; + } + ]; + definedAliases = [ "uesp" ]; + }; +} diff --git a/home/hosts/alien/default.nix b/home/hosts/alien/default.nix new file mode 100644 index 0000000..513501e --- /dev/null +++ b/home/hosts/alien/default.nix @@ -0,0 +1,55 @@ +{ + config, + pkgs, + lib, + pkgs-unstable, + spicetify-nix, + ... +}: +{ + colors = { + scheme = "catppuccin-mocha"; + accent = "base0D"; + }; + + home.packages = with pkgs; [ + pkgs-unstable.ckan + + # steam gtk theming + adwsteamgtk + daggerfall-unity + vintagestory + gamemode + ]; + + programs.noctalia-shell.settings.brightness.enableDdcSupport = true; + programs.noctalia-shell.settings.bar = { + position = "top"; + density = "default"; + }; + + programs.spicetify = + let + spicePkgs = spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; + in + { + enable = true; + + enabledExtensions = with spicePkgs.extensions; [ + adblock + hidePodcasts + shuffle # shuffle+ (special characters are sanitized out of extension names) + ]; + enabledCustomApps = with spicePkgs.apps; [ + newReleases + ncsVisualizer + ]; + enabledSnippets = with spicePkgs.snippets; [ + rotatingCoverart + pointer + ]; + + theme = spicePkgs.themes.catppuccin; + colorScheme = "mocha"; + }; +} diff --git a/home/hosts/peach/default.nix b/home/hosts/peach/default.nix new file mode 100644 index 0000000..1415982 --- /dev/null +++ b/home/hosts/peach/default.nix @@ -0,0 +1,51 @@ +{ + pkgs, + config, + lib, + ... +}: +{ + colors = { + scheme = "catppuccin-latte"; + accent = "base09"; + }; + + home.packages = with pkgs; [ + asahi-nvram + asahi-bless + asahi-btsync + asahi-wifisync + + moonlight-qt + ]; + + # https://github.com/YaLTeR/niri/issues/2330#issuecomment-3256864777 + programs.niri.settings.debug = { + render-drm-device = "/dev/dri/card2"; + }; + + programs.noctalia-shell.settings.bar = { + position = "top"; + density = "spacious"; + }; + + programs.plasma = lib.mkDefault { + input.touchpads = [ + { + name = "Apple MTP multi-touch"; + vendorId = "05ac"; + productId = "0352"; + disableWhileTyping = false; + enable = true; + tapToClick = false; + naturalScroll = true; + accelerationProfile = "default"; + } + ]; + + shortcuts = { + # this is really annoying on apple laptops + org_kde_powerdevil.Sleep = [ ]; + }; + }; +} diff --git a/home/hosts/vm-generic/default.nix b/home/hosts/vm-generic/default.nix new file mode 100644 index 0000000..e5488aa --- /dev/null +++ b/home/hosts/vm-generic/default.nix @@ -0,0 +1,108 @@ +{ + config, + pkgs, + ... +}: +{ + colors = { + scheme = "catppuccin-mocha"; + accent = "base0B"; + }; + + home.packages = with pkgs; [ ]; + + programs.plasma = { + panels = [ + # Application name, Global menu and Song information and playback controls at the top + { + location = "top"; + height = 37; + floating = false; + widgets = [ + { + applicationTitleBar = { + behavior = { + activeTaskSource = "activeTask"; + }; + layout = { + elements = [ "windowTitle" ]; + horizontalAlignment = "right"; + showDisabledElements = "deactivated"; + verticalAlignment = "center"; + }; + overrideForMaximized.enable = false; + windowTitle = { + font = { + bold = false; + fit = "fixedSize"; + size = 10; + }; + hideEmptyTitle = true; + margins = { + bottom = 5; + left = 10; + right = 0; + top = 5; + }; + source = "appName"; + }; + }; + } + "org.kde.plasma.appmenu" + "org.kde.plasma.panelspacer" + { + plasmusicToolbar = { + panelIcon = { + albumCover = { + useAsIcon = false; + radius = 8; + }; + icon = ""; + }; + playbackSource = "auto"; + musicControls.showPlaybackControls = false; + songText = { + displayInSeparateLines = true; + maximumWidth = 320; + scrolling = { + behavior = "alwaysScroll"; + speed = 3; + }; + }; + }; + } + "org.kde.plasma.marginsseparator" + { + systemTray.items = { + shown = [ + "org.kde.plasma.battery" + "org.kde.plasma.bluetooth" + "org.kde.plasma.networkmanagement" + "org.kde.plasma.brightness" + "org.kde.plasma.volume" + ]; + hidden = [ + "org.kde.plasma.clipboard" + "org.kde.plasma.manage-inputmethod" + "org.kde.plasma.cameraindicator" + "org.kde.plasma.keyboardlayout" + "org.kde.plasma.devicenotifier" + "org.kde.plasma.notifications" + "org.kde.plasma.weather" + "org.kde.plasma.printmanager" + "org.kde.plasma.keyboardindicator" + "org.kde.plasma.mediacontroller" + ]; + }; + } + { + digitalClock = { + calendar.firstDayOfWeek = "sunday"; + time.format = "12h"; + }; + } + ]; + } + ]; + }; +} diff --git a/home/kde/default.nix b/home/kde/default.nix new file mode 100644 index 0000000..17814d4 --- /dev/null +++ b/home/kde/default.nix @@ -0,0 +1,231 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + programs.ghostwriter = { + enable = true; + font = { + family = config.userOptions.fontSans.name; + pointSize = config.userOptions.fontSans.size; + }; + }; + + programs.kate = { + enable = true; + editor = { + font = { + family = config.userOptions.fontMono.name; + pointSize = config.userOptions.fontMono.size; + }; + }; + }; + + # aerothemeplasma = { + # enable = true; + # plasma.enable = true; + # fonts.enable = true; + # }; + + programs.plasma = lib.mkDefault { + enable = true; + session = { + sessionRestore.restoreOpenApplicationsOnLogin = "startWithEmptySession"; + }; + + workspace = { + wallpaperPictureOfTheDay.provider = "bing"; + wallpaperFillMode = "preserveAspectCrop"; + }; + + kscreenlocker = { + appearance.wallpaperPictureOfTheDay.provider = "bing"; + }; + + window-rules = [ + { + description = "Global Changes"; + match = { + window-class = { + value = ""; + type = "substring"; + }; + window-types = [ "normal" ]; + }; + apply = { + opacityactive = { + value = 100; + apply = "force"; + }; + opacityinactive = { + value = 100; + apply = "force"; + }; + }; + } + { + description = "OpenMW"; + match = { + window-class = { + value = "openmw"; + type = "substring"; + }; + window-types = [ "normal" ]; + }; + apply = { + noborder = { + value = true; + apply = "force"; + }; + maximizehoriz = { + value = true; + apply = "force"; + }; + maximizevert = { + value = true; + apply = "force"; + }; + desktops = { + value = "Desktop_4"; + apply = "force"; + }; + }; + } + { + description = "Minecraft"; + match = { + window-class = { + value = "Minecraft*"; + type = "substring"; + }; + window-types = [ "normal" ]; + }; + apply = { + noborder = { + value = true; + apply = "initially"; + }; + maximizehoriz = { + value = true; + apply = "initially"; + }; + maximizevert = { + value = true; + apply = "initially"; + }; + desktops = { + value = "Desktop_4"; + apply = "initially"; + }; + }; + } + { + description = "Picture-in-Picture"; + match = { + window-class = { + value = ""; + type = "substring"; + }; + title = { + value = "(?i)picture[- ]in[- ]picture"; + type = "regex"; + }; + }; + apply = { + above = { + value = true; + apply = "force"; + }; + desktops = { + value = "\\0"; + apply = "force"; + }; + }; + } + { + description = "Steam (Distrobox)"; + match = { + window-class = { + value = "steamwebhelper"; + type = "substring"; + }; + window-types = [ "normal" ]; + }; + apply = { + desktopfile = { + value = "distrobox-steam"; + apply = "force"; + }; + }; + } + ]; + + kwin = { + nightLight = { + enable = true; + mode = "location"; + # Atlanta + location.latitude = "33.7501"; + location.longitude = "-84.3885"; + temperature.day = 6000; + temperature.night = 3500; + transitionTime = 60; + }; + virtualDesktops = { + names = [ + "1" + "2" + "3" + "4" + ]; + rows = 1; + }; + effects = { + # desktopSwitching = { + # animation = "slide"; + # navigationWrapping = true; + # }; + minimization = { + animation = "magiclamp"; + duration = 500; + }; + shakeCursor.enable = true; + snapHelper.enable = true; + }; + }; + + configFile = { + # KDE has an automatic light-dark that CURRENTLY + # isn't supported by plasma-manager. + # kdeglobals.KDE.AutomaticLookAndFeel = true; + # DefaultDarkLookAndFeel = "Catppuccin-Flavor-Accent"; + # DefaultLightLookAndFeel = "Catppuccin-Flavor-Accent"; + kwinrc.Round-Corners.ActiveOutlinePalette = 2; + kwinrc.Round-Corners.ActiveOutlineUseCustom = false; + kwinrc.Round-Corners.ActiveOutlineUsePalette = true; + kwinrc.Round-Corners.ActiveSecondOutlinePalette = 2; + kwinrc.Round-Corners.ActiveSecondOutlineUseCustom = false; + kwinrc.Round-Corners.ActiveSecondOutlineUsePalette = true; + kwinrc.Round-Corners.InactiveOutlinePalette = 3; + kwinrc.Round-Corners.InactiveOutlineUseCustom = false; + kwinrc.Round-Corners.InactiveOutlineUsePalette = true; + kwinrc.Round-Corners.InactiveSecondOutlinePalette = 3; + kwinrc.Round-Corners.InactiveSecondOutlineUseCustom = false; + kwinrc.Round-Corners.InactiveSecondOutlineUsePalette = true; + plasmaparc.General.AudioFeedback = false; + kdeglobals.Sounds.Enable = false; + kwinrc.Plugins.forceblurEnabled = false; + kwinrc.Effect-blurplus.BlurDecorations = true; + kwinrc.Effect-blurplus.BlurMatching = false; + kwinrc.Effect-blurplus.BlurMenus = true; + kwinrc.Effect-blurplus.BlurNonMatching = true; + kwinrc.Effect-blurplus.TopCornerRadius = 10; + kwinrc.Effect-blurplus.BottomCornerRadius = 10; + kwinrc.Effect-blurplus.NoiseStrength = 6; + kwinrc.Effect-blurplus.RefractionStrength = 10; + ksplashrc.KSplash.Engine = "KSplashQML"; + }; + }; +} diff --git a/home/services/default.nix b/home/services/default.nix new file mode 100644 index 0000000..d38c136 --- /dev/null +++ b/home/services/default.nix @@ -0,0 +1,76 @@ +{ + config, + pkgs, + ... +}: +{ + imports = [ + ./gtk.nix + ./qt.nix + ./systemd.nix + ]; + + home.file = { + ".icons/default/index.theme" = { + text = '' + [Icon Theme] + Name=Default + Comment=Default Cursor Theme + Inherits=${config.userOptions.cursor.name} + ''; + force = true; + }; + }; + + home.pointerCursor = { + gtk.enable = true; + name = config.userOptions.cursor.name; + package = config.userOptions.cursor.package; + size = config.userOptions.cursor.size; + }; + + home.sessionVariables = { + QT_QPA_PLATFORMTHEME = "qt6ct"; + }; + + gtk = { + enable = true; + + # colorScheme = if config.userOptions.isDark then "dark" else "light"; + + # theme = { + # package = pkgs.kdePackages.breeze-gtk; + # name = + # if config.userOptions.isDark + # then "Breeze-Dark" + # else "Breeze"; + # }; + + # iconTheme = { + # name = if config.userOptions.isDark then "Colloid-Dark" else "Colloid-Light"; + # package = pkgs.colloid-icon-theme; + # }; + + colorScheme = "dark"; + iconTheme = { + name = "Colloid-Dark"; + package = pkgs.colloid-icon-theme; + }; + + cursorTheme = { + name = config.home.pointerCursor.name; + package = config.home.pointerCursor.package; + size = config.home.pointerCursor.size; + }; + + gtk3.extraConfig = { + gtk-application-prefer-dark-theme = true; + gtk-decoration-layout = ":"; + }; + + gtk4.extraConfig = { + gtk-application-prefer-dark-theme = true; + gtk-decoration-layout = ":"; + }; + }; +} diff --git a/home/services/gtk.nix b/home/services/gtk.nix new file mode 100644 index 0000000..d0b6422 --- /dev/null +++ b/home/services/gtk.nix @@ -0,0 +1,128 @@ +{ + config, + ... +}: +let + mkColorSection = name: value: "@define-color ${name} ${value};"; + + generateCSS = with config.scheme.withHashtag; '' + /* Kova's Nixified GTK */ + + /* Base colors */ + ${mkColorSection "window_bg_color" base00} + ${mkColorSection "window_fg_color" base05} + + /* View styling */ + ${mkColorSection "view_bg_color" base00} + ${mkColorSection "view_fg_color" base05} + + /* Header bar */ + ${mkColorSection "headerbar_bg_color" base10} + ${mkColorSection "headerbar_backdrop_color" base10} + ${mkColorSection "headerbar_fg_color" base05} + + /* Popovers and dialogs */ + ${mkColorSection "popover_bg_color" base00} + ${mkColorSection "popover_fg_color" base05} + @define-color dialog_bg_color @popover_bg_color; + @define-color dialog_fg_color @popover_fg_color; + + /* Cards and sidebars */ + ${mkColorSection "card_bg_color" base10} + ${mkColorSection "card_fg_color" base05} + ${mkColorSection "sidebar_bg_color" base10} + ${mkColorSection "sidebar_fg_color" base05} + @define-color sidebar_backdrop_color @sidebar_bg_color; + ${mkColorSection "sidebar_border_color" base01} + @define-color secondary_sidebar_bg_color @sidebar_bg_color; + @define-color secondary_sidebar_fg_color @sidebar_fg_color; + @define-color secondary_sidebar_backdrop_color @sidebar_backdrop_color; + @define-color secondary_sidebar_border_color @sidebar_border_color; + + /* Catppuccin accent colors */ + ${mkColorSection "blue_1" base0D} + ${mkColorSection "blue_2" base16} + ${mkColorSection "blue_3" base15} + ${mkColorSection "blue_4" base0C} + ${mkColorSection "blue_5" base07} + + ${mkColorSection "green_1" base0B} + ${mkColorSection "green_2" base0C} + ${mkColorSection "green_3" base15} + ${mkColorSection "green_4" base16} + ${mkColorSection "green_5" base0D} + + ${mkColorSection "yellow_1" base0A} + ${mkColorSection "yellow_2" base09} + ${mkColorSection "yellow_3" base0A} + ${mkColorSection "yellow_4" base08} + ${mkColorSection "yellow_5" base12} + + ${mkColorSection "orange_1" base09} + ${mkColorSection "orange_2" base08} + ${mkColorSection "orange_3" base12} + ${mkColorSection "orange_4" base0A} + ${mkColorSection "orange_5" base0B} + + ${mkColorSection "red_1" base08} + ${mkColorSection "red_2" base12} + ${mkColorSection "red_3" base17} + ${mkColorSection "red_4" base0F} + ${mkColorSection "red_5" base13} + + ${mkColorSection "purple_1" base0E} + ${mkColorSection "purple_2" base07} + ${mkColorSection "purple_3" base17} + ${mkColorSection "purple_4" base0F} + ${mkColorSection "purple_5" base13} + + ${mkColorSection "brown_1" base02} + ${mkColorSection "brown_2" base03} + ${mkColorSection "brown_3" base03} + ${mkColorSection "brown_4" base03} + ${mkColorSection "brown_5" base04} + + ${mkColorSection "light_1" base05} + ${mkColorSection "light_2" base04} + ${mkColorSection "light_3" base04} + ${mkColorSection "light_4" base0D} + ${mkColorSection "light_5" base03} + + ${mkColorSection "dark_1" base01} + ${mkColorSection "dark_2" base02} + ${mkColorSection "dark_3" base02} + ${mkColorSection "dark_4" base10} + ${mkColorSection "dark_5" base11} + + /* Custom rules */ + toast { + background-color: @window_bg_color; + color: @window_fg_color; + } + + toggle:checked { + background-color: @card_bg_color; + color: @window_fg_color; + } + + .inline { + background-color: rgba(0, 0, 0, 0); + } + + /* Accent */ + ${mkColorSection "accent_bg_color" config.scheme.withHashtag.${config.colors.accent}} + @define-color accent_fg_color @window_bg_color; + ''; +in +{ + home.file = { + ".config/gtk-4.0/gtk.css" = { + text = generateCSS; + force = true; + }; + ".config/gtk-3.0/gtk.css" = { + text = generateCSS; + force = true; + }; + }; +} diff --git a/home/services/qt.nix b/home/services/qt.nix new file mode 100644 index 0000000..6f322fc --- /dev/null +++ b/home/services/qt.nix @@ -0,0 +1,142 @@ +{ + config, + pkgs, + ... +}: +{ + home.packages = with pkgs; [ + kdePackages.qtstyleplugin-kvantum + themix-gui + kvmarwaita + ]; + + # home.file.".config/Kvantum" = { + # source = ./kvantum; + # recursive = true; + # force = true; + # }; + + # home.file.".config/Kvantum/kvantum.kvconfig" = { + # text = '' + # [General] + # theme= + # ''; + # force = true; + # }; + + qt = { + enable = true; + style = { + name = "kvantum"; + package = pkgs.qt6Packages.qtstyleplugin-kvantum; + }; + + qt5ctSettings = { + Appearance = { + style = "kvantum"; + icon_theme = config.gtk.iconTheme.name; + # color_scheme_path = "/home/${config.userOptions.username}/.config/qt5ct/qt5ct.conf"; + # custom_palette = true; + standard_dialogs = "xdgdesktopportal"; + }; + Fonts = config.qt.qt6ctSettings.Fonts; + ColorScheme = config.qt.qt6ctSettings.ColorScheme; + }; + + qt6ctSettings = { + Appearance = { + style = "kvantum"; + icon_theme = config.gtk.iconTheme.name; + # color_scheme_path = "/home/${config.userOptions.username}/.config/qt6ct/qt6ct.conf"; + # custom_palette = true; + standard_dialogs = "xdgdesktopportal"; + }; + + Fonts = { + fixed = "\"${config.userOptions.fontMono.name},${toString config.userOptions.fontMono.size}\""; + general = "\"${config.userOptions.fontSans.name},${toString config.userOptions.fontSans.size}\""; + }; + + ColorScheme = + with config.scheme; + let + accent = config.scheme.withHashtag.${config.colors.accent}; + mkColors = roles: builtins.concatStringsSep ", " (map (r: "#ff${r}") roles); + in + { + active_colors = mkColors [ + base05 + base01 + base02 + base01 + base00 + base10 + base05 + base05 + base05 + base00 + base10 + base11 + accent + base00 + accent + base0E + base10 + "000000" + base00 + base05 + base03 + accent + ]; + disabled_colors = mkColors [ + base03 + base01 + base02 + base01 + base03 + base10 + base03 + base05 + base03 + base01 + base01 + base10 + base03 + base05 + "0000ff" + "ff00ff" + base01 + "000000" + base01 + base00 + "80000000" + base03 + ]; + inactive_colors = mkColors [ + base05 + base01 + base02 + base01 + base00 + base10 + base05 + base05 + base05 + base00 + base10 + base11 + accent + base00 + accent + base0E + base10 + "000000" + base00 + base05 + base03 + accent + ]; + }; + }; + }; +} diff --git a/home/services/systemd.nix b/home/services/systemd.nix new file mode 100644 index 0000000..5dd3a94 --- /dev/null +++ b/home/services/systemd.nix @@ -0,0 +1,113 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + systemd.user.sessionVariables = { + XCURSOR_THEME = config.userOptions.cursor.name; + XCURSOR_SIZE = toString config.userOptions.cursor.size; + XCURSOR_PATH = config.userOptions.cursor.path; + }; + + xdg.configFile."rclone/synology.conf".text = '' + [synology] + type = sftp + user = sckova + host = nas.taila30609.ts.net + key_file = ~/.ssh/key + shell_type = unix + root = home + md5sum_command = "${pkgs.coreutils}/bin/md5sum"; + sha1sum_command = "${pkgs.coreutils}/bin/sha1sum"; + ''; + + systemd.user.services.synology-mount = { + Unit = { + Description = "Mount Synology NAS with Rclone and Home Manager."; + After = [ "tailscaled.service" ]; + Wants = [ "tailscaled.service" ]; + }; + + Service = { + Type = "simple"; + # ExecStartPre = "${pkgs.writeShellScript "synology-prep" '' + # if mountpoint -q %h/Synology; then + # /run/wrappers/bin/fusermount -uz %h/Synology + # fi + # ${pkgs.coreutils}/bin/mkdir -p %h/Synology + # ''}"; + ExecStart = "${pkgs.writeShellScript "synology-mount" '' + #!/usr/bin/env bash + set -euo pipefail + + # Ensure mount point exists + mkdir -p $HOME/Synology || true + + # Unmount stale mount if present + /run/wrappers/bin/umount "$HOME/Synology" || true + + # Mount rclone in foreground + ${pkgs.rclone}/bin/rclone \ + --config=$HOME/.config/rclone/synology.conf \ + --ignore-checksum \ + --log-level INFO \ + --rc --rc-serve \ + mount "synology:" "$HOME/Synology" + ''}"; + ExecStop = "/run/wrappers/bin/fusermount -uz %h/Synology/%i"; + StandardOutput = "journal"; + StandardError = "journal"; + }; + + Install = { + WantedBy = [ "default.target" ]; + }; + }; + + # systemd.user.services.synology-prefill = { + # Unit = { + # Description = "Prefill Synology NAS rclone cache"; + # After = [ "synology-mount.service" ]; + # Wants = [ "synology-mount.service" ]; + # }; + + # Service = { + # Type = "simple"; + # ExecStart = "${pkgs.writeShellScript "synology-prefill" '' + # #!/usr/bin/env bash + # set -euo pipefail + # ${pkgs.rclone}/bin/rclone rc vfs/refresh -v --fast-list recursive=true >/dev/null + # ''}"; + # StandardOutput = "journal"; + # StandardError = "journal"; + # Restart = "on-failure"; + # }; + + # Install = { + # WantedBy = [ "default.target" ]; + # }; + # }; + + # systemd.user.services.input-leap = { + # Unit = { + # Description = "Autostart Input Leap"; + # After = [ "graphical-session.target" ]; + # }; + + # Service = { + # Type = "oneshot"; + # RemainAfterExit = true; + # PassEnvironment = "DISPLAY"; + # ExecStart = "${pkgs.writeShellScript "input-leap-start" '' + # sleep 5 + # ${pkgs.input-leap}/bin/input-leap + # ''}"; + # }; + + # Install = { + # WantedBy = [ "graphical-session.target" ]; + # }; + # }; +} diff --git a/home/terminal/btop.conf b/home/terminal/btop.conf new file mode 100644 index 0000000..822f615 --- /dev/null +++ b/home/terminal/btop.conf @@ -0,0 +1,257 @@ +#? Config file for btop v. 1.4.5 + +#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. +#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" +color_theme = "nixos.theme" + +#* If the theme set background should be shown, set to False if you want terminal background transparency. +theme_background = True + +#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. +truecolor = True + +#* Set to true to force tty mode regardless if a real tty has been detected or not. +#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. +force_tty = False + +#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. +#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. +#* Use whitespace " " as separator between different presets. +#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" +presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" + +#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. +#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. +vim_keys = False + +#* Rounded corners on boxes, is ignored if TTY mode is ON. +rounded_corners = True + +#* Default symbols to use for graph creation, "braille", "block" or "tty". +#* "braille" offers the highest resolution but might not be included in all fonts. +#* "block" has half the resolution of braille but uses more common characters. +#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY. +#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view. +graph_symbol = "braille" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_cpu = "default" + +# Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty". +graph_symbol_gpu = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_mem = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_net = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_proc = "default" + +#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace. +shown_boxes = "cpu mem net proc" + +#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. +update_ms = 2000 + +#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", +#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. +proc_sorting = "cpu lazy" + +#* Reverse sorting order, True or False. +proc_reversed = False + +#* Show processes as a tree. +proc_tree = False + +#* Use the cpu graph colors in the process list. +proc_colors = True + +#* Use a darkening gradient in the process list. +proc_gradient = True + +#* If process cpu usage should be of the core it's running on or usage of the total available cpu power. +proc_per_core = False + +#* Show process memory as bytes instead of percent. +proc_mem_bytes = True + +#* Show cpu graph for each process. +proc_cpu_graphs = True + +#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) +proc_info_smaps = False + +#* Show proc box on left side of screen instead of right. +proc_left = False + +#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). +proc_filter_kernel = False + +#* In tree-view, always accumulate child process resources in the parent process. +proc_aggregate = False + +#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_upper = "Auto" + +#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_lower = "Auto" + +#* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off". +show_gpu_info = "Auto" + +#* Toggles if the lower CPU graph should be inverted. +cpu_invert_lower = True + +#* Set to True to completely disable the lower CPU graph. +cpu_single_graph = False + +#* Show cpu box at bottom of screen instead of top. +cpu_bottom = False + +#* Shows the system uptime in the CPU box. +show_uptime = True + +#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo. +show_cpu_watts = True + +#* Show cpu temperature. +check_temp = True + +#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. +cpu_sensor = "Auto" + +#* Show temperatures for cpu cores also if check_temp is True and sensors has been found. +show_coretemp = True + +#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. +#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. +#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries. +#* Example: "4:0 5:1 6:3" +cpu_core_map = "" + +#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine". +temp_scale = "celsius" + +#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. +base_10_sizes = True + +#* Show CPU frequency. +show_cpu_freq = True + +#* Draw a clock at top of screen, formatting according to strftime, empty string to disable. +#* Special formatting: /host = hostname | /user = username | /uptime = system uptime +clock_format = "%X" + +#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. +background_update = True + +#* Custom cpu model name, empty string to disable. +custom_cpu_name = "" + +#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ". +#* Only disks matching the filter will be shown. Prepend exclude= to only show disks not matching the filter. Examples: disk_filter="/boot /home/user", disks_filter="exclude=/boot /home/user" +disks_filter = "" + +#* Show graphs instead of meters for memory values. +mem_graphs = True + +#* Show mem box below net box instead of above. +mem_below_net = False + +#* Count ZFS ARC in cached and available memory. +zfs_arc_cached = True + +#* If swap memory should be shown in memory box. +show_swap = True + +#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. +swap_disk = True + +#* If mem box should be split to also show disks info. +show_disks = True + +#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. +only_physical = True + +#* Read disks list from /etc/fstab. This also disables only_physical. +use_fstab = True + +#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool) +zfs_hide_datasets = False + +#* Set to true to show available disk space for privileged users. +disk_free_priv = False + +#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. +show_io_stat = True + +#* Toggles io mode for disks, showing big graphs for disk read/write speeds. +io_mode = False + +#* Set to True to show combined read/write io graphs in io mode. +io_graph_combined = False + +#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". +#* Example: "/mnt/media:100 /:20 /boot:1". +io_graph_speeds = "" + +#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False. +net_download = 100 + +net_upload = 100 + +#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. +net_auto = True + +#* Sync the auto scaling for download and upload to whichever currently has the highest scale. +net_sync = True + +#* Starts with the Network Interface specified here. +net_iface = "" + +#* "True" shows bitrates in base 10 (Kbps, Mbps). "False" shows bitrates in binary sizes (Kibps, Mibps, etc.). "Auto" uses base_10_sizes. +base_10_bitrate = "Auto" + +#* Show battery stats in top right if battery is present. +show_battery = True + +#* Which battery to use if multiple are present. "Auto" for auto detection. +selected_battery = "Auto" + +#* Show power stats of battery next to charge indicator. +show_battery_watts = True + +#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". +#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. +log_level = "WARNING" + +#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards. +nvml_measure_pcie_speeds = True + +#* Measure PCIe throughput on AMD cards, may impact performance on certain cards. +rsmi_measure_pcie_speeds = True + +#* Horizontally mirror the GPU graph. +gpu_mirror_graph = True + +#* Custom gpu0 model name, empty string to disable. +custom_gpu_name0 = "" + +#* Custom gpu1 model name, empty string to disable. +custom_gpu_name1 = "" + +#* Custom gpu2 model name, empty string to disable. +custom_gpu_name2 = "" + +#* Custom gpu3 model name, empty string to disable. +custom_gpu_name3 = "" + +#* Custom gpu4 model name, empty string to disable. +custom_gpu_name4 = "" + +#* Custom gpu5 model name, empty string to disable. +custom_gpu_name5 = "" diff --git a/home/terminal/btop.nix b/home/terminal/btop.nix new file mode 100644 index 0000000..64d5fe1 --- /dev/null +++ b/home/terminal/btop.nix @@ -0,0 +1,110 @@ +{ + config, + pkgs, + ... +}: +let + btop-colors = with config.scheme.withHashtag; '' + # Credit to https://github.com/catppuccin/btop + # Main background, empty for terminal default, need to be empty if you want transparent background + theme[main_bg]="${base00}" + + # Main text color + theme[main_fg]="${base05}" + + # Title color for boxes + theme[title]="${base05}" + + # Highlight color for keyboard shortcuts + theme[hi_fg]="${base0D}" + + # Background color of selected item in processes box + theme[selected_bg]="${base02}" + + # Foreground color of selected item in processes box + theme[selected_fg]="${base0D}" + + # Color of inactive/disabled text + theme[inactive_fg]="${base03}" + + # Color of text appearing on top of graphs, i.e uptime and current network graph scaling + theme[graph_text]="${base06}" + + # Background color of the percentage meters + theme[meter_bg]="${base02}" + + # Misc colors for processes box including mini cpu graphs, details memory graph and details status text + theme[proc_misc]="${base06}" + + # CPU, Memory, Network, Proc box outline colors + theme[cpu_box]="${base0E}" #Mauve + theme[mem_box]="${base0B}" #Green + theme[net_box]="${base12}" #Maroon + theme[proc_box]="${base0D}" #Blue + + # Box divider line and small boxes line color + theme[div_line]="${base03}" + + # Temperature graph color (Green -> Yellow -> Red) + theme[temp_start]="${base0B}" + theme[temp_mid]="${base0A}" + theme[temp_end]="${base08}" + + # CPU graph colors (Teal -> Lavender) + theme[cpu_start]="${base0C}" + theme[cpu_mid]="${base16}" + theme[cpu_end]="${base07}" + + # Mem/Disk free meter (Mauve -> Lavender -> Blue) + theme[free_start]="${base0E}" + theme[free_mid]="${base07}" + theme[free_end]="${base0D}" + + # Mem/Disk cached meter (Sapphire -> Lavender) + theme[cached_start]="${base16}" + theme[cached_mid]="${base0D}" + theme[cached_end]="${base07}" + + # Mem/Disk available meter (Peach -> Red) + theme[available_start]="${base09}" + theme[available_mid]="${base12}" + theme[available_end]="${base08}" + + # Mem/Disk used meter (Green -> Sky) + theme[used_start]="${base0B}" + theme[used_mid]="${base0C}" + theme[used_end]="${base15}" + + # Download graph colors (Peach -> Red) + theme[download_start]="${base09}" + theme[download_mid]="${base12}" + theme[download_end]="${base08}" + + # Upload graph colors (Green -> Sky) + theme[upload_start]="${base0B}" + theme[upload_mid]="${base0C}" + theme[upload_end]="${base15}" + + # Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve) + theme[process_start]="${base16}" + theme[process_mid]="${base07}" + theme[process_end]="${base0E}" + ''; + + btop-colors-file = pkgs.writeTextFile { + name = "btop-colors"; + text = btop-colors; + destination = "/nixos.theme"; + }; + + mergedConfig = pkgs.runCommand "mergedConfig" { } '' + mkdir -p $out/themes + cp -r ${btop-colors-file}/nixos.theme $out/themes/nixos.theme + ''; +in +{ + home.file.".config/btop" = { + source = mergedConfig; + recursive = true; + }; +} diff --git a/home/terminal/default.nix b/home/terminal/default.nix new file mode 100644 index 0000000..379f1df --- /dev/null +++ b/home/terminal/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./btop.nix + ./fish.nix + ./kitty.nix + ./neovim.nix + ]; +} diff --git a/home/terminal/fish.nix b/home/terminal/fish.nix new file mode 100644 index 0000000..ca784f0 --- /dev/null +++ b/home/terminal/fish.nix @@ -0,0 +1,62 @@ +{ + pkgs, + config, + lib, + ... +}: +{ + home.packages = with pkgs; [ + kdePackages.qttools + eza + pigz + ]; + + programs.fish = { + enable = true; + shellAliases = { + ssh = "kitty-ssh"; + cat = "bat"; + gzip = "pigz"; + ls = "eza"; + gl = "git log"; + gd = "git diff"; + ga = "git add -v ."; + gac = "git add -v . && git commit"; + gaca = "git add -v . && git commit --amend --no-edit"; + gp = "git push"; + gpf = "git push --force"; + }; + functions = { + fish_prompt = { + description = "Write out the prompt"; + body = builtins.readFile ./fish_functions/fish-prompt.fish; + }; + kitty-ssh = { + description = "Integrate Kitten SSH with Fish"; + body = builtins.readFile ./fish_functions/kitty-ssh.fish; + }; + nix-shell = { + description = "Wrapper for nix-shell that runs fish by default"; + body = builtins.readFile ./fish_functions/nix-shell.fish; + }; + logout = { + description = "Log out of KDE Plasma"; + body = builtins.readFile ./fish_functions/logout.fish; + }; + }; + }; + + home.file.".config/fish/colors.fish" = { + text = lib.concatStringsSep "\n" ( + lib.mapAttrsToList (name: value: "set -g color_${name} ${value}") ( + lib.filterAttrs ( + n: v: builtins.isString v && builtins.match "^base[0-9A-Fa-f]{2}$" n != null + ) config.scheme + ) + ++ [ "set -g color_accent ${config.scheme.${config.colors.accent}}" ] + ); + force = true; + }; + + programs.man.generateCaches = false; +} diff --git a/home/terminal/fish_functions/fish-prompt.fish b/home/terminal/fish_functions/fish-prompt.fish new file mode 100644 index 0000000..2f4fca7 --- /dev/null +++ b/home/terminal/fish_functions/fish-prompt.fish @@ -0,0 +1,28 @@ +source ~/.config/fish/colors.fish +set -l last_status $status +set -l nix_shell_info ( + if test -n "$IN_NIX_SHELL" + echo -n " " + end +) +set -g color_user cyan +set -g color_host red +set -g color_cwd green + +# Set host color based on hostname +if test (hostname) = peach + set -g color_host $color_accent +else if test (hostname) = alien + set -g color_host $color_accent +else if test (hostname) = vm + set -g color_host $color_accent + set -g color_cwd normal +else if test (uname) = Darwin + set -g color_host $color_base0A +end + +set -l user_host (set_color $color_user)"$USER"(set_color normal)"@"(set_color $color_host)(prompt_hostname)(set_color normal) +set -l cwd (set_color $color_cwd)(prompt_pwd)(set_color normal) +set -l git_info (fish_git_prompt) +echo -s "$user_host" " " "$cwd" "$git_info $nix_shell_info" +echo -n -s "> " diff --git a/home/terminal/fish_functions/kitty-ssh.fish b/home/terminal/fish_functions/kitty-ssh.fish new file mode 100644 index 0000000..bfb1e77 --- /dev/null +++ b/home/terminal/fish_functions/kitty-ssh.fish @@ -0,0 +1,5 @@ +if set -q KITTY_WINDOW_ID + kitty +kitten ssh $argv +else + command ssh $argv +end diff --git a/home/terminal/fish_functions/logout.fish b/home/terminal/fish_functions/logout.fish new file mode 100644 index 0000000..9dcc3e0 --- /dev/null +++ b/home/terminal/fish_functions/logout.fish @@ -0,0 +1,5 @@ +if status is-login + builtin exit +else + /run/current-system/sw/bin/qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logout +end diff --git a/home/terminal/fish_functions/nix-shell.fish b/home/terminal/fish_functions/nix-shell.fish new file mode 100644 index 0000000..588e4a1 --- /dev/null +++ b/home/terminal/fish_functions/nix-shell.fish @@ -0,0 +1,5 @@ +if test (count $argv) -eq 0 + command nix-shell --run fish +else + command nix-shell --run fish $argv +end diff --git a/home/terminal/kitty.nix b/home/terminal/kitty.nix new file mode 100644 index 0000000..b6525dc --- /dev/null +++ b/home/terminal/kitty.nix @@ -0,0 +1,141 @@ +{ + config, + pkgs, + ... +}: +let + # Map Catppuccin colors to Kitty theme structure + kitty-colors = with config.scheme.withHashtag; '' + # vim:ft=kitty + ## name: Kova's Nixified Kitty + ## author: Catppuccin Org & sckova + ## license: MIT + ## upstream: https://github.com/catppuccin/kitty + ## blurb: The theme generated from the NixOS configuration! + + # The basic colors + foreground ${base05} + background ${base00} + selection_foreground ${base00} + selection_background ${base06} + + # Cursor colors + cursor ${base06} + cursor_text_color ${base00} + + # URL underline color when hovering with mouse + url_color ${base06} + + # Kitty window border colors + active_border_color ${config.scheme.withHashtag.${config.colors.accent}} + inactive_border_color ${base01} + bell_border_color ${base12} + + # Tab bar colors + active_tab_foreground ${base11} + active_tab_background ${config.scheme.withHashtag.${config.colors.accent}} + inactive_tab_foreground ${base05} + inactive_tab_background ${base10} + tab_bar_background ${base11} + + # Colors for marks (marked text in the terminal) + mark1_foreground ${base00} + mark1_background ${base09} + mark2_foreground ${base00} + mark2_background ${base0D} + mark3_foreground ${base00} + mark3_background ${base15} + + # The 16 terminal colors + # black + color0 ${base02} + color8 ${base02} + + # red + color1 ${base08} + color9 ${base08} + + # green + color2 ${base0B} + color10 ${base0B} + + # yellow + color3 ${base0A} + color11 ${base0A} + + # blue + color4 ${base0D} + color12 ${base0D} + + # magenta + color5 ${base17} + color13 ${base17} + + # cyan + color6 ${base0C} + color14 ${base0C} + + # white + color7 ${base04} + color15 ${base04} + ''; + + kitty-colors-file = pkgs.writeTextFile { + name = "kitty-colors"; + text = kitty-colors; + destination = "/kitty-colors.conf"; + }; +in +{ + home.file.".config/kitty/themes" = { + source = kitty-colors-file; + recursive = true; + }; + + home.file.".config/kitty/ssh.conf" = { + text = '' + shell_integration inherited + ''; + }; + + programs = { + kitty = { + enable = true; + enableGitIntegration = true; + font = { + name = config.userOptions.fontMono.name; + size = config.userOptions.fontMono.size; + }; + shellIntegration.enableFishIntegration = true; + keybindings = { + "ctrl+k" = "combine : clear_terminal scroll active : clear_terminal scrollback active"; + }; + settings = { + include = "/home/${config.userOptions.username}/.config/kitty/themes/kitty-colors.conf"; + scrollback_lines = 10000; + wheel_scroll_multiplier = 5.0; + touch_scroll_multiplier = 5.0; + enable_audio_bell = false; + update_check_interval = 0; + confirm_os_window_close = 0; + window_padding_width = 4; + tab_bar_min_tabs = 2; + tab_bar_edge = "top"; + tab_bar_style = "powerline"; + tab_powerline_style = "slanted"; + mouse_hide_wait = "-1.0"; + wayland_titlebar_color = "system"; + macos_titlebar_color = "system"; + }; + }; + bat = { + enable = true; + # config.theme = "Catppuccin ${config.catppuccinUpper.flavor}"; + }; + lazygit = { + enable = true; + enableFishIntegration = true; + }; + lazysql.enable = true; + }; +} diff --git a/home/terminal/neovim.nix b/home/terminal/neovim.nix new file mode 100644 index 0000000..65ace66 --- /dev/null +++ b/home/terminal/neovim.nix @@ -0,0 +1,342 @@ +{ + pkgs, + config, + ... +}: +{ + home.sessionVariables = { + EDITOR = "nvim"; + }; + + home.packages = with pkgs; [ + kdePackages.qtdeclarative + prettier + prettierd + nixfmt + stylua + black + clang-tools + ]; + + programs.nixvim = { + enable = true; + enablePrintInit = true; + defaultEditor = true; + waylandSupport = true; + viAlias = true; + vimAlias = true; + clipboard = { + register = "unnamedplus"; + providers.wl-copy.enable = true; + }; + opts = { + tabstop = 2; + softtabstop = 2; + shiftwidth = 2; + expandtab = true; + number = true; + }; + colorschemes.palette = { + enable = true; + settings = { + palettes = { + main = "base16_custom"; + accent = "base16_custom"; + state = "base16_custom"; + }; + + # this is helpful for figuring out what color is what: + # https://github.com/tinted-theming/schemes/blob/spec-0.11/base24/catppuccin-frappe.yaml + custom_palettes = with config.scheme.withHashtag; { + main.base16_custom = { + color0 = base00; # background + color1 = base01; # lighter background + color2 = base02; # selection background + color3 = base03; # color inside ${} + color4 = base04; # dark foreground + color5 = config.scheme.withHashtag.${config.colors.accent}; # default foreground, left side of assignments + color6 = base03; # comments + color7 = base07; # lightest foreground + color8 = base05; # variables/tags + }; + + accent.base16_custom = { + accent0 = base08; # red, integers/constants + accent1 = base0A; # orange, classes/search + accent2 = base0A; # yellow, strings/inherited + accent3 = base0B; # green, support/regex + accent4 = base0D; # blue, functions/headings + accent5 = base0E; # purple, keywords/bold + accent6 = base07; # lavender, deprecated/embedded + }; + + state.base16_custom = { + error = base08; # red + warning = base0A; # yellow + hint = base0C; # cyan + ok = base0B; # green + info = base0D; # blue + }; + }; + }; + }; + + keymaps = [ + # --- Normal mode mappings --- + { + mode = "n"; + key = ""; + action = "\"+y"; + options = { + noremap = true; + silent = true; + }; + } + { + mode = "n"; + key = ""; + action = "\"+p"; + options = { + noremap = true; + silent = true; + }; + } + + # --- Visual mode mappings --- + { + mode = "v"; + key = ""; + action = "\"+y"; + options = { + noremap = true; + silent = true; + }; + } + { + mode = "v"; + key = ""; + action = "\"+p"; + options = { + noremap = true; + silent = true; + }; + } + ]; + plugins = { + nvim-autopairs = { + enable = true; + }; + cmp = { + enable = true; + settings = { + autoEnableSources = true; + performance = { + debounce = 60; + fetchingTimeout = 200; + maxViewEntries = 30; + }; + mapping = { + __raw = '' + cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), + }) + ''; + }; + snippet = { + expand = "luasnip"; + }; + formatting = { + fields = [ + "kind" + "abbr" + "menu" + ]; + }; + sources = [ + { name = "git"; } + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + { name = "fish"; } + { name = "emoji"; } + { + name = "buffer"; # text within current buffer + option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; + keywordLength = 3; + } + { name = "copilot"; } + { + name = "path"; # file system paths + keywordLength = 3; + } + { + name = "luasnip"; # snippets + keywordLength = 3; + } + ]; + }; + }; + conform-nvim = { + enable = true; + settings = { + formatters_by_ft = { + lua = [ "stylua" ]; + python = [ "black" ]; + nix = [ "nixfmt" ]; + html = [ "prettier" ]; + javascript = [ "prettier" ]; + css = [ "prettier" ]; + json = [ "prettier" ]; + jsonc = [ "prettier" ]; + fish = [ "fish_indent" ]; + c = [ "clang-format" ]; + cpp = [ "clang-format" ]; + }; + + # Default formatting options + default_format_opts = { + lsp_format = "fallback"; + }; + + # Format-on-save behavior + format_on_save = { + timeout_ms = 500; + }; + + # Custom formatter settings + formatters = { + shfmt = { + append_args = [ + "-i" + "2" + ]; + }; + }; + }; + }; + fzf-lua = { + enable = true; + }; + kitty-scrollback = { + enable = true; + }; + lsp = { + enable = true; + servers = { + qmlls = { + enable = true; + cmd = [ + "qmlls" + "-E" + ]; + }; + nixd.enable = true; + }; + }; + lualine = with config.scheme.withHashtag; { + enable = true; + settings = { + options = { + theme = { + normal = { + a = { + fg = base00; + bg = base0E; + }; + b = { + fg = base05; + bg = base01; + }; + c = { + fg = base05; + }; + }; + insert = { + a = { + fg = base00; + bg = base0D; + }; + }; + visual = { + a = { + fg = base00; + bg = base0C; + }; + }; + replace = { + a = { + fg = base00; + bg = base08; + }; + }; + inactive = { + a = { + fg = base05; + bg = base00; + }; + b = { + fg = base05; + bg = base00; + }; + c = { + fg = base05; + }; + }; + }; + component_separators = ""; + section_separators = { + left = ""; + right = ""; + }; + }; + + sections = { + lualine_a = [ + { + __unkeyed-1 = "mode"; + separator = { + left = " "; + }; + right_padding = 2; + } + ]; + lualine_b = [ + "filename" + "branch" + ]; + lualine_c = [ "%=" ]; + lualine_x = [ ]; + lualine_y = [ + "filetype" + "progress" + ]; + lualine_z = [ + { + __unkeyed-1 = "location"; + separator = { + right = " "; + }; + left_padding = 2; + } + ]; + }; + + inactive_sections = { + lualine_a = [ "filename" ]; + lualine_b = [ ]; + lualine_c = [ ]; + lualine_x = [ ]; + lualine_y = [ ]; + lualine_z = [ "location" ]; + }; + tabline = { }; + extensions = [ ]; + }; + }; + }; + }; +} diff --git a/home/tiling/default.nix b/home/tiling/default.nix new file mode 100644 index 0000000..985b5fa --- /dev/null +++ b/home/tiling/default.nix @@ -0,0 +1,121 @@ +{ pkgs, config, ... }: +{ + imports = [ + ./niri.nix + ./noctalia.nix + ./wallpaper.nix + ]; + + home.packages = with pkgs; [ + xdg-desktop-portal + brightnessctl + qt6Packages.qt6ct + libsForQt5.qt5ct + catppuccin-qt5ct + xwayland-satellite + playerctl + ]; + + programs.fuzzel = { + enable = true; + package = pkgs.fuzzel; + settings = { + main = { + terminal = "${pkgs.kitty}/bin/kitty"; + layer = "overlay"; + font = with config.userOptions.fontMono; name + ":size=" + toString (size + 2); + launch-prefix = "${pkgs.niri}/bin/niri msg action spawn --"; + icon-theme = "Colloid-Dark"; + }; + border = { + width = 2; + radius = 8; + }; + colors = with config.scheme; { + background = base00 + "ff"; + text = base05 + "ff"; + prompt = base04 + "ff"; + placeholder = base04 + "ff"; + input = base05 + "ff"; + match = config.scheme.withHashtag.${config.colors.accent} + "ff"; + selection = base04 + "ff"; + selection-text = base00 + "ff"; + counter = base04 + "ff"; + border = config.scheme.withHashtag.${config.colors.accent} + "ff"; + }; + }; + }; + + xsession = { + enable = true; + windowManager.command = "niri"; + }; + + xdg.mimeApps = { + enable = true; + associations.added = { + "x-scheme-handler/http" = [ "firefox.desktop" ]; + "x-scheme-handler/https" = [ "firefox.desktop" ]; + "x-scheme-handler/discord" = [ "vesktop.desktop" ]; + "x-scheme-handler/spotify" = [ "riff.desktop" ]; + "inode/directory" = [ "org.gnome.Nautilus.desktop" ]; + "image/png" = [ "loupe.desktop" ]; + "image/jpeg" = [ "loupe.desktop" ]; + }; + defaultApplications = { + # Web + "x-scheme-handler/http" = [ "firefox.desktop" ]; + "x-scheme-handler/https" = [ "firefox.desktop" ]; + "text/html" = [ "firefox.desktop" ]; + + # Communication & Social + "x-scheme-handler/discord" = [ "vesktop.desktop" ]; + "x-scheme-handler/spotify" = [ "riff.desktop" ]; + + # File Management + "inode/directory" = [ "org.gnome.Nautilus.desktop" ]; + + # Torrents + "application/x-bittorrent" = [ "org.qbittorrent.qBittorrent.desktop" ]; + "x-scheme-handler/magnet" = [ "org.qbittorrent.qBittorrent.desktop" ]; + + # Documents + "application/pdf" = [ "firefox.desktop" ]; # Or libreoffice-draw.desktop + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = [ + "libreoffice-writer.desktop" + ]; # docx + "application/msword" = [ "libreoffice-writer.desktop" ]; # doc + "application/vnd.oasis.opendocument.text" = [ "libreoffice-writer.desktop" ]; # odt + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = [ + "libreoffice-calc.desktop" + ]; # xlsx + "application/vnd.ms-excel" = [ "libreoffice-calc.desktop" ]; # xls + "application/vnd.oasis.opendocument.spreadsheet" = [ "libreoffice-calc.desktop" ]; # ods + + # Text & Code + "text/plain" = [ "nvim.desktop" ]; + "text/markdown" = [ "nvim.desktop" ]; + "application/x-shellscript" = [ "nvim.desktop" ]; + "application/json" = [ "nvim.desktop" ]; + "text/x-c" = [ "nvim.desktop" ]; + "text/x-c++" = [ "nvim.desktop" ]; + "text/x-python" = [ "nvim.desktop" ]; + "text/x-makefile" = [ "nvim.desktop" ]; + + # Media + "video/mp4" = [ "mpv.desktop" ]; + "video/mkv" = [ "mpv.desktop" ]; + "video/webm" = [ "mpv.desktop" ]; + "audio/mpeg" = [ "mpv.desktop" ]; + "audio/flac" = [ "mpv.desktop" ]; + "audio/wav" = [ "mpv.desktop" ]; + + # Images + "image/png" = [ "loupe.desktop" ]; + "image/jpeg" = [ "loupe.desktop" ]; + "image/webp" = [ "loupe.desktop" ]; + "image/gif" = [ "loupe.desktop" ]; + }; + }; + +} diff --git a/home/tiling/niri.nix b/home/tiling/niri.nix new file mode 100644 index 0000000..470b1a2 --- /dev/null +++ b/home/tiling/niri.nix @@ -0,0 +1,543 @@ +{ + config, + pkgs, + ... +}: +{ + # https://github.com/sodiboo/niri-flake/blob/main/docs.md + programs.niri = with config.scheme.withHashtag; { + # handle package systemwide + package = null; + + settings = { + environment = { + QT_QPA_PLATFORM = "wayland"; + QT_QPA_PLATFORMTHEME = "qt6ct"; + DISPLAY = ":0"; + XCURSOR_THEME = config.userOptions.cursor.name; + XCURSOR_SIZE = toString config.userOptions.cursor.size; + }; + screenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; + hotkey-overlay.skip-at-startup = true; + prefer-no-csd = true; + gestures.hot-corners.enable = false; + spawn-at-startup = [ ]; # systemd is based sorry + overview = { + backdrop-color = base11; + workspace-shadow.enable = false; + }; + input = { + focus-follows-mouse.enable = true; + focus-follows-mouse.max-scroll-amount = "0%"; + warp-mouse-to-focus.enable = true; + mod-key = "Super"; + keyboard = { + numlock = false; + repeat-delay = 600; + repeat-rate = 25; + }; + mouse = { + enable = true; + accel-profile = "adaptive"; + natural-scroll = false; + }; + touchpad = { + enable = true; + accel-profile = "adaptive"; + natural-scroll = true; + tap = false; + drag = false; + }; + }; + outputs = { + "eDP-1" = { + scale = 1.5; + position = { + x = 272; + y = 1440; + }; + }; + "HDMI-A-1" = { + mode = { + width = 3840; + height = 2160; + refresh = 144.000; + }; + scale = 1.5; + position = { + x = 0; + y = 0; + }; + }; + "DP-1" = { + mode = { + width = 3840; + height = 2160; + refresh = 143.999; + }; + scale = 1.5; + position = { + x = 0; + y = 0; + }; + }; + }; + cursor = { + hide-when-typing = false; + # hide-after-inactive-ms = 10000; + size = config.userOptions.cursor.size; + theme = config.userOptions.cursor.name; + }; + layout = { + gaps = 4; + # background-color = base10; + background-color = "transparent"; + default-column-width = { + proportion = 0.5; + }; + preset-column-widths = [ + { proportion = 4.0 / 12.0; } + { proportion = 6.0 / 12.0; } + { proportion = 8.0 / 12.0; } + ]; + border = { + enable = true; + width = 2; + active.color = config.scheme.withHashtag.${config.colors.accent}; + inactive.color = base01; + urgent.color = base12; + }; + focus-ring = { + enable = false; + width = 2; + active.color = config.scheme.withHashtag.${config.colors.accent}; + inactive.color = base01; + urgent.color = base12; + }; + shadow = { + enable = true; + spread = 10; + offset.x = 0; + offset.y = 0; + softness = 30; + color = base11 + "BF"; + }; + # blur = { + # enable = true; + # passes = 4; + # radius = 4; + # noise = 0.1; + # }; + }; + window-rules = [ + { + geometry-corner-radius = { + top-left = 8.0; + top-right = 8.0; + bottom-left = 8.0; + bottom-right = 8.0; + }; + clip-to-geometry = true; + opacity = 1.0; + } + { + matches = [ + { + app-id = "firefox$"; + title = "^Picture-in-Picture$"; + } + ]; + open-floating = true; + default-floating-position = { + x = 16; + y = 16; + relative-to = "bottom-left"; + }; + } + { + matches = [ + { + app-id = "vesktop$"; + } + ]; + block-out-from = "screen-capture"; + } + { + matches = [ + { + app-id = "openmw"; + title = "OpenMW"; + } + { + app-id = "Minecraft"; + title = "Minecraft"; + } + ]; + open-maximized = true; + open-focused = true; + } + ]; + layer-rules = [ + { + matches = [ + { + namespace = "^wpaperd.*"; + } + ]; + place-within-backdrop = true; + } + ]; + binds = { + "Mod+Shift+Slash".action.show-hotkey-overlay = { }; + + "Mod+T" = { + action.spawn = [ "kitty" ]; + hotkey-overlay.title = "Open a Terminal: kitty"; + }; + "Mod+Space" = { + action.spawn = [ "fuzzel" ]; + hotkey-overlay.title = "Run an Application: Noctalia app launcher"; + }; + + "XF86AudioRaiseVolume" = { + action.spawn-sh = [ + "noctalia-shell ipc call volume increase" + ]; + allow-when-locked = true; + }; + "XF86AudioLowerVolume" = { + action.spawn-sh = [ + "noctalia-shell ipc call volume decrease" + ]; + allow-when-locked = true; + }; + + "Shift+XF86AudioRaiseVolume" = { + action.spawn = [ + "wpctl" + "set-volume" + "@DEFAULT_AUDIO_SINK@" + "0.01+" + ]; + allow-when-locked = true; + }; + "Shift+XF86AudioLowerVolume" = { + action.spawn = [ + "wpctl" + "set-volume" + "@DEFAULT_AUDIO_SINK@" + "0.01-" + ]; + allow-when-locked = true; + }; + + "MouseForward" = { + action.spawn-sh = [ + "noctalia-shell ipc call volume increase" + ]; + allow-when-locked = true; + }; + "MouseBack" = { + action.spawn-sh = [ + "noctalia-shell ipc call volume decrease" + ]; + allow-when-locked = true; + }; + + "Shift+MouseForward" = { + action.spawn = [ + "wpctl" + "set-volume" + "@DEFAULT_AUDIO_SINK@" + "0.01+" + ]; + allow-when-locked = true; + }; + "Shift+MouseBack" = { + action.spawn = [ + "wpctl" + "set-volume" + "@DEFAULT_AUDIO_SINK@" + "0.01-" + ]; + allow-when-locked = true; + }; + + "XF86AudioMute" = { + action.spawn-sh = [ + "noctalia-shell ipc call volume muteOutput" + ]; + allow-when-locked = true; + }; + "XF86AudioMicMute" = { + action.spawn-sh = [ + "noctalia-shell ipc call volume muteInput" + ]; + allow-when-locked = true; + }; + + "XF86MonBrightnessUp" = { + action.spawn = [ + "noctalia-shell" + "ipc" + "call" + "brightness" + "increase" + ]; + allow-when-locked = true; + }; + + "XF86MonBrightnessDown" = { + action.spawn = [ + "noctalia-shell" + "ipc" + "call" + "brightness" + "decrease" + ]; + allow-when-locked = true; + }; + + "Shift+XF86MonBrightnessUp" = { + action.spawn = [ + "brightnessctl" + "--class=backlight" + "set" + "+1%" + ]; + allow-when-locked = true; + }; + + "Shift+XF86MonBrightnessDown" = { + action.spawn = [ + "brightnessctl" + "--class=backlight" + "set" + "1%-" + ]; + allow-when-locked = true; + }; + + "XF86AudioPrev" = { + action.spawn = [ + "playerctl" + "previous" + ]; + allow-when-locked = true; + }; + + "XF86AudioPlay" = { + action.spawn = [ + "playerctl" + "play-pause" + ]; + allow-when-locked = true; + }; + + "XF86AudioNext" = { + action.spawn = [ + "playerctl" + "next" + ]; + allow-when-locked = true; + }; + + "XF86Sleep" = { + action.power-off-monitors = { }; + }; + + "XF86Search" = { + action.spawn = [ + "noctalia-shell" + "ipc" + "call" + "launcher" + "toggle" + ]; + allow-when-locked = true; + }; + + "XF86LaunchA" = { + action.spawn = [ + "niri" + "msg" + "action" + "toggle-overview" + ]; + allow-when-locked = true; + }; + + "Mod+O" = { + action.toggle-overview = { }; + repeat = false; + }; + + "Mod+Q" = { + action.close-window = { }; + repeat = false; + }; + + "Mod+Left".action.focus-column-left = { }; + "Mod+Down".action.focus-window-down = { }; + "Mod+Up".action.focus-window-up = { }; + "Mod+Right".action.focus-column-right = { }; + "Mod+H".action.focus-column-left = { }; + "Mod+J".action.focus-window-down = { }; + "Mod+K".action.focus-window-up = { }; + "Mod+L".action.focus-column-right = { }; + + "Mod+Ctrl+Left".action.move-column-left = { }; + "Mod+Ctrl+Down".action.move-window-down = { }; + "Mod+Ctrl+Up".action.move-window-up = { }; + "Mod+Ctrl+Right".action.move-column-right = { }; + "Mod+Ctrl+H".action.move-column-left = { }; + "Mod+Ctrl+J".action.move-window-down = { }; + "Mod+Ctrl+K".action.move-window-up = { }; + "Mod+Ctrl+L".action.move-column-right = { }; + + "Mod+Home".action.focus-column-first = { }; + "Mod+End".action.focus-column-last = { }; + "Mod+Ctrl+Home".action.move-column-to-first = { }; + "Mod+Ctrl+End".action.move-column-to-last = { }; + + "Mod+Shift+Left".action.focus-monitor-left = { }; + "Mod+Shift+Down".action.focus-monitor-down = { }; + "Mod+Shift+Up".action.focus-monitor-up = { }; + "Mod+Shift+Right".action.focus-monitor-right = { }; + "Mod+Shift+H".action.focus-monitor-left = { }; + "Mod+Shift+J".action.focus-monitor-down = { }; + "Mod+Shift+K".action.focus-monitor-up = { }; + "Mod+Shift+L".action.focus-monitor-right = { }; + + "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = { }; + "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = { }; + "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = { }; + "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = { }; + "Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = { }; + "Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = { }; + "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = { }; + "Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = { }; + + "Mod+Page_Down".action.focus-workspace-down = { }; + "Mod+Page_Up".action.focus-workspace-up = { }; + "Mod+U".action.focus-workspace-down = { }; + "Mod+I".action.focus-workspace-up = { }; + "Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = { }; + "Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = { }; + "Mod+Ctrl+U".action.move-column-to-workspace-down = { }; + "Mod+Ctrl+I".action.move-column-to-workspace-up = { }; + + "Mod+Shift+Page_Down".action.move-workspace-down = { }; + "Mod+Shift+Page_Up".action.move-workspace-up = { }; + "Mod+Shift+U".action.move-workspace-down = { }; + "Mod+Shift+I".action.move-workspace-up = { }; + + "Mod+WheelScrollDown" = { + action.focus-workspace-down = { }; + cooldown-ms = 150; + }; + "Mod+WheelScrollUp" = { + action.focus-workspace-up = { }; + cooldown-ms = 150; + }; + "Mod+Ctrl+WheelScrollDown" = { + action.move-column-to-workspace-down = { }; + cooldown-ms = 150; + }; + "Mod+Ctrl+WheelScrollUp" = { + action.move-column-to-workspace-up = { }; + cooldown-ms = 150; + }; + + "Mod+WheelScrollRight".action.focus-column-right = { }; + "Mod+WheelScrollLeft".action.focus-column-left = { }; + "Mod+Ctrl+WheelScrollRight".action.move-column-right = { }; + "Mod+Ctrl+WheelScrollLeft".action.move-column-left = { }; + + "Mod+Shift+WheelScrollDown".action.focus-column-right = { }; + "Mod+Shift+WheelScrollUp".action.focus-column-left = { }; + "Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = { }; + "Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = { }; + + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + "Mod+Ctrl+1".action.move-column-to-workspace = 1; + "Mod+Ctrl+2".action.move-column-to-workspace = 2; + "Mod+Ctrl+3".action.move-column-to-workspace = 3; + "Mod+Ctrl+4".action.move-column-to-workspace = 4; + "Mod+Ctrl+5".action.move-column-to-workspace = 5; + "Mod+Ctrl+6".action.move-column-to-workspace = 6; + "Mod+Ctrl+7".action.move-column-to-workspace = 7; + "Mod+Ctrl+8".action.move-column-to-workspace = 8; + "Mod+Ctrl+9".action.move-column-to-workspace = 9; + + "Mod+BracketLeft".action.consume-or-expel-window-left = { }; + "Mod+BracketRight".action.consume-or-expel-window-right = { }; + + "Mod+Comma".action.consume-window-into-column = { }; + "Mod+Period".action.expel-window-from-column = { }; + + "Mod+R".action.switch-preset-column-width = { }; + "Mod+Shift+R".action.switch-preset-window-height = { }; + "Mod+Ctrl+R".action.reset-window-height = { }; + "Mod+F".action.maximize-column = { }; + "Mod+Shift+F".action.maximize-window-to-edges = { }; + "Mod+Ctrl+Shift+F".action.fullscreen-window = { }; + + "Mod+C".action.center-column = { }; + + "Mod+Ctrl+C".action.center-visible-columns = { }; + + "Mod+Minus".action.set-column-width = "-10%"; + "Mod+Equal".action.set-column-width = "+10%"; + + "Mod+Shift+Minus".action.set-window-height = "-10%"; + "Mod+Shift+Equal".action.set-window-height = "+10%"; + + "Mod+Ctrl+Minus".action.set-column-width = "-0.25%"; + "Mod+Ctrl+Equal".action.set-column-width = "+0.25%"; + + "Mod+Ctrl+Shift+Minus".action.set-window-height = "-0.25%"; + "Mod+Ctrl+Shift+Equal".action.set-window-height = "+0.25%"; + + "Mod+V".action.toggle-window-floating = { }; + "Mod+Shift+V".action.switch-focus-between-floating-and-tiling = { }; + + "Mod+W".action.toggle-column-tabbed-display = { }; + + "Print".action.screenshot = { + show-pointer = false; + }; + "Mod+Shift+S".action.screenshot = { + show-pointer = false; + }; + "Ctrl+Print".action.screenshot-screen = { + show-pointer = false; + }; + "Alt+Print".action.screenshot-window = { + show-pointer = false; + }; + + "Mod+Escape" = { + action.toggle-keyboard-shortcuts-inhibit = { }; + allow-inhibiting = false; + }; + + "Mod+Shift+E".action.quit = { }; + "Ctrl+Alt+Delete".action.quit = { }; + + "Mod+Shift+P" = { + action.power-off-monitors = { }; + hotkey-overlay.title = "Turn off the display"; + }; + }; + }; + }; +} diff --git a/home/tiling/noctalia.nix b/home/tiling/noctalia.nix new file mode 100644 index 0000000..719dda0 --- /dev/null +++ b/home/tiling/noctalia.nix @@ -0,0 +1,620 @@ +{ + pkgs, + config, + ... +}: +{ + programs.noctalia-shell = { + enable = true; + colors = with config.scheme.withHashtag; { + mPrimary = config.scheme.withHashtag.${config.colors.accent}; + mOnPrimary = base00; + mSecondary = base13; + mOnSecondary = base00; + mTertiary = base04; + mOnTertiary = base00; + mError = base12; + mOnError = base00; + mSurface = base00; + mOnSurface = base05; + mSurfaceVariant = base01; + mOnSurfaceVariant = base05; + mOutline = base02; + mShadow = base00; + mHover = base04; + mOnHover = base00; + }; + settings = { + appLauncher = { + autoPasteClipboard = false; + clipboardWatchImageCommand = "wl-paste --type image --watch cliphist store"; + clipboardWatchTextCommand = "wl-paste --type text --watch cliphist store"; + clipboardWrapText = true; + customLaunchPrefix = ""; + customLaunchPrefixEnabled = false; + enableClipPreview = true; + enableClipboardHistory = true; + enableSettingsSearch = true; + enableWindowsSearch = true; + iconMode = "tabler"; + ignoreMouseInput = false; + overviewLayer = false; + pinnedApps = [ ]; + position = "top_left"; + screenshotAnnotationTool = ""; + showCategories = true; + showIconBackground = false; + sortByMostUsed = true; + terminalCommand = "kitty -e"; + useApp2Unit = false; + viewMode = "list"; + }; + + audio = { + cavaFrameRate = 30; + mprisBlacklist = [ ]; + preferredPlayer = ""; + visualizerType = "linear"; + volumeFeedback = false; + volumeOverdrive = false; + volumeStep = 5; + }; + + bar = { + autoHideDelay = 500; + autoShowDelay = 150; + backgroundOpacity = 1; + monitors = [ ]; + showCapsule = true; + barType = "simple"; + capsuleColorKey = "none"; + capsuleOpacity = 1; + displayMode = "always_visible"; + floating = false; + marginHorizontal = 5; + marginVertical = 5; + frameRadius = 12; + frameThickness = 8; + hideOnOverview = false; + outerCorners = false; + screenOverrides = [ ]; + showOutline = false; + useSeparateOpacity = false; + widgets = { + center = [ ]; + left = [ + { + colorizeSystemIcon = "none"; + enableColorization = true; + hideMode = "alwaysExpanded"; + icon = "rocket"; + id = "CustomButton"; + ipcIdentifier = ""; + leftClickExec = "niri msg action spawn -- fuzzel"; + leftClickUpdateText = false; + maxTextLength = { + horizontal = 10; + vertical = 10; + }; + middleClickExec = ""; + middleClickUpdateText = false; + parseJson = false; + rightClickExec = ""; + rightClickUpdateText = false; + showIcon = true; + textCollapse = ""; + textCommand = ""; + textIntervalMs = 3000; + textStream = false; + wheelDownExec = ""; + wheelDownUpdateText = false; + wheelExec = ""; + wheelMode = "unified"; + wheelUpExec = ""; + wheelUpUpdateText = false; + wheelUpdateText = false; + } + { + characterCount = 2; + colorizeIcons = false; + emptyColor = "secondary"; + enableScrollWheel = true; + focusedColor = "primary"; + followFocusedScreen = false; + groupedBorderOpacity = 1; + hideUnoccupied = true; + iconScale = 0.6; + id = "Workspace"; + labelMode = "index"; + occupiedColor = "secondary"; + pillSize = 0.6; + reverseScroll = false; + showApplications = true; + showBadge = true; + showLabelsOnlyWhenOccupied = true; + unfocusedIconsOpacity = 1; + } + { + compactMode = true; + diskPath = "/"; + iconColor = "none"; + id = "SystemMonitor"; + showCpuFreq = false; + showCpuTemp = false; + showCpuUsage = true; + showDiskAvailable = false; + showDiskUsage = true; + showDiskUsageAsPercent = false; + showGpuTemp = false; + showLoadAverage = false; + showMemoryAsPercent = true; + showMemoryUsage = true; + showNetworkStats = false; + showSwapUsage = false; + textColor = "none"; + useMonospaceFont = true; + } + { + colorizeIcons = false; + hideMode = "hidden"; + id = "ActiveWindow"; + maxWidth = 600; + scrollingMode = "always"; + showIcon = true; + textColor = "none"; + useFixedWidth = false; + } + ]; + right = [ + { + compactMode = false; + compactShowAlbumArt = true; + compactShowVisualizer = false; + hideMode = "hidden"; + hideWhenIdle = false; + id = "MediaMini"; + maxWidth = 380; + panelShowAlbumArt = true; + panelShowVisualizer = true; + scrollingMode = "hover"; + showAlbumArt = false; + showArtistFirst = false; + showProgressRing = true; + showVisualizer = false; + textColor = "none"; + useFixedWidth = false; + visualizerType = "linear"; + } + { + blacklist = [ ]; + chevronColor = "none"; + colorizeIcons = true; + drawerEnabled = false; + hidePassive = false; + id = "Tray"; + pinned = [ ]; + } + { + hideWhenZero = false; + hideWhenZeroUnread = true; + iconColor = "none"; + id = "NotificationHistory"; + showUnreadBadge = true; + unreadBadgeColor = "primary"; + } + { + deviceNativePath = "__default__"; + displayMode = "icon-hover"; + hideIfIdle = false; + hideIfNotDetected = false; + id = "Battery"; + showNoctaliaPerformance = false; + showPowerProfiles = true; + } + { + displayMode = "onhover"; + iconColor = "none"; + id = "Volume"; + middleClickCommand = "pwvucontrol || pavucontrol"; + textColor = "none"; + } + { + displayMode = "onhover"; + iconColor = "none"; + id = "Brightness"; + textColor = "none"; + } + { + colorizeDistroLogo = false; + colorizeSystemIcon = "none"; + customIconPath = ""; + enableColorization = false; + icon = "noctalia"; + id = "ControlCenter"; + useDistroLogo = false; + } + { + clockColor = "none"; + customFont = ""; + formatHorizontal = "ddd MMM dd yyyy @ h:mm AP"; + formatVertical = "HH mm - dd MM"; + id = "Clock"; + tooltipFormat = "HH:mm ddd, MMM dd"; + useCustomFont = false; + } + ]; + }; + }; + + brightness = { + brightnessStep = 5; + enforceMinimum = false; + }; + + calendar = { + cards = [ + { + enabled = true; + id = "calendar-header-card"; + } + { + enabled = true; + id = "calendar-month-card"; + } + { + enabled = true; + id = "weather-card"; + } + { + enabled = true; + id = "timer-card"; + } + ]; + }; + + colorSchemes = { + darkMode = true; + generationMethod = "tonal-spot"; + manualSunrise = "06:30"; + manualSunset = "18:30"; + monitorForColors = ""; + predefinedScheme = "Noctalia (default)"; + schedulingMode = "off"; + useWallpaperColors = false; + }; + + controlCenter = { + cards = [ + { + enabled = true; + id = "profile-card"; + } + { + enabled = true; + id = "shortcuts-card"; + } + { + enabled = true; + id = "audio-card"; + } + { + enabled = true; + id = "media-sysmon-card"; + } + ]; + diskPath = "/"; + position = "close_to_bar_button"; + shortcuts = { + left = [ + { id = "Network"; } + { id = "Bluetooth"; } + { id = "WallpaperSelector"; } + ]; + right = [ + { id = "Notifications"; } + { id = "PowerProfile"; } + { id = "KeepAwake"; } + { id = "NightLight"; } + ]; + }; + }; + + desktopWidgets = { + enabled = false; + gridSnap = false; + monitorWidgets = [ ]; + }; + + dock = { + animationSpeed = 1; + backgroundOpacity = 1; + colorizeIcons = false; + deadOpacity = 0.6; + displayMode = "auto_hide"; + enabled = false; + floatingRatio = 1; + inactiveIndicators = false; + monitors = [ ]; + onlySameOutput = true; + pinnedApps = [ ]; + pinnedStatic = false; + position = "bottom"; + size = 1; + }; + + general = { + allowPanelsOnScreenWithoutBar = true; + allowPasswordWithFprintd = false; + animationDisabled = false; + animationSpeed = 1; + autoStartAuth = false; + avatarImage = "/home/sckova/.face"; + boxRadiusRatio = 1; + clockFormat = "hh\\nmm"; + clockStyle = "custom"; + compactLockScreen = false; + dimmerOpacity = 0.5; + enableLockScreenCountdown = true; + enableShadows = false; + forceBlackScreenCorners = false; + iRadiusRatio = 1; + language = ""; + lockOnSuspend = true; + lockScreenAnimations = false; + lockScreenCountdownDuration = 10000; + lockScreenMonitors = [ ]; + radiusRatio = 1; + scaleRatio = 1; + screenRadiusRatio = 1; + shadowDirection = "bottom_right"; + shadowOffsetX = 2; + shadowOffsetY = 3; + showChangelogOnStartup = true; + showHibernateOnLockScreen = false; + showScreenCorners = false; + showSessionButtonsOnLockScreen = true; + telemetryEnabled = false; + }; + + hooks = { + darkModeChange = ""; + enabled = false; + performanceModeDisabled = ""; + performanceModeEnabled = ""; + screenLock = ""; + screenUnlock = ""; + session = ""; + startup = ""; + wallpaperChange = ""; + }; + + location = { + analogClockInCalendar = false; + firstDayOfWeek = -1; + hideWeatherCityName = false; + hideWeatherTimezone = false; + name = "Atlanta, US"; + showCalendarEvents = true; + showCalendarWeather = true; + showWeekNumberInCalendar = true; + use12hourFormat = true; + useFahrenheit = true; + weatherEnabled = true; + weatherShowEffects = true; + }; + + network = { + bluetoothDetailsViewMode = "grid"; + bluetoothHideUnnamedDevices = false; + bluetoothRssiPollIntervalMs = 10000; + bluetoothRssiPollingEnabled = false; + wifiDetailsViewMode = "grid"; + wifiEnabled = true; + }; + + nightLight = { + autoSchedule = true; + dayTemp = "6500"; + enabled = true; + forced = false; + manualSunrise = "06:30"; + manualSunset = "18:30"; + nightTemp = "4000"; + }; + + notifications = { + backgroundOpacity = 1; + criticalUrgencyDuration = 15; + enableBatteryToast = true; + enableKeyboardLayoutToast = true; + enableMediaToast = false; + enabled = true; + location = "top_right"; + lowUrgencyDuration = 3; + monitors = [ ]; + normalUrgencyDuration = 8; + overlayLayer = true; + respectExpireTimeout = false; + saveToHistory = { + critical = true; + low = true; + normal = true; + }; + sounds = { + criticalSoundFile = ""; + enabled = true; + excludedApps = "discord,firefox,chrome,chromium,edge"; + lowSoundFile = ""; + normalSoundFile = ""; + separateSounds = false; + volume = 0.5; + }; + }; + + osd = { + autoHideMs = 2000; + backgroundOpacity = 1; + enabled = true; + enabledTypes = [ + 0 + 1 + 2 + ]; + location = "top_right"; + monitors = [ ]; + overlayLayer = true; + }; + + plugins.autoUpdate = false; + + sessionMenu = { + countdownDuration = 5000; + enableCountdown = true; + largeButtonsLayout = "single-row"; + largeButtonsStyle = true; + position = "center"; + powerOptions = [ + { + action = "lock"; + enabled = true; + } + { + action = "suspend"; + enabled = true; + } + { + action = "hibernate"; + enabled = true; + } + { + action = "reboot"; + enabled = true; + } + { + action = "logout"; + enabled = true; + } + { + action = "shutdown"; + enabled = true; + } + ]; + showHeader = true; + showNumberLabels = true; + }; + + settingsVersion = 49; + + systemMonitor = { + batteryCriticalThreshold = 5; + batteryWarningThreshold = 20; + cpuCriticalThreshold = 90; + cpuPollingInterval = 1000; + cpuWarningThreshold = 80; + criticalColor = ""; + diskAvailCriticalThreshold = 10; + diskAvailWarningThreshold = 20; + diskCriticalThreshold = 90; + diskPollingInterval = 3000; + diskWarningThreshold = 80; + enableDgpuMonitoring = false; + externalMonitor = "resources || missioncenter || jdsystemmonitor || corestats || system-monitoring-center || gnome-system-monitor || plasma-systemmonitor || mate-system-monitor || ukui-system-monitor || deepin-system-monitor || pantheon-system-monitor"; + gpuCriticalThreshold = 90; + gpuPollingInterval = 3000; + gpuWarningThreshold = 80; + loadAvgPollingInterval = 3000; + memCriticalThreshold = 90; + memPollingInterval = 1000; + memWarningThreshold = 80; + networkPollingInterval = 1000; + swapCriticalThreshold = 90; + swapWarningThreshold = 80; + tempCriticalThreshold = 90; + tempWarningThreshold = 80; + useCustomColors = false; + warningColor = ""; + }; + + templates = { + activeTemplates = [ ]; + enableUserTheming = false; + }; + + ui = { + bluetoothDetailsViewMode = "grid"; + bluetoothHideUnnamedDevices = false; + boxBorderEnabled = false; + fontDefault = "Noto Sans"; + fontDefaultScale = 1; + fontFixed = "FiraMono Nerd Font Mono"; + fontFixedScale = 1; + networkPanelView = "wifi"; + panelBackgroundOpacity = 1; + panelsAttachedToBar = true; + settingsPanelMode = "attached"; + tooltipsEnabled = true; + wifiDetailsViewMode = "grid"; + }; + + wallpaper = { + automationEnabled = false; + directory = "/home/sckova/.local/share/wallpaper"; + enableMultiMonitorDirectories = false; + enabled = false; + fillColor = "#1e1e2e"; + fillMode = "crop"; + hideWallpaperFilenames = true; + monitorDirectories = [ ]; + overviewEnabled = false; + panelPosition = "follow_bar"; + randomIntervalSec = 300; + setWallpaperOnAllMonitors = true; + showHiddenFiles = false; + solidColor = "#1a1a2e"; + sortOrder = "name"; + transitionDuration = 1500; + transitionEdgeSmoothness = 0.05; + transitionType = "random"; + useSolidColor = false; + useWallhaven = false; + viewMode = "single"; + wallhavenApiKey = ""; + wallhavenCategories = "111"; + wallhavenOrder = "desc"; + wallhavenPurity = "100"; + wallhavenQuery = ""; + wallhavenRatios = ""; + wallhavenResolutionHeight = ""; + wallhavenResolutionMode = "atleast"; + wallhavenResolutionWidth = ""; + wallhavenSorting = "relevance"; + wallpaperChangeMode = "random"; + }; + }; + }; + + systemd.user.services.noctalia-shell = { + Unit = { + After = [ "niri.service" ]; + PartOf = [ "niri.service" ]; + Description = "Noctalia Shell - Wayland desktop shell"; + Documentation = "https://docs.noctalia.dev/docs"; + }; + + Service = { + ExecStart = "${pkgs.noctalia-shell}/bin/noctalia-shell"; + Restart = "on-failure"; + Environment = [ + "LOCALE_ARCHIVE=${pkgs.glibcLocales}/lib/locale" + "TZDIR=${pkgs.tzdata}/share/zoneinfo" + "NOCTALIA_SETTINGS_FALLBACK=%h/.config/noctalia/gui-settings.json" + "QT_QPA_PLATFORM=wayland" + "QT_QPA_PLATFORMTHEME=qt6ct" + ]; + }; + + Install = { + WantedBy = [ "niri.service" ]; + }; + }; +} diff --git a/home/tiling/wallpaper.nix b/home/tiling/wallpaper.nix new file mode 100644 index 0000000..47377f7 --- /dev/null +++ b/home/tiling/wallpaper.nix @@ -0,0 +1,81 @@ +{ + pkgs, + config, + ... +}: +{ + home.packages = with pkgs; [ + wpaperd + ]; + + home.file.".config/wpaperd/config.toml" = { + text = '' + [default] + mode = "center" + [any] + path = "/home/${config.userOptions.username}/.local/share/wallpaper/daily.jpg" + ''; + force = true; + }; + + systemd.user.services.wpaperd = { + Unit = { + Description = "Modern wallpaper daemon for Wayland"; + PartOf = [ "niri.service" ]; + Requires = [ "niri.service" ]; + After = [ "niri.service" ]; + }; + Service = { + ExecStart = "${pkgs.wpaperd}/bin/wpaperd"; + }; + Install = { + WantedBy = [ "niri.service" ]; + }; + }; + + systemd.user.services.bing-wallpaper = { + Unit = { + Description = "Download and set Bing wallpaper of the day"; + After = [ "network-online.target" ]; + Wants = [ "network-online.target" ]; + }; + Service = { + Type = "oneshot"; + ExecStart = pkgs.writeShellScript "bing-wallpaper" '' + OUT="''${XDG_DATA_HOME:-$HOME/.local/share}/wallpaper/daily.jpg" + + API_RESP=$(${pkgs.wget}/bin/wget -qO- "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&mkt=en-US&n=1") || exit 1 + + URL_BASE=$(echo "$API_RESP" | ${pkgs.gnugrep}/bin/grep -oP 'urlbase":"[^"]*' | cut -d '"' -f 3) + TITLE=$(echo "$API_RESP" | ${pkgs.gnugrep}/bin/grep -oP 'title":"[^"]*' | cut -d '"' -f 3) + + ${pkgs.coreutils}/bin/mkdir -p "$(dirname "$OUT")" + ${pkgs.wget}/bin/wget -qO "$OUT" "https://www.bing.com$URL_BASE\_UHD.jpg" || \ + ${pkgs.wget}/bin/wget -qO "$OUT" "https://www.bing.com$(echo "$API_RESP" | ${pkgs.gnugrep}/bin/grep -oP 'url":"[^"]*' | cut -d '"' -f 3)" + + ${pkgs.libnotify}/bin/notify-send \ + -a "Bing Wallpaper Service" \ + -u low \ + -i preferences-desktop-wallpaper \ + "$TITLE" + ''; + ExecStartPost = "${pkgs.systemd}/bin/systemctl --user restart wpaperd.service"; + }; + Install = { + WantedBy = [ "niri.service" ]; + }; + }; + + systemd.user.timers.bing-wallpaper = { + Unit = { + Description = "Run bing wallpaper retrieval daily"; + }; + Timer = { + OnCalendar = "*-*-* 10:00:00 GMT"; + Persistent = true; + }; + Install = { + WantedBy = [ "timers.target" ]; + }; + }; +} diff --git a/hosts/alien.nix b/hosts/alien.nix deleted file mode 100644 index 2c80d0c..0000000 --- a/hosts/alien.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ config, pkgs, lib, catppuccin, ... }: { - networking.hostName = "alien"; - - catppuccin = { - accent = "lavender"; - }; - - home-manager.users.sckova = { - imports = [ catppuccin.homeModules.catppuccin ]; - }; - - boot.kernelPackages = pkgs.linuxPackages; - - programs = { - gamescope = { - enable = true; - capSysNice = true; - }; - steam = { - enable = true; - gamescopeSession.enable = true; - localNetworkGameTransfers.openFirewall = true; - }; - }; - - services.xserver.videoDrivers = [ - "modesetting" - "nvidia" - ]; - - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = false; - nvidiaSettings = true; - package = pkgs.linuxPackages.nvidiaPackages.stable; - }; -} - diff --git a/hosts/peach.nix b/hosts/peach.nix deleted file mode 100644 index 126700e..0000000 --- a/hosts/peach.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, pkgs, lib, catppuccin, ... }: { - networking.hostName = "peach"; - - catppuccin = { - accent = "peach"; - }; - - home-manager.users.sckova = { - imports = [ catppuccin.homeModules.catppuccin ]; - }; - - hardware.asahi = { - extractPeripheralFirmware = true; - peripheralFirmwareDirectory = ../firmware; - }; -} - diff --git a/options.nix b/options.nix new file mode 100644 index 0000000..910e25f --- /dev/null +++ b/options.nix @@ -0,0 +1,152 @@ +{ + lib, + config, + pkgs, + ... +}: +{ + options = { + colors = { + scheme = lib.mkOption { + type = lib.types.str; + default = "catppuccin-mocha"; + }; + accent = lib.mkOption { + type = lib.types.str; + default = "base09"; + }; + }; + # catppuccinUpper = { + # accent = lib.mkOption { + # type = lib.types.str; + # readOnly = true; + # default = + # builtins.substring 0 1 (lib.toUpper config.catppuccin.accent) + # + builtins.substring 1 (-1) config.catppuccin.accent; + # }; + # flavor = lib.mkOption { + # type = lib.types.str; + # readOnly = true; + # default = + # builtins.substring 0 1 (lib.toUpper config.catppuccin.flavor) + # + builtins.substring 1 (-1) config.catppuccin.flavor; + # }; + # }; + userOptions = { + name = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "Sean Kovacs"; + }; + username = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "sckova"; + }; + hostname = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = config.system.name; + }; + fontSans = { + name = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "Noto Sans"; + }; + size = lib.mkOption { + type = lib.types.int; + readOnly = true; + default = 11; + }; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = pkgs.noto-fonts; + }; + }; + fontSerif = { + name = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "Noto Serif"; + }; + size = lib.mkOption { + type = lib.types.int; + readOnly = true; + default = 11; + }; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = pkgs.noto-fonts; + }; + }; + fontMono = { + name = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "FiraMono Nerd Font Mono"; + }; + size = lib.mkOption { + type = lib.types.int; + readOnly = true; + default = 10; + }; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = pkgs.nerd-fonts.fira-mono; + }; + }; + fontEmoji = { + name = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "Noto Emoji"; + }; + size = lib.mkOption { + type = lib.types.int; + readOnly = true; + default = 10; + }; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = pkgs.noto-fonts-color-emoji; + }; + }; + cursor = + let + attrName = "mocha" + "Peach"; + in + { + name = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "catppuccin-mocha-peach-cursors"; + }; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = pkgs.catppuccin-cursors.${attrName}; + }; + size = lib.mkOption { + type = lib.types.int; + readOnly = true; + default = 24; + }; + path = lib.mkOption { + type = lib.types.str; + readOnly = true; + default = "${pkgs.catppuccin-cursors.${attrName}}/share/icons"; + }; + }; + # isDark = lib.mkOption { + # type = lib.types.bool; + # readOnly = true; + # default = config.catppuccin.flavor != "latte"; + # }; + }; + }; +} diff --git a/packages/catppuccin-discord/default.nix b/packages/catppuccin-discord/default.nix new file mode 100644 index 0000000..ec4105e --- /dev/null +++ b/packages/catppuccin-discord/default.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenv, + fetchYarnDeps, + yarn, + nodejs, + fixup-yarn-lock, + nodePackages, + catppuccin-discord-git, +}: +stdenv.mkDerivation rec { + pname = "catppuccin-discord"; + version = "unstable-${catppuccin-discord-git.rev}"; + + src = catppuccin-discord-git; + + yarnOfflineCache = fetchYarnDeps { + yarnLock = "${src}/yarn.lock"; + hash = "sha256-BhE3aKyA/LBErjWx+lbEVb/CIXhqHkXbV+9U2djIBhs="; + }; + + nativeBuildInputs = [ + yarn + nodejs + fixup-yarn-lock + nodePackages.sass + ]; + + postPatch = '' + substituteInPlace package.json \ + --replace-fail "--no-charset --no-source-map" "" + ''; + + configurePhase = '' + export HOME=$TMPDIR + yarn config --offline set yarn-offline-mirror ${yarnOfflineCache} + fixup-yarn-lock yarn.lock + yarn install --offline --frozen-lockfile --ignore-scripts --ignore-platform + ''; + + buildPhase = '' + yarn --offline release + ''; + + installPhase = '' + mkdir -p $out/share/catppuccin-discord + cp -r dist/dist/* $out/share/catppuccin-discord/ + ''; + + meta = { + description = "Soothing pastel theme for Discord"; + homepage = "https://github.com/catppuccin/discord"; + license = lib.licenses.mit; + platforms = lib.platforms.all; + }; +} diff --git a/packages/kvlibadwaita/default.nix b/packages/kvlibadwaita/default.nix new file mode 100644 index 0000000..3d729dd --- /dev/null +++ b/packages/kvlibadwaita/default.nix @@ -0,0 +1,51 @@ +{ + lib, + stdenvNoCC, + kvlibadwaita-git, + colorScheme ? null, +}: + +stdenvNoCC.mkDerivation { + pname = "kvlibadwaita"; + version = "git"; + + # Pulls from the flake-provided git variable + src = kvlibadwaita-git; + + # We take the colors as an input but do nothing with them yet per your instructions. + # They are passed into the derivation environment just in case, but unused for now. + passthru = { + inherit colorScheme; + }; + + # Standard phases are skipped for pure file-copying derivations to save time + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + # Recreate the exact requested directory structure in the output + mkdir -p $out/src/Colors + mkdir -p $out/src/KvLibadwaita + + # Export Colors + cp "src/Colors/Libadwaita Dark.colors" "$out/src/Colors/" + cp "src/Colors/Libadwaita Light.colors" "$out/src/Colors/" + + # Export KvLibadwaita files + cp "src/KvLibadwaita/KvLibadwaita.kvconfig" "$out/src/KvLibadwaita/" + cp "src/KvLibadwaita/KvLibadwaita.svg" "$out/src/KvLibadwaita/" + cp "src/KvLibadwaita/KvLibadwaitaDark.kvconfig" "$out/src/KvLibadwaita/" + cp "src/KvLibadwaita/KvLibadwaitaDark.svg" "$out/src/KvLibadwaita/" + + runHook postInstall + ''; + + meta = with lib; { + description = "Libadwaita theme for Kvantum"; + homepage = "https://github.com/GabePoel/kvlibadwaita"; # Update if pointing to a specific fork + license = licenses.gpl3Only; + platforms = platforms.linux; + }; +} diff --git a/packages/overlay.nix b/packages/overlay.nix new file mode 100644 index 0000000..9850c55 --- /dev/null +++ b/packages/overlay.nix @@ -0,0 +1,43 @@ +final: prev: { + spotify-webapp = final.callPackage ./spotify-webapp { }; + + catppuccin-discord = final.callPackage ./catppuccin-discord { + inherit (final) catppuccin-discord-git; + }; + + kvlibadwaita = final.callPackage ./kvlibadwaita { + inherit (final) kvlibadwaita-git; + }; + + openmw = prev.openmw.overrideAttrs (oldAttrs: { + pname = "openmw"; + src = final.openmw-git; + version = "${final.openmw-git.rev}"; + }); + + vintagestory = prev.vintagestory.overrideAttrs (oldAttrs: { + version = "1.21.4"; + src = prev.fetchurl { + url = "https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_1.21.4.tar.gz"; + hash = "sha256-npffJgxgUMefX9OiveNk1r4kVqsMaVCC1jcWaibz9l8="; + }; + }); + + riff = final.callPackage ./riff { }; + + # linuxPackages_asahi = prev.linuxPackages_asahi.override { + # _kernelPatches = [ + # { + # name = "Mailbox and RTKIT support"; + # patch = null; + # structuredExtraConfig = with prev.lib.kernel; { + # APPLE_MAILBOX = yes; + # APPLE_RTKIT = yes; + # APPLE_RTKIT_HELPER = yes; + # RUST_APPLE_RTKIT = yes; + # RUST_FW_LOADER_ABSTRACTIONS = yes; + # }; + # } + # ]; + # }; +} diff --git a/packages/riff/default.nix b/packages/riff/default.nix new file mode 100644 index 0000000..f25f2db --- /dev/null +++ b/packages/riff/default.nix @@ -0,0 +1,96 @@ +{ + lib, + stdenv, + alsa-lib, + appstream-glib, + blueprint-compiler, + cargo, + desktop-file-utils, + fetchFromGitHub, + gettext, + glib, + gst_all_1, + gtk4, + libadwaita, + libhandy, + libpulseaudio, + meson, + ninja, + nix-update-script, + openssl, + pkg-config, + rustPlatform, + rustc, + wrapGAppsHook4, +}: + +stdenv.mkDerivation rec { + pname = "riff"; + version = "v25.11"; + + src = fetchFromGitHub { + owner = "Diegovsky"; + repo = "riff"; + rev = "refs/tags/${version}"; + hash = "sha256-j5PZXXGInA03V3Lfu+QUgeHw8583XvJZyW67VcDe980="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit pname version src; + hash = "sha256-8gJILK9A97PAb/Q1z+IvW54WuwoZZSKxlJJUt7dwQWE="; + }; + + postPatch = '' + substituteInPlace src/meson.build --replace-fail \ + "cargo_output = 'src' / rust_target / meson.project_name()" \ + "cargo_output = 'src' / '${stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / meson.project_name()" + ''; + + nativeBuildInputs = [ + appstream-glib + blueprint-compiler + cargo + desktop-file-utils + gettext + glib # for glib-compile-schemas + gtk4 # for gtk-update-icon-cache + meson + ninja + pkg-config + rustPlatform.cargoSetupHook + rustc + wrapGAppsHook4 + ]; + + buildInputs = [ + alsa-lib + glib + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + gtk4 + libadwaita + libhandy + libpulseaudio + openssl + ]; + + # https://github.com/xou816/spot/issues/313 + mesonBuildType = "release"; + + # For https://github.com/xou816/spot/blob/21ee601f655caa4ca9cae1033a27459fe6289318/src/meson.build#L122 + env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { + description = "Native Spotify client for the GNOME desktop"; + homepage = "https://github.com/Diegovsky/riff"; + changelog = "https://github.com/Diegovsky/riff/releases/tag/${src.rev}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ getchoo ]; + mainProgram = "riff"; + platforms = lib.platforms.linux; + }; +} diff --git a/packages/spotify-webapp/default.nix b/packages/spotify-webapp/default.nix new file mode 100644 index 0000000..85304b5 --- /dev/null +++ b/packages/spotify-webapp/default.nix @@ -0,0 +1,72 @@ +{ + lib, + stdenv, + makeDesktopItem, + copyDesktopItems, + chromium, + writeShellScriptBin, +}: +let + pname = "spotify-webapp"; + version = "1.0.0"; + + chromiumWithWidevine = chromium.override { + enableWideVine = true; + }; + + launchScript = writeShellScriptBin "spotify-webapp" '' + exec ${chromiumWithWidevine}/bin/chromium \ + --app=https://open.spotify.com \ + --class=spotify-webapp \ + --name=spotify-webapp \ + --user-data-dir="$HOME/.config/spotify-webapp" \ + --enable-features=UseOzonePlatform \ + --ozone-platform=wayland \ + "$@" + ''; +in +stdenv.mkDerivation { + inherit pname version; + + dontUnpack = true; + dontBuild = true; + + nativeBuildInputs = [ copyDesktopItems ]; + + desktopItems = [ + (makeDesktopItem { + name = "spotify-webapp"; + exec = "spotify-webapp %U"; + icon = "spotify"; + desktopName = "Spotify"; + genericName = "Music Streaming"; + comment = "Listen to music on Spotify"; + categories = [ + "Audio" + "Music" + "AudioVideo" + ]; + mimeTypes = [ "x-scheme-handler/spotify" ]; + startupWMClass = "spotify-webapp"; + startupNotify = true; + }) + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + ln -s ${launchScript}/bin/spotify-webapp $out/bin/spotify-webapp + + runHook postInstall + ''; + + meta = with lib; { + description = "Spotify web app running in Chromium"; + homepage = "https://open.spotify.com"; + license = licenses.free; + maintainers = [ ]; + platforms = platforms.linux; + mainProgram = "spotify-webapp"; + }; +} diff --git a/system/default.nix b/system/default.nix new file mode 100755 index 0000000..332e25f --- /dev/null +++ b/system/default.nix @@ -0,0 +1,184 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + pkgs, + ... +}: +{ + environment.sessionVariables = { + # this makes electron apps work per the wiki + NIXOS_OZONE_WL = "1"; + }; + + boot = { + plymouth = { + enable = true; + logo = "${pkgs.nixos-icons}/share/icons/hicolor/64x64/apps/nix-snowflake-white.png"; + }; + + loader = { + timeout = 3; + # systemd-boot = { + # enable = true; + # consoleMode = lib.mkForce "auto"; + # configurationLimit = 10; + # }; + limine = { + enable = true; + maxGenerations = 10; + extraConfig = '' + timeout: 3 + ''; + style = { + wallpapers = [ ]; + wallpaperStyle = "stretched"; + backdrop = "#1e1e2e"; + interface = { + branding = "kova's nixos!"; + brandingColor = 5; + }; + }; + }; + # efi.canTouchEfiVariables = true; + }; + kernelParams = [ + "quiet" + "splash" + "vga=current" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + "boot.shell_on_fail" + ]; + consoleLogLevel = 0; + initrd.verbose = false; + }; + + networking.networkmanager.enable = true; + hardware.bluetooth.enable = true; + + time.timeZone = "America/New_York"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Enable OpenGL + hardware.graphics = { + enable = true; + }; + + programs.niri = { + enable = true; + package = pkgs.niri-unstable; + }; + services.gnome.gnome-keyring.enable = true; + security.pam.services.niri.enableGnomeKeyring = true; + programs.dconf.enable = true; + + programs.dconf.profiles.user = { + databases = [ + { + # breaks user-level indirect config of dconf + # lockAll = true; + settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + clock-format = "12h"; + clock-show-weekday = true; + }; + "org/gnome/desktop/wm/preferences" = { + button-layout = ":"; + action-double-click-titlebar = "'none'"; + }; + "org/gnome/desktop/media-handling" = { + automount = false; + automount-open = false; + autorun-never = true; + }; + "org/gnome/settings-daemon/plugins/power" = { + sleep-inactive-ac-type = "nothing"; + }; + "org/gnome/mutter" = { + edge-tiling = true; + dynamic-workspaces = true; + experimental-features = [ "variable-refresh-rate" ]; + }; + }; + } + ]; + }; + + # aerothemeplasma = { + # enable = true; + # plasma.enable = true; + # fonts.enable = false; + # plymouth.enable = false; + # sddm.enable = true; + # }; + + services = { + # displayManager = { + # gdm.enable = true; + # defaultSession = "niri"; + # }; + desktopManager.plasma6.enable = true; + displayManager = { + sddm.enable = true; + # defaultSession = "aerothemeplasma"; + }; + + libinput.enable = true; + printing.enable = true; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + udisks2.enable = true; + gvfs.enable = true; + + upower.enable = true; + power-profiles-daemon.enable = true; + }; + + environment = { + systemPackages = with pkgs; [ + git + firefoxpwa + distrobox + ]; + }; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryPackage = pkgs.pinentry-curses; + }; + networking.firewall.enable = false; + + documentation.man = { + enable = true; + generateCaches = false; + }; + + services.openssh.enable = true; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "25.05"; # Did you read the comment? +} diff --git a/system/hosts/alien/default.nix b/system/hosts/alien/default.nix new file mode 100644 index 0000000..21bcf9f --- /dev/null +++ b/system/hosts/alien/default.nix @@ -0,0 +1,122 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + environment.systemPackages = with pkgs; [ + ddcutil + mangohud + (bottles.override { removeWarningPopup = true; }) + openrgb + ]; + + # enable ddcutil + users.users.sckova.extraGroups = [ "i2c" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ]; + boot.kernelModules = [ + "i2c-dev" + "ddcci_backlight" + ]; + services.udev.extraRules = '' + KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660" + ''; + hardware.i2c.enable = true; + + # enable rgb support + services.hardware.openrgb.enable = true; + + # boot.kernelPackages = pkgs.linuxPackages; + + # let's use the CachyOS kernel instead! + boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-lts; + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; + + boot.loader.limine.maxGenerations = lib.mkForce 100; + + programs = { + gamescope = { + enable = true; + capSysNice = false; + }; + steam = { + enable = true; + gamescopeSession.enable = true; + localNetworkGameTransfers.openFirewall = true; + extraCompatPackages = with pkgs; [ proton-ge-bin ]; + }; + }; + + services.ananicy = { + enable = true; + package = pkgs.ananicy-cpp; + rulesProvider = pkgs.ananicy-cpp; + extraRules = [ + { + "name" = "gamescope"; + "nice" = -20; + } + ]; + }; + + services.xserver.videoDrivers = [ + "modesetting" + "nvidia" + ]; + + services.displayManager = { + autoLogin = { + enable = false; + user = "sckova"; + }; + }; + + environment = { + loginShellInit = '' + [[ "$(tty)" = "/dev/tty1" ]] && ./gs.sh + ''; + }; + + security.sudo.wheelNeedsPassword = false; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + nvidiaSettings = false; + open = false; + }; + + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + }; + + # virtualization settings + + virtualisation = { + containers.enable = true; + podman = { + enable = true; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; # Required for containers under podman-compose to be able to talk to each other. + }; + }; + + # enable hyper-v for guests + virtualisation.hypervGuest.enable = true; + boot.blacklistedKernelModules = [ "hyperv_fb" ]; + + boot.binfmt.emulatedSystems = [ + "aarch64-linux" + "riscv64-linux" + ]; + + # i don't even remember what this does or why i added it + systemd.tmpfiles.rules = [ + "L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware" + "d /mnt/storage 0775 sckova users - -" + ]; +} diff --git a/system/hosts/alien/gs.sh b/system/hosts/alien/gs.sh new file mode 100644 index 0000000..40cd18b --- /dev/null +++ b/system/hosts/alien/gs.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -xeuo pipefail + +gamescopeArgs=( + --adaptive-sync # VRR support + --hdr-enabled + --mangoapp # performance overlay + --rt + --steam +) +steamArgs=( + -pipewire-dmabuf + -tenfoot +) +mangoConfig=( + cpu_temp + gpu_temp + ram + vram +) +mangoVars=( + MANGOHUD=1 + MANGOHUD_CONFIG="$(IFS=,; echo "${mangoConfig[*]}")" +) + +export "${mangoVars[@]}" +exec gamescope "${gamescopeArgs[@]}" -- steam "${steamArgs[@]}" diff --git a/system/hosts/peach/default.nix b/system/hosts/peach/default.nix new file mode 100644 index 0000000..76d8105 --- /dev/null +++ b/system/hosts/peach/default.nix @@ -0,0 +1,57 @@ +{ + pkgs, + config, + lib, + ... +}: +let + asahi-artwork = pkgs.fetchFromGitHub { + owner = "AsahiLinux"; + repo = "artwork"; + rev = "80d14f8b6f485b310e305a84b4b806361518ddd1"; + hash = "sha256-1r7gPFsn3GmKO4YsixsK7eyQWfVjsWnuOEtSCQequn8="; + }; +in +{ + boot = { + kernelParams = [ "appledrm.show_notch=1" ]; + m1n1CustomLogo = "${asahi-artwork}/logos/png_256/AsahiLinux_logomark.png"; + plymouth.logo = lib.mkForce "${asahi-artwork}/logos/png_64/AsahiLinux_logomark.png"; + }; + + programs.dconf.profiles.gdm.databases = [ + { + settings."org/gnome/login-screen".logo = + "${asahi-artwork}/logos/svg/AsahiLinux_logo_horizontal_darkbg.svg"; + } + ]; + + virtualisation.docker = { + enable = true; + # Use the rootless mode - run Docker daemon as non-root user + rootless = { + enable = true; + setSocketVariable = true; + }; + }; + users.users.sckova.extraGroups = [ "docker" ]; + + hardware.asahi = { + enable = true; + setupAsahiSound = true; + # https://github.com/nix-community/nixos-apple-silicon/issues/299#issuecomment-2901508921 + peripheralFirmwareDirectory = pkgs.requireFile { + name = "firmware"; + hashMode = "recursive"; + hash = "sha256-ooBrgsZ+B6Fmoy6Ze5ppP9oKQzMIk1orvx+ldxY6bQs="; + message = '' + you need to add the firmware to the store: + mkdir system/hosts/peach/firmware + sudo cp -r /mnt/boot/asahi/{all_firmware.tar.gz,kernelcache*} system/hosts/peach/firmware + nix-store --add-fixed sha256 --recursive ./system/hosts/peach/firmware + ''; + }; + }; + + security.sudo.wheelNeedsPassword = false; +} diff --git a/system/hosts/vm-generic/default.nix b/system/hosts/vm-generic/default.nix new file mode 100644 index 0000000..b2183eb --- /dev/null +++ b/system/hosts/vm-generic/default.nix @@ -0,0 +1,17 @@ +{ catppuccin, ... }: +{ + home-manager.users.sckova = { + imports = [ catppuccin.homeModules.catppuccin ]; + }; + + services.spice-vdagentd.enable = true; + + virtualisation.vmVariant = { + virtualisation = { + memorySize = 8192; + cores = 6; + }; + }; + + security.sudo.wheelNeedsPassword = false; +} diff --git a/system/searxng/default.nix b/system/searxng/default.nix new file mode 100644 index 0000000..75161b5 --- /dev/null +++ b/system/searxng/default.nix @@ -0,0 +1,137 @@ +{ + lib, + pkgs, + config, + ... +}: +{ + + services.searx = { + enable = true; + redisCreateLocally = true; + settings = { + server = { + secret_key = lib.removeSuffix "\n" ( + builtins.readFile ( + pkgs.runCommand "gen-key" { buildInputs = [ pkgs.openssl ]; } "openssl rand -hex 32 > $out" + ) + ); + port = 8080; + bind_address = "127.0.0.1"; + }; + + general = { + debug = false; + instance_name = "searxng: ${config.system.name}"; + donation_url = false; + contact_url = false; + privacypolicy_url = false; + enable_metrics = false; + }; + + ui = { + static_use_hash = true; + default_locale = "en"; + query_in_title = true; + infinite_scroll = false; + center_alignment = true; + default_theme = "simple"; + theme_args.simple_style = "auto"; + search_on_category_select = false; + hotkeys = "vim"; + }; + + search = { + safe_search = 2; + autocomplete_min = 2; + autocomplete = "duckduckgo"; + ban_time_on_fail = 5; + max_ban_time_on_fail = 120; + formats = [ + "html" + "json" + "rss" + ]; + }; + + engines = lib.mapAttrsToList (name: value: { inherit name; } // value) { + "duckduckgo".disabled = true; + "brave".disabled = true; + "bing".disabled = false; + "bing".weight = 0.4; + "startpage".disabled = false; + "startpage".weight = 1.4; + "google".disabled = false; + "mojeek".disabled = true; + "mwmbl".disabled = false; + "mwmbl".weight = 0.4; + "qwant".disabled = true; + "crowdview".disabled = false; + "crowdview".weight = 0.5; + "curlie".disabled = true; + "ddg definitions".disabled = false; + "ddg definitions".weight = 2; + "wikibooks".disabled = false; + "wikidata".disabled = true; + "wikiquote".disabled = true; + "wikisource".disabled = true; + "wikispecies".disabled = false; + "wikispecies".weight = 0.5; + "wikiversity".disabled = false; + "wikiversity".weight = 0.5; + "wikivoyage".disabled = false; + "wikivoyage".weight = 0.5; + "currency".disabled = true; + "dictzone".disabled = true; + "lingva".disabled = true; + "bing images".disabled = false; + "brave.images".disabled = true; + "duckduckgo images".disabled = true; + "google images".disabled = false; + "qwant images".disabled = true; + "1x".disabled = true; + "artic".disabled = false; + "deviantart".disabled = false; + "flickr".disabled = true; + "imgur".disabled = false; + "library of congress".disabled = false; + "material icons".disabled = true; + "material icons".weight = 0.2; + "openverse".disabled = false; + "pinterest".disabled = true; + "svgrepo".disabled = false; + "unsplash".disabled = false; + "wallhaven".disabled = false; + "wikicommons.images".disabled = false; + "yacy images".disabled = true; + "bing videos".disabled = false; + "brave.videos".disabled = true; + "duckduckgo videos".disabled = true; + "google videos".disabled = false; + "qwant videos".disabled = false; + "dailymotion".disabled = true; + "google play movies".disabled = true; + "invidious".disabled = true; + "odysee".disabled = true; + "peertube".disabled = false; + "piped".disabled = true; + "rumble".disabled = false; + "sepiasearch".disabled = false; + "vimeo".disabled = true; + "youtube".disabled = false; + "brave.news".disabled = true; + "google news".disabled = true; + }; + + enabled_plugins = [ + "Basic Calculator" + "Hash plugin" + "Tor check plugin" + "Open Access DOI rewrite" + "Hostnames plugin" + "Unit converter plugin" + "Tracker URL remover" + ]; + }; + }; +} diff --git a/system/shell/fish.nix b/system/shell/fish.nix new file mode 100644 index 0000000..229692a --- /dev/null +++ b/system/shell/fish.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + # This following block taken from the wiki: + # https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell + programs.bash = { + interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; + + programs.fish = { + enable = true; + interactiveShellInit = '' + set fish_greeting # Disable greeting + alias edit "nvim" + ''; + }; + documentation.man.generateCaches = false; +} diff --git a/system/tailscale/default.nix b/system/tailscale/default.nix new file mode 100644 index 0000000..90e21a8 --- /dev/null +++ b/system/tailscale/default.nix @@ -0,0 +1,36 @@ +# The goal of this configuration is to make it so you can write systemd units that +# can wait until tailscale is up and connected, by putting After=tailscaled.service +# in their unit file. +# https://github.com/tailscale/tailscale/issues/11504#issuecomment-2113331262 +{ + pkgs, + lib, + ... +}: +let + tailscaleWaitScript = pkgs.writeShellScript "tailscale-wait-for-ip" '' + echo "Waiting for tailscale0 to get an IP address..." + for i in {1..15}; do + if ${lib.getExe' pkgs.iproute2 "ip"} addr show dev tailscale0 2>/dev/null | ${lib.getExe' pkgs.gnugrep "grep"} -q 'inet '; then + echo "tailscale0 has IP address" + exit 0 + fi + echo "Attempt $i" + sleep 1 + done + echo "Warning: tailscale0 did not get IP address within 15 seconds" + exit 0 + ''; +in +{ + systemd.services.tailscaled = { + serviceConfig = { + ExecStartPost = tailscaleWaitScript; + }; + }; + + services.tailscale = { + enable = true; + useRoutingFeatures = "client"; + }; +} diff --git a/system/widevine/default.nix b/system/widevine/default.nix new file mode 100644 index 0000000..df1aa78 --- /dev/null +++ b/system/widevine/default.nix @@ -0,0 +1,35 @@ +# https://github.com/nix-community/nixos-apple-silicon/issues/145 +# This should work with both x86_64 and aarch64. (hopefully) +{ + config, + lib, + ... +}: +{ + nixpkgs.overlays = lib.mkIf (config.nixpkgs.hostPlatform.isLinux) [ + (final: prev: { + wrapFirefox = + browser: opts: + let + extraPrefs = (opts.extraPrefs or "") + '' + lockPref("media.gmp-widevinecdm.version", "system-installed"); + lockPref("media.gmp-widevinecdm.visible", true); + lockPref("media.gmp-widevinecdm.enabled", true); + lockPref("media.gmp-widevinecdm.autoupdate", false); + lockPref("media.eme.enabled", true); + lockPref("media.eme.encrypted-media-encryption-scheme.enabled", true); + ''; + widevineCdmDir = "${final.widevine-cdm}/share/google/chrome/WidevineCdm"; + widevineOutDir = "$out/gmp-widevinecdm/system-installed"; + in + (prev.wrapFirefox browser (opts // { inherit extraPrefs; })).overrideAttrs (previousAttrs: { + buildCommand = previousAttrs.buildCommand + '' + mkdir -p "${widevineOutDir}" + ln -s "${widevineCdmDir}/_platform_specific/linux_arm64/libwidevinecdm.so" "${widevineOutDir}/libwidevinecdm.so" + ln -s "${widevineCdmDir}/manifest.json" "${widevineOutDir}/manifest.json" + wrapProgram "$oldExe" --set MOZ_GMP_PATH "${widevineOutDir}" + ''; + }); + }) + ]; +}