nixos-config/README.md

241 lines
9.8 KiB
Markdown
Raw Normal View History

2023-12-22 23:31:44 +01:00
<h1 align="center">
2024-01-01 22:21:52 +01:00
<img src="./.github/assets/logo/nixos-logo.png " width="100px" />
2023-12-22 23:31:44 +01:00
<br>
2024-06-21 10:19:01 +02:00
Ahwxorg/NixOS-config
2023-12-22 23:31:44 +01:00
<br>
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/palette/macchiato.png" width="600px" /> <br>
<div align="center">
<div align="center">
<p></p>
<div align="center">
<a href="https://github.com/Ahwxorg/nixos-config/stargazers">
<img src="https://img.shields.io/github/stars/Ahwxorg/nixos-config?color=F5BDE6&labelColor=303446&style=for-the-badge&logo=starship&logoColor=F5BDE6">
2023-12-22 23:31:44 +01:00
</a>
<a href="https://github.com/Ahwxorg/nixos-config/">
<img src="https://img.shields.io/github/repo-size/Ahwxorg/nixos-config?color=C6A0F6&labelColor=303446&style=for-the-badge&logo=github&logoColor=C6A0F6">
2023-12-22 23:31:44 +01:00
</a>
<a = href="https://nixos.org">
<img src="https://img.shields.io/badge/NixOS-unstable-blue.svg?style=for-the-badge&labelColor=303446&logo=NixOS&logoColor=white&color=91D7E3">
</a>
<a href="https://github.com/Ahwxorg/nixos-config/blob/main/LICENSE">
2023-12-22 23:31:44 +01:00
<img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&colorA=313244&colorB=F5A97F&logo=unlicense&logoColor=F5A97F&"/>
</a>
</div>
<br>
</div>
</h1>
2024-06-21 10:18:30 +02:00
### Gallery
2023-12-23 14:23:01 +01:00
2024-01-11 22:03:32 +01:00
<p align="center">
2024-09-04 16:48:54 +02:00
<img src="./.github/assets/screenshots/sakura-desktop.png" /> <br>
2024-04-15 17:51:23 +02:00
Screenshots last updated <b>2024-04-09</b>
2024-09-04 16:48:54 +02:00
</p>
2024-03-03 18:55:42 +01:00
2024-07-15 11:48:53 +02:00
# Overview
### Layout
- [flake.nix](flake.nix): base of the configuration
- [hosts](hosts): per-host configurations that contain machine specific configurations
- [desktop](hosts/desktop/): Desktop specific configuration
- [sakura](hosts/sakura/): Laptop (sakura) specific configuration
- [violet](hosts/violet/): Server (sakura) specific configuration
- [modules](modules): modularized NixOS configurations
- [core](modules/core/): core NixOS configuration
- [homes](modules/home/): my [Home-Manager](https://github.com/nix-community/home-manager) config
- [services](modules/services/): services ran on my servers
- [pkgs](flake/pkgs): packages exported by my flake
- [wallpapers](wallpapers/): wallpaper collection
### Components
2023-12-23 12:54:13 +01:00
| | NixOS + Hyprland |
2023-12-23 13:02:43 +01:00
| --------------------------- | :---------------------------------------------------------------------------------------------:
| **Window Manager** | [Hyprland][Hyprland] |
| **Bar** | [Waybar][waybar] |
2023-12-23 13:02:43 +01:00
| **Application Launcher** | [wofi][wofi] |
| **Notification Daemon** | [Mako][mako] |
| **Terminal Emulator** | [Kitty][kitty] |
| **Shell** | [zsh][zsh] |
2024-07-15 11:48:53 +02:00
| **Text Editor** | [Neovim][Neovim] + [VSCodium][VSCodium] |
2023-12-23 13:02:43 +01:00
| **network management tool** | [NetworkManager][NetworkManager] + [network-manager-applet][network-manager-applet] |
2024-07-15 11:48:53 +02:00
| **System resource monitor** | [htop][htop] |
| **File Manager** | [thunar][thunar]
| **Fonts** | [nerd fonts][Nerd fonts] |
| **Color Scheme** | [catppuccin][Catppuccin] |
2023-12-23 13:02:43 +01:00
| **Icons** | [catppuccin-papirus-folders][catppuccin-papirus-folders] |
2024-07-12 00:17:34 +02:00
| **Lockscreen** | [hyprlock][hyprlock] |
2024-06-21 10:18:30 +02:00
| **Image Viewer** | [nsxiv][nsxiv] |
2023-12-23 13:02:43 +01:00
| **Media Player** | [mpv][mpv] |
| **Screenshot Software** | [grimblast][grimblast] |
2024-04-13 17:11:10 +02:00
| **Clipboard** | [wl-clip-persist][wl-clip-persist] |
2023-12-23 13:02:43 +01:00
| **Color Picker** | [hyprpicker][hyprpicker] |
2023-12-23 12:54:13 +01:00
2024-01-12 18:38:37 +01:00
2024-07-15 11:48:53 +02:00
### Shell aliases
2024-01-12 18:38:37 +01:00
<details>
<summary>
2024-06-21 10:18:30 +02:00
NixOS (expand)
2024-01-12 18:38:37 +01:00
</summary>
> TODO: ${host} is either `desktop` or `laptop`
2024-04-15 17:30:05 +02:00
2024-01-12 18:47:31 +01:00
- ```cdnix``` $\rightarrow$ ```cd ~/nixos-config && codium ~/nixos-config```
2024-03-16 21:19:11 +01:00
- ```ns``` $\rightarrow$ ```nix-shell --run zsh```
2024-04-15 17:30:05 +02:00
- ```nix-switch``` $\rightarrow$ ```sudo nixos-rebuild switch --flake ~/nixos-config#${host}```
- ```nix-switchu``` $\rightarrow$ ```sudo nixos-rebuild switch --upgrade --flake ~/nixos-config#${host}```
2024-01-12 18:47:31 +01:00
- ```nix-flake-update``` $\rightarrow$ ```sudo nix flake update ~/nixos-config#```
- ```nix-clean``` $\rightarrow$ ```sudo nix-collect-garbage && sudo nix-collect-garbage -d && sudo rm /nix/var/nix/gcroots/auto/* && nix-collect-garbage && nix-collect-garbage -d```
2024-01-12 18:38:37 +01:00
</details>
2024-07-15 11:48:53 +02:00
### Scripts
2023-12-22 23:31:44 +01:00
2024-01-12 18:47:31 +01:00
All the scripts are in ```modules/home/scripts/scripts/``` and are exported as packages in ```modules/home/scripts/default.nix```
2024-01-12 18:38:37 +01:00
2024-01-13 16:00:03 +01:00
<details>
<summary>
2024-01-13 16:05:38 +01:00
toggle_blur.sh
2024-01-13 16:00:03 +01:00
</summary>
2024-01-13 16:01:57 +01:00
**Description:** This script toggles the Hyprland blur effect. If the blur is currently enabled, it will be disabled, and if it's disabled, it will be turned on.
2024-01-13 16:05:38 +01:00
**Usage:** ```toggle_blur```
2024-01-13 16:00:03 +01:00
</details>
<details>
<summary>
2024-01-13 16:05:38 +01:00
toggle_oppacity.sh
2024-01-13 16:00:03 +01:00
</summary>
2024-01-13 16:01:57 +01:00
**Description:** This script toggles the Hyperland oppacity effect. If the oppacity is currently set to 0.90, it will be set to 1, and if it's set to 1, it will be set to 0.90.
2024-01-13 16:05:38 +01:00
**Usage:** ```toggle_oppacity```
2024-01-13 16:00:03 +01:00
</details>
<details>
<summary>
runbg.sh
</summary>
2024-01-13 16:01:57 +01:00
**Description:** This script runs a provided command along with its arguments and detaches it from the terminal. Handy for launching apps from the command line without blocking it.
2024-01-13 16:00:03 +01:00
**Usage:** ```runbg <command> <arg1> <arg2> <...>```
</details>
2024-07-15 11:48:53 +02:00
# Installation
2024-01-13 17:40:30 +01:00
2024-06-21 10:18:30 +02:00
> This is unchanged of Frost-Phoenix's dots, needs to be remade but don't feel like spending that time currently.
2024-01-13 18:14:27 +01:00
> **⚠️ Use this configuration at your own risk! ⚠️** <br>
> Applying custom configurations, especially those related to your operating system, can have unexpected consequences and may interfere with your system's normal behavior. While I have tested these configurations on my own setup, there is no guarantee that they will work flawlessly on all systems. <br>
> **I am not responsible for any issues that may arise from using this configuration.**
2024-01-13 17:40:30 +01:00
2024-01-13 18:05:26 +01:00
> It is highly recommended to review the configuration contents and make necessary modifications to customize it to your needs before attempting the installation.
2024-01-13 17:40:30 +01:00
2024-06-21 10:18:30 +02:00
1. **Install NixOS**
2024-01-13 18:05:26 +01:00
First install nixos using any [graphical ISO image](https://nixos.org/download.html#nixos-iso).
> Only been tested using the Gnome graphical installer and choosing the ```No desktop``` option durring instalation.
2024-01-13 21:53:48 +01:00
2. **Clone the repo**
2024-01-13 18:05:26 +01:00
```
2024-01-13 22:03:51 +01:00
nix-shell -p git
2024-01-13 18:05:26 +01:00
git clone https://github.com/Frost-Phoenix/nixos-config
cd nixos-config
```
2024-01-13 21:53:48 +01:00
3. **Install script**
2024-01-13 18:05:26 +01:00
2024-04-19 09:04:53 +02:00
> First make sure to read the install script, it isn't long
2024-01-13 18:17:17 +01:00
2024-01-13 18:05:26 +01:00
Execute and follow the installation script :
```
2024-04-19 09:04:53 +02:00
./install.sh
2024-01-13 18:05:26 +01:00
```
2024-04-19 09:04:53 +02:00
> You will need to change the git account yourself in ./modules/home/git.nix
2024-01-16 20:47:05 +01:00
```
programs.git = {
...
userName = "Frost-Phoenix";
userEmail = "67cyril6767@gmail.com";
...
};
```
2024-01-13 21:53:48 +01:00
4. **Reboot**
2024-07-15 11:48:53 +02:00
After rebooting, you'll be greeted by hyprlock prompting for your password, with its wallpaper in the background.
2024-01-13 21:53:48 +01:00
2024-04-16 14:11:15 +02:00
5. **Manual config**
Even though I use home manager, there is still a little bit of manual configuration to do:
- Set Aseprite theme (they are in the folder `./nixos-config/modules/home/aseprite/themes`).
- Enable Discord theme (in Discord settings under VENCORD > Themes).
- Configure the browser (for now, all browser configuration is done manually).
2024-01-13 21:53:48 +01:00
### Install script walkthrough
A brief walkthrough of what the install script does.
1. **Get username**
You will receive a prompt to enter your username, with a confirmation check.
2. **Set username**
The script will replace all occurancies of the default usename ```CURRENT_USERNAME``` by the given one stored in ```$username```
3. Create basic directories
The following directories will be created:
- ```~/Music```
- ```~/Documents```
- ```~/Pictures/wallpapers/others```
4. Copy the wallpapers
2024-04-08 21:14:17 +02:00
Then the wallpapers will be copied into ```~/Pictures/wallpapers/others``` which is the folder in which the ```wallpaper-picker.sh``` script will be looking for them.
2024-01-13 21:53:48 +01:00
5. Get the hardware configuration
It will also automatically copy the hardware configuration from ```/etc/nixos/hardware-configuration.nix``` to ```./hosts/nixos/hardware-configuration.nix``` so that the hardware configuration used is yours and not the default one.
6. Choose a host (desktop / laptop)
2024-04-15 17:34:25 +02:00
Now you will need to choose the host you want. It depend on whether you are using a desktop or laptop.
7. Build the system
2024-01-13 21:53:48 +01:00
Lastly, it will build the system, which includes both the flake config and home-manager config.
2024-01-13 17:40:30 +01:00
2024-01-11 22:03:32 +01:00
# 👥 Credits
2023-12-22 23:31:44 +01:00
2023-12-23 14:23:01 +01:00
Other dotfiles that I learned / copy from:
2023-12-22 23:31:44 +01:00
- [Frost-Phoenix/nixos-config](https://github.com/Frost-Phoenix/nixos-config): This is the repository that I cloned and changed to my needs. Their credits are in their repository's readme.
2024-06-21 10:33:13 +02:00
- [notthebee/nix-config](https://github.com/notthebee/nix-config)
2023-12-23 12:54:13 +01:00
<!-- Links -->
[Hyprland]: https://github.com/hyprwm/Hyprland
[Kitty]: https://github.com/kovidgoyal/kitty
[Waybar]: https://github.com/Alexays/Waybar
[wofi]: https://hg.sr.ht/~scoopta/wofi
[zsh]: https://ohmyz.sh/
2024-07-12 00:17:34 +02:00
[hyprlock]: https://github.com/hyprwm/Hyprlock
2023-12-23 12:54:13 +01:00
[mpv]: https://github.com/mpv-player/mpv
[VSCodium]:https://vscodium.com/
[Neovim]: https://github.com/neovim/neovim
[grimblast]: https://github.com/hyprwm/contrib
2024-07-15 11:48:53 +02:00
[htop]: https://github.com/htop-dev/htop
[thunar]: https://docs.xfce.org/xfce/thunar/start
[nsxiv]: https://nsxiv.codeberg.page
[mako]: https://github.com/emersion/mako
[nerd fonts]: https://github.com/ryanoasis/nerd-fonts
2023-12-23 12:54:13 +01:00
[NetworkManager]: https://wiki.gnome.org/Projects/NetworkManager
[network-manager-applet]: https://gitlab.gnome.org/GNOME/network-manager-applet/
2024-04-13 17:11:10 +02:00
[wl-clip-persist]: https://github.com/Linus789/wl-clip-persist
2023-12-23 12:54:13 +01:00
[hyprpicker]: https://github.com/hyprwm/hyprpicker
[catppuccin]: https://github.com/catppuccin/catppuccin
2023-12-23 12:54:13 +01:00
[catppuccin-papirus-folders]: https://github.com/catppuccin/papirus-folders