Skip to content

msawatzky75/nixos-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NixOS & Hyprland with Catppuccin Macchiato Theme Configuration

nixos nixpkgs linux kernel hyprland

Table of Contents

📖 About

This repo is based on XNM's nixos config.

NOTE: currently XWayland fails to start with a VR headset plugged in. This will prevent apps like steam and discord from running. hyprwm/Hyprland#6949

🔧 Components

Component Version/Name
Distro NixOS
Kernel Zen
Shell Zsh
Display Server Wayland
WM (Compositor) Hyprland
Bar Waybar
Notification Dunst
Launcher Rofi-Wayland
Editor Helix
Terminal Kitty + Starship
OSD Avizo
Night Gamma Gammastep
Fetch Utility Neofetch
Theme Catppuccin Macchiato
Icons Colloid-teal-dark, Numix-Circle
Font Fira Code + JetBrains Mono + Nerd Font Patch
Player Youtube Music + Spotify
File Browser Thunar
Internet Browser Qutebrowser, Brave + Vimium + NightTab + Stylus
Mimetypes MPV, Imv, Zathura
Image Editor Swappy
Screenshot Grim + Slurp
Recorder Wl-screenrec
Color Picker Hyprpicker
Clipboard Wl-clipboard + Cliphist + Wl-clip-persist
Idle Hypridle
Lock Hyprlock
Logout menu Wlogout
Wallpaper Hyprpaper
Graphical Boot Plymouth + Catppuccin-plymouth
Display Manager Greetd + Tuigreet
Containerization Podman

And many other useful utilities. The full list can be found in the system configuration files at nixos directory.

✨ Features

  • 🔄 Reproducible: Built on NixOS, this configuration can be effortlessly reproduced on other machines, ensuring a consistent setup.

  • 🖌️ Consistent: Nearly every component has been meticulously styled to adhere to the Catppuccin Macchiato theme, providing a visually cohesive experience.

  • Complete: This system is equipped with a wide range of components and utilities, akin to the completeness of operating systems like MacOS or Windows.

  • 🎨 Customizable: Leveraging the power of Linux and Hyprland, this configuration offers extensive customization options, allowing you to tailor your setup to your preferences.

🚀 Installation

  1. Download and Install NixOS from the official site.

  2. Temporarily install ripgrep and fish using the command: nix-shell -p ripgrep fish --run fish. You can also use classic bash and grep for the next step without installing fish and ripgrep.

  3. Run the command rg --hidden FIXME and change/add lines to match your device, swaps, partitions, peripherals, file systems, etc. in the configuration files.

    🚨 Ensure that you configure USBGuard in the nixos/usb.nix file to avoid potential issues. By default, USBGuard blocks all USB devices, which can lead to the disabling of crucial hardware components such as the integrated camera, bluetooth, wifi, etc. To configure USBGuard properly, add your trusted USB devices to the configuration. You can obtain a list of all connected devices by using the lsusb command from the usbutils package.

    Failure to configure USBGuard appropriately may result in the inability to connect any USB devices to your machine. If needed, you can also disable USBGuard altogether by setting services.usbguard.enable to false in the configuration:services.usbguard.enable = false;. This step ensures that USBGuard is not actively blocking any USB devices.

    🚨 Also, important: If you use disk encryption with LUKS and want to use encrypted swap, you need to enable swap on LUKS. This is usually auto-generated in /etc/nixos/configuration.nix as the boot.initrd.luks.devices."luks-...".device = "/dev/disk/by-uuid/..."; code block, if you set this option up during the NixOS installation process. You can simply copy this snippet to either nixos/swap.nix, nixos/hardware-configuration.nix, or nixos/configuration.nix (Personally, I prefer to copy it to hardware-configuration.nix).

    Alternatively, you can set it up manually or use swap encryption with a random key.

  4. To change the default username and/or hostname, run the command rg --hidden 'xnm' to find and fix all instances of the username, and rg --hidden 'isitreal-laptop' for the hostname. 🚨 Make sure to change the username to match yours set during installation to avoid login issues. 🚨 Also, don't forget to delete or change to yours the git settings in home/.gitconfig, home/projects/.gitconfig.personal, and home/work/.gitconfig.work files, as they are configured for my personal use.

  5. Enable flake support (more here) on your current system. Don't forget to run sudo nixos-rebuild switch after enabling flake in your /etc/configuration.nix.

  6. Copy or move all files (with replacements) from the home directory to your $HOME directory in Linux.

  7. Copy or move all files (with replacements and sudo permissions) from the nixos directory to /etc/nixos/. 🚨 Ensure that system.stateVersion = "your_version"; is correctly set to the release version of the initial installation of your system in the configuration.nix file. 🚨 Also, for security reasons, ensure all files in the /etc/nixos directory are owned by root. If not, change ownership using the command: sudo chown -R root:root /etc/nixos.

  8. Run the command sudo nixos-rebuild switch --flake /etc/nixos#your-hostname --update-input nixpkgs --update-input rust-overlay --commit-lock-file --upgrade or nswitchu. If you chose first command, replace your-hostname with your hostname before running the command; by default, hostname is set to isitreal-laptop.

  9. Post-installation configuration:

  • Import GNOME settings along with the theme by executing the following command: dconf load / < home/.config/gnome_settings_backup.dconf. Additionally, you can use tools like gnome-tweaks or themechanger to fine-tune specific theme preferences to your liking.

  • Install dictionaries for spellchecking in Qutebrowser by using the similar command in bash: $(find $(nix-store --query --outputs $(which qutebrowser)) -iname '*dictcli.py*' | head -1) install en-US hi-IN. To obtain a list of all available dictionaries, run: $(find $(nix-store --query --outputs $(which qutebrowser)) -iname '*dictcli.py*' | head -1) list in bash. For more information, visit the Qutebrowser page on the nixos wiki.

  • Apply Catppuccin theme for websites in your browser (Brave, Firefox, Chromium):

    • Install the Stylus Extension from its official website.
    • Open the extension's settings page and navigate to the Backup section.
    • Click "Import" and select the file home/.config/stylus-catppuccin.json.
  • Apply Catppuccin theme for Cool-Retro-Term:

    • Launch Cool-Retro-Term.
    • Right-click on the window and select "Settings".
    • In the General panel, click "Import" and select the file home/.config/cool-retro-term-style.json.
    • Select the imported profile named "catppuccin-theme".
    • Click "Load" and exit from "Settings".
  • Login to your accounts.

  • Customize graphical applications to suit your preferences.

