1
0
mirror of https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles.git synced 2025-09-15 09:45:58 +03:00

switched to cutting-edge channels & added pyprland & updated README.md

This commit is contained in:
XNM
2023-11-19 22:09:52 +02:00
parent c6b5ae6092
commit de00147118
12 changed files with 106 additions and 24 deletions

View File

@@ -2,8 +2,13 @@
<h1 align="center">NixOS & Hyprland with Catppuccin Macchiato Theme Configuration</h1> <h1 align="center">NixOS & Hyprland with Catppuccin Macchiato Theme Configuration</h1>
<div align="center"> <div align="center">
<img src="https://img.shields.io/static/v1?label=Hyprland&message=Stable&style=flat&logo=hyprland&colorA=24273A&colorB=8AADF4&logoColor=CAD3F5"/>
<img src="https://img.shields.io/badge/NixOS-Unstable-informational.svg?style=flat&logo=nixos&logoColor=CAD3F5&colorA=24273A&colorB=8AADF4"> ![nixos](https://img.shields.io/badge/NixOS-24273A.svg?style=flat&logo=nixos&logoColor=CAD3F5)
![nixpkgs](https://img.shields.io/badge/nixpkgs-unstable-informational.svg?style=flat&logo=nixos&logoColor=CAD3F5&colorA=24273A&colorB=8aadf4)
![linux kernel](https://img.shields.io/badge/linux_kernel-mainline-informational.svg?style=flat&logo=linux&logoColor=f4dbd6&colorA=24273A&colorB=b7bdf8)
![hyprland](https://img.shields.io/badge/hyprland-development-informational.svg?style=flat&logo=wayland&logoColor=eed49f&colorA=24273A&colorB=91d7e3)
![rust](https://img.shields.io/badge/rust-nightly-informational.svg?style=flat&logo=rust&logoColor=f5a97f&colorA=24273A&colorB=f5a97f)
</div> </div>
![Showcase Gif](home/Pictures/Records/record.gif) ![Showcase Gif](home/Pictures/Records/record.gif)
@@ -24,6 +29,17 @@ This repository houses my NixOS Linux configuration, featuring the Hyprland wind
🚨It's essential to note that this configuration is not minimalistic or lightweight and may require some disk space and knowledge to understand. If you're looking for something simpler, this configuration may not be suitable for you. 🚨It's essential to note that this configuration is not minimalistic or lightweight and may require some disk space and knowledge to understand. If you're looking for something simpler, this configuration may not be suitable for you.
This system leverages cutting-edge channels and versions of software to provide you with the latest updates and features. Notably, it utilizes:
- **nixpkgs**: unstable
- **hyprland**: development version
- **linux kernel**: mainline
- **rust**: nightly version
This approach ensures that you stay on the forefront of technology, receiving the most recent software advancements promptly. 🚨However, it's important to note that this emphasis on bleeding-edge software may impact the stability of the system.
You have the flexibility to customize these configurations according to your needs by modifying the respective configuration files.
## 🌟 Showcase ## 🌟 Showcase
The showcased images do not reflect the latest version of the system's appearance. The final setup may vary slightly. The showcased images do not reflect the latest version of the system's appearance. The final setup may vary slightly.
@@ -39,7 +55,7 @@ The showcased images do not reflect the latest version of the system's appearanc
| Component | Version/Name | | Component | Version/Name |
|-----------------------|-----------------------------| |-----------------------|-----------------------------|
| Distro | NixOS | | Distro | NixOS |
| Kernel | Zen | | Kernel | Mainline |
| Shell | Fish | | Shell | Fish |
| Display Server | Wayland | | Display Server | Wayland |
| WM (Compositor) | Hyprland | | WM (Compositor) | Hyprland |
@@ -86,10 +102,12 @@ And many other useful utilities. The full list can be found in the system config
1. Download and Install NixOS from the [official site](https://nixos.org/download). 1. Download and Install NixOS from the [official site](https://nixos.org/download).
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. 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, and file systems in the configuration files (`/etc/nixos/configuration.nix` & `/etc/nixos/hardware-configuration.nix`). 3. Run the command `rg --hidden FIXME` and change/add lines to match your device, swaps, partitions, and file systems in the configuration files (`/etc/nixos/configuration.nix` & `/etc/nixos/hardware-configuration.nix`). 🚨Ensure that you configure USBGuard in the `configuration.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.
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 to avoid login issues. 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 to avoid login issues.
5. Copy all files (with replacements) from the `home` directory to your `$HOME` directory in Linux. 5. Copy all files (with replacements) from the `home` directory to your `$HOME` directory in Linux.
6. Copy all files (with replacements) from the `nixos` directory to `/etc/nixos/`. It's recommended not to copy and replace `hardware-configuration.nix`; only copy it if you have already change it for your hardware. 6. Copy all files (with replacements) from the `nixos` directory to `/etc/nixos/`. 🚨It's recommended not to copy and replace `hardware-configuration.nix`; use default generated one, or only copy my `hardware-configuration.nix` if you have already change it for your hardware.
7. Run the command `sudo nixos-rebuild switch`. After this, you will have a complete system. You can also use flakes after first setup by running `sudo nixos-rebuild switch --flake /etc/nixos` if needed. 7. Run the command `sudo nixos-rebuild switch`. After this, you will have a complete system. You can also use flakes after first setup by running `sudo nixos-rebuild switch --flake /etc/nixos` if needed.
## ⌨️ Keybindings ## ⌨️ Keybindings
@@ -109,6 +127,11 @@ And many other useful utilities. The full list can be found in the system config
| SUPER + SHIFT + O | Toggle split | | SUPER + SHIFT + O | Toggle split |
| SUPER + SHIFT + P | Toggle pseudo | | SUPER + SHIFT + P | Toggle pseudo |
| SUPER + SHIFT + M | Exit from `hyprland` | | 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 `wezterm` | | SUPER + T | Launch `wezterm` |
| SUPER + D | Launch `rofi -drun` | | SUPER + D | Launch `rofi -drun` |
| SUPER + B | Launch `qutebrowser` | | SUPER + B | Launch `qutebrowser` |
@@ -124,7 +147,8 @@ And many other useful utilities. The full list can be found in the system config
| SUPER + E | Launch `swappy` to edit last taken screenshot | | SUPER + E | Launch `swappy` to edit last taken screenshot |
| SUPER + R | Record screen area (MP4) | | SUPER + R | Record screen area (MP4) |
| SUPER + SHIFT + R | Record screen area (GIF) | | SUPER + SHIFT + R | Record screen area (GIF) |
| SUPER + C | Color picker | | SUPER + C | Launch color picker (using `hyperpicer`) |
| SUPER + Z | Toggle Zoom (with `pyprland`)|
| SUPER + V | Launch clipboard menu (`rofi -dmenu`) | | SUPER + V | Launch clipboard menu (`rofi -dmenu`) |
| SUPER + SHIFT + V | Launch clipboard menu (`rofi -dmenu`) (copy to clipboard) | | SUPER + SHIFT + V | Launch clipboard menu (`rofi -dmenu`) (copy to clipboard) |
| SUPER + X | Launch clipboard deletion item menu (`rofi -dmenu`) | | SUPER + X | Launch clipboard deletion item menu (`rofi -dmenu`) |
@@ -153,12 +177,13 @@ Here are some tips to enhance your Rust experience on this system:
- If you are working on multiple projects with distinct `rust-toolchain.toml` files or need to switch between stable and nightly Rust versions, consider the following options: - If you are working on multiple projects with distinct `rust-toolchain.toml` files or need to switch between stable and nightly Rust versions, consider the following options:
- Set up a Nix environment using `flake.nix` and [rust-overlay](https://github.com/oxalica/rust-overlay) for each project separately. Utilize `nix develop` to manage project-specific Rust environments. - Set up a Nix environment using `flake.nix` and [rust-overlay](https://github.com/oxalica/rust-overlay) for each project separately. Utilize `nix develop` or `direnv` to manage project-specific Rust environments.
- Alternatively, you can install `rustup` through `configuration.nix` and nixpkgs for a system-wide Rust setup. This allows you to manage Rust versions globally through `rustup`. - Alternatively, you can install `rustup` through `configuration.nix` and nixpkgs for a system-wide Rust setup. This allows you to manage Rust versions globally through `rustup`.
2. **Troubleshooting Compilation Issues:** 2. **Troubleshooting Compilation Issues:**
If you encounter problems during Rust compilation, especially those related to OpenSSL or SQLite (refer [here](https://nixos.wiki/wiki/Rust#Building_Rust_crates_that_require_external_system_libraries)), leverage the `rustenv` fish function. This function is an alias for the `nix-shell -p pkg-config openssl sqlite protobuf --run fish` command, opening a Nix shell with the necessary dependencies for seamless code compilation. Additionally, if you use Nix shell, compilation will occur in the runtime directory, which might be insufficient for some projects. You can adjust the runtime directory size in `configuration.nix` under `services.logind.extraConfig="RuntimeDirectorySize=8G"`. If you encounter issues during Rust compilation, particularly those related to OpenSSL, SQLite, Wayland, or any other program utilized by `pkg-config` in the compilation process (see [here](https://nixos.wiki/wiki/Rust#Building_Rust_crates_that_require_external_system_libraries)), you can employ the `nix-shell -p pkg-config {your_dependency} [other_dependencies] --run fish` command. This command opens a Nix shell with the necessary dependencies, facilitating seamless code compilation.
Moreover, when using the Nix shell, be aware that the compilation takes place in the runtime directory, which might be insufficient for certain projects. To address this, you can adjust the runtime directory size in the `configuration.nix` file under `services.logind.extraConfig="RuntimeDirectorySize=8G"`.
3. **Cross-Compilation:** 3. **Cross-Compilation:**
For cross-compilation, consider using tools like `zigbuild` or `cross`. Personally, I find `zigbuild` preferable, but both are valuable options for your cross-compilation needs. For cross-compilation, consider using tools like `zigbuild` or `cross`. Personally, I find `zigbuild` preferable, but both are valuable options for your cross-compilation needs.
@@ -182,7 +207,7 @@ Here are some tips to enhance your Rust experience on this system:
- `bacon` - `bacon`
5. **Environment Setup:** 5. **Environment Setup:**
You can set up your Rust project environment on this system using `nix develop` or `nix-shell` with `default.nix`, `shell.nix`, or `flake.nix` to create a tailored environment for your Rust project. You can set up your Rust project environment on this system using `nix develop` or `nix-shell` with `default.nix`, `shell.nix`, or `flake.nix` to create a tailored environment for your Rust project (Also, I personally recommend using it alongside with [direnv](https://direnv.net/)).
## 📜 License ## 📜 License

6
home/.cargo/.crates.toml Normal file
View File

@@ -0,0 +1,6 @@
[v1]
"cargo-contract 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-contract"]
"cargo-dylint 2.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-dylint"]
"contracts-node 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["substrate-contracts-node"]
"dylint-link 2.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = ["dylint-link"]
"ink-lsp-server 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = ["ink-lsp-server"]

View File

@@ -57,5 +57,6 @@ syntax_highlight: true
# For more details, see https://docs.rs/termion/1.5.6/termion/color/index.html # For more details, see https://docs.rs/termion/1.5.6/termion/color/index.html
color: color:
dir_fg: LightCyan dir_fg: LightCyan
dirty_fg: LightGreen
file_fg: LightWhite file_fg: LightWhite
symlink_fg: LightYellow symlink_fg: LightYellow

View File

@@ -8,9 +8,8 @@ alias ldocker="lazydocker"
alias conf="z ~/.config" alias conf="z ~/.config"
alias nixos="z /etc/nixos" alias nixos="z /etc/nixos"
alias store="z /nix/store" alias store="z /nix/store"
alias rustenv="nix-shell -p pkg-config openssl sqlite protobuf --run fish" # run this command first if you have trouble with openssl, sqlite or protobuf during compiling a rust project (more https://nixos.wiki/wiki/Rust#Building_Rust_crates_that_require_external_system_libraries)
alias nswitch="sudo nixos-rebuild switch --flake /etc/nixos" alias nswitch="sudo nixos-rebuild switch --flake /etc/nixos"
alias nswitchu="sudo nixos-rebuild switch --flake /etc/nixos --upgrade --update-input nixpkgs --update-input rust-overlay --commit-lock-file" alias nswitchu="sudo nixos-rebuild switch --flake /etc/nixos --update-input nixpkgs --update-input rust-overlay --update-input hyprland --commit-lock-file --upgrade "
alias ncsu="sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos" alias ncsu="sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos"
alias nsgc="sudo nix-store --gc" alias nsgc="sudo nix-store --gc"
alias ncg="sudo nix-collect-garbage -d" alias ncg="sudo nix-collect-garbage -d"

View File

@@ -1,4 +1,5 @@
function startup function autostart
pypr & \
wpaperd & \ wpaperd & \
waybar & \ waybar & \
poweralertd & \ poweralertd & \

View File

@@ -19,7 +19,7 @@ monitor=,preferred,auto,1.2
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch # Execute your favorite apps at launch
exec-once = fish -c startup exec-once = fish -c autostart
# Source a file (multi-file configs) # Source a file (multi-file configs)
@@ -195,7 +195,23 @@ submap=reset
# keybinds further down will be global again... # keybinds further down will be global again...
# Scrachpads
bind = $mainMod CTRL, T, exec, pypr toggle term
$dropterm = ^(wezterm_dropdown)$
windowrule = float, $dropterm
windowrule = workspace special:scratch_term silent, $dropterm
bind = $mainMod CTRL, V, exec, pypr toggle volume
$volume_sidemenu = ^(pavucontrol)$
windowrule = float, $volume_sidemenu
windowrule = workspace special:scratch_volume silent, $volume_sidemenu
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod CTRL, M, togglespecialworkspace, minimized
bind = $mainMod, M, exec, pypr toggle_minimized
bind = $mainMod CTRL, E, exec, pypr expose
bind = $mainMod, Z, exec, pypr zoom
bind = $mainMod, T, exec, wezterm bind = $mainMod, T, exec, wezterm
bind = $mainMod SHIFT, T, exec, telegram-desktop bind = $mainMod SHIFT, T, exec, telegram-desktop
bind = $mainMod, B, exec, qutebrowser bind = $mainMod, B, exec, qutebrowser

View File

@@ -0,0 +1,22 @@
[pyprland]
plugins = [
"scratchpads",
"magnify",
"expose",
]
[scratchpads.term]
command = "wezterm start --class wezterm_dropdown"
animation = "fromTop"
unfocus = "hide"
excludes = "*"
lazy = true
[scratchpads.volume]
command = "pavucontrol --class volume_sidemenu"
animation = "fromRight"
class = "volume_sidemenu"
size = "40% 70%"
unfocus = "hide"
excludes = "*"
lazy = true

View File

@@ -1 +1 @@
rustflags = ["-C", "link-arg=-fuse-ld=/path/to/mold", "-Zcodegen-backend=cranelift" ] # Change '/path/to/mold' and DON'T use it in production, only for dev needs rustflags = ["-C", "link-arg=-fuse-ld=/path/to/mold", "-Z", "threads=8" ] # Change '/path/to/mold', use with nightly version of Rust

View File

@@ -2,6 +2,7 @@
channel = "nightly" channel = "nightly"
components = [ "rust-src", "rust-analyzer", "rustc-codegen-cranelift", "miri", "llvm-tools", "rust-docs-json" ] components = [ "rust-src", "rust-analyzer", "rustc-codegen-cranelift", "miri", "llvm-tools", "rust-docs-json" ]
targets = [ targets = [
"wasm32-unknown-unknown",
"wasm32-wasi", "wasm32-wasi",
"wasm32-wasi-preview1-threads", "wasm32-wasi-preview1-threads",
"x86_64-pc-windows-gnu", "x86_64-pc-windows-gnu",

View File

@@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ pkgs, lib, ... }: { inputs, pkgs, lib, ... }:
{ {
imports = imports =
@@ -49,7 +49,10 @@
}; };
# # Enable Hyprland # # Enable Hyprland
programs.hyprland.enable = true; programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.sessionVariables.WLR_NO_HARDWARE_CURSORS = "1"; environment.sessionVariables.WLR_NO_HARDWARE_CURSORS = "1";
@@ -130,6 +133,8 @@
nix.settings = { nix.settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true; auto-optimise-store = true;
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
}; };
# Optimize storage and automatic scheduled GC running # Optimize storage and automatic scheduled GC running
@@ -141,7 +146,7 @@
nix.gc = { nix.gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "weekly";
options = "--delete-older-than 15d"; options = "--delete-older-than 7d";
}; };
# Change runtime directory size # Change runtime directory size
@@ -155,13 +160,14 @@
enable = true; enable = true;
operation = "switch"; # If you don't want to apply updates immediately, only after rebooting, use `boot` option in this case operation = "switch"; # If you don't want to apply updates immediately, only after rebooting, use `boot` option in this case
flake = "/etc/nixos"; flake = "/etc/nixos";
flags = [ "--update-input" "nixpkgs" "--update-input" "rust-overlay" "--commit-lock-file" ]; flags = [ "--update-input" "nixpkgs" "--update-input" "rust-overlay" "--update-input" "hyprland" "--commit-lock-file" ];
dates = "daily"; dates = "daily";
# channel = "https://nixos.org/channels/nixos-unstable"; # channel = "https://nixos.org/channels/nixos-unstable";
}; };
# Linux Kernel # Linux Kernel
boot.kernelPackages = pkgs.linuxKernel.packages.linux_zen; boot.kernelPackages = pkgs.linuxKernel.packages.linux_testing;
# Enable networking # Enable networking
networking.networkmanager = { networking.networkmanager = {
@@ -299,9 +305,10 @@
enable = true; enable = true;
dbus.enable = true; dbus.enable = true;
implicitPolicyTarget = "block"; implicitPolicyTarget = "block";
# FIXME: set yours pref USB devices # FIXME: set yours pref USB devices (change {id} to your trusted USB device), use `lsusb` command (from usbutils package) to get list of all connected USB devices including integrated devices like camera, bluetooth, wifi, etc. with their IDs
rules = '' rules = ''
allow id {id} allow id {id} # device 1
allow id {id} # device 2
''; '';
}; };
services.clamav = { services.clamav = {
@@ -552,6 +559,7 @@
htop htop
bottom bottom
btop btop
kmon
cmatrix cmatrix
pipes-rs pipes-rs
@@ -598,6 +606,7 @@
wtype wtype
wlrctl wlrctl
hyprpicker hyprpicker
pyprland
waybar waybar
rofi-wayland rofi-wayland
dunst dunst

View File

@@ -4,6 +4,7 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay"; rust-overlay.url = "github:oxalica/rust-overlay";
hyprland.url = "github:hyprwm/Hyprland";
}; };
outputs = { nixpkgs, rust-overlay, ... } @ inputs: outputs = { nixpkgs, rust-overlay, ... } @ inputs:

View File

@@ -1,9 +1,10 @@
[toolchain] [toolchain]
channel = "stable" channel = "nightly"
components = [ "rust-src", "rust-analyzer" ] components = [ "rust-src", "rust-analyzer", "rustc-codegen-cranelift", "miri", "llvm-tools", "rust-docs-json" ]
targets = [ targets = [
"wasm32-unknown-unknown", "wasm32-unknown-unknown",
"wasm32-wasi", "wasm32-wasi",
"wasm32-wasi-preview1-threads",
"x86_64-pc-windows-gnu", "x86_64-pc-windows-gnu",
"x86_64-unknown-linux-gnu", "x86_64-unknown-linux-gnu",
] ]