After this, you will have a complete system.

⌨️ Keybindings

Main

Key Combination Action
ALT + R Resize windows mode
ALT + M Move windows mode
SUPER + H, J, K, L Change window focus
SUPER + 1..0 Change workspace
SUPER + SHIFT + 1..0 Move window to workspace
SUPER + SHIFT + Q Kill active window
SUPER + SHIFT + F Toggle floating window
SUPER + CTRL + F Toggle full-screen
SUPER + SHIFT + O Toggle split
SUPER + SHIFT + P Toggle pseudo
SUPER + SHIFT + M Exit from hyprland
SUPER + CTRL + E Expose all windows using pyprland
SUPER + CTRL + M Expose all minimized windows using pyprland
SUPER + M Minimize or restore a window using pyprland
SUPER + CTRL + T Launch scratchpad with wezterm using pyprland
SUPER + CTRL + V Launch scratchpad with pavucontrol using pyprland
SUPER + T Launch kitty
SUPER + D Launch rofi -drun
SUPER + B Launch qutebrowser
SUPER + SHIFT + B Launch brave
SUPER + F Launch thunar
SUPER + ESCAPE Launch wlogout
SUPER + S Launch spotify
SUPER + Y Launch youtube-music
SUPER + SHIFT + D Launch discord
SUPER + SHIFT + L Launch hyprlock
SUPER + SHIFT + S Take screenshot
SUPER + E Launch swappy to edit last taken screenshot
SUPER + R Record screen area (MP4)
SUPER + SHIFT + R Record screen area (GIF)
SUPER + C Launch color picker (using hyperpicer)
SUPER + Z Toggle Zoom (with pyprland)
SUPER + V Launch clipboard menu (rofi -dmenu)
SUPER + SHIFT + V Launch clipboard menu (rofi -dmenu) (copy to clipboard)
SUPER + X Launch clipboard deletion item menu (rofi -dmenu)
SUPER + SHIFT + X Clear clipboard
SUPER + U Launch bookmark menu (rofi -dmenu)
SUPER + SHIFT + U Add text from clipboard to bookmark
SUPER + CTRL + U Launch bookmark deletion item menu (rofi -dmenu)
SUPER + SHIFT + A Toggle airplane mode
SUPER + SHIFT + N Toggle notifications
SUPER + SHIFT + Y Toggle bluetooth
SUPER + SHIFT + W Toggle wifi
SUPER + P Toggle play-pause player
SUPER + ] Player next track
SUPER + [ Player previous track

You can find all other keybindings in /home/.config/hypr/hyprland.conf in the bind section. All system zsh functions are located at /home/.zfunc/ directory.

🔑 Yubikey on NixOS

This repo contains a NixOS configuration file (nixos/yubikey.nix) enabling:

  • Yubikey authentication with pam_u2f
  • Passwordless login in greetd, sudo, ssh, and hyprlock

🚨 Personal Recommendation: While convenient, using a Yubikey for display managers (like greetd) and screen lockers (like hyprlock) without additional two-factor or multi-factor authentication (2FA/MFA) has risks. If your Yubikey is lost or stolen, someone could gain full system access before you reset keys. Yubikeys excel at protecting against online attacks but are less secure against offline attacks.

🛡️ For enhanced security and a passwordless experience: You can consider a YubiKey Bio Series device. These keys support FIDO2/WebAuthn and FIDO U2F and has built in fingerprint scanner for strong authentication. Please note, they do not offer Smart card, OpenPGP, or OTP functionality.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published