This commit is contained in:
Hadi 2024-08-30 15:47:17 +02:00
parent f0e9294982
commit da1b88305d
25 changed files with 122 additions and 37476 deletions

View File

@ -15,7 +15,7 @@ The configurations files can be found in the `hosts/laptop` directory.
| | hypridle | | | hypridle |
| | hyprcursor | | | hyprcursor |
| | wlogout | | | wlogout |
| Bar | waybar | | Bar | hyprpanel |
| Terminal | kitty | | Terminal | kitty |
| Shell | zsh | | Shell | zsh |
| | tmux | | | tmux |
@ -25,32 +25,17 @@ The configurations files can be found in the `hosts/laptop` directory.
| | zoxide | | | zoxide |
| | fzf | | | fzf |
| Editor | neovim(nixvim) | | Editor | neovim(nixvim) |
| File manager | lf | | File manager | thunar |
| | thunar |
| Browser | qutebrowser | | Browser | qutebrowser |
| Music | spicetify | | Music | spicetify |
| Notifications | dunst |
| Launcher | wofi | | Launcher | wofi |
| DM | tuigreet | | DM | tuigreet |
| Secrets | sops-nix | | Secrets | sops-nix |
| Misc | lazygit |
| | neofetch |
| | cava |
| See [hosts/laptop](../hosts/laptop/)... | | | See [hosts/laptop](../hosts/laptop/)... | |
## Server ## Server
The server configuration is used by a home server running NixOS. The server configuration is used by a home server running NixOS.
The configurations files can be found in the `hosts/server` directory. The configurations files can be found in the `hosts/server` directory.
I mainly use it for self-hosting websites and services such as Nextcloud, Vaultwarden, ... I mainly use it for self-hosting websites and services such as Nextcloud, Vaultwarden, jellyfin, ...
I exposed some services to the internet using a reverse proxy (Nginx) and cloudflare-dyndns, others are accessed through a tailscale network I exposed some services to the internet using a reverse proxy (Nginx) and cloudflare-dyndns, others are accessed through a tailscale network
### Apps
- Nextcloud
- Vaultwarden
- Adguard Home
- Uptime Kuma
- "Jackflix"
- Jellyfin, Transmission, *arr
- See [hosts/server](../hosts/server/)...

View File

@ -1,6 +1,6 @@
# Scripts # Scripts
Scripts are located in the `home/scripts` folder. Home-manager add those in the path. Scripts are located in the `home/scripts` folder. Home-manager add those in the user's path.
## Nix/NixOs shortcuts ## Nix/NixOs shortcuts
@ -18,14 +18,15 @@ Scripts are located in the `home/scripts` folder. Home-manager add those in the
- `brightness-up` - `brightness-up`
- `brightness-down` - `brightness-down`
- `brightness-change <up/down> <increment>` - `brightness-set [value]`
- `brightness-change [up/down] <increment>`
## Sound control ## Sound control
- `sound-up` - `sound-up`
- `sound-down` - `sound-down`
- `sound-toggle` - `sound-toggle`
- `sound-output` - `sound-set [value]`
- `sound-change [up/down/mute] <increment>` - `sound-change [up/down/mute] <increment>`
## Caffeine ## Caffeine
@ -33,14 +34,16 @@ Scripts are located in the `home/scripts` folder. Home-manager add those in the
Caffeine is a simple script that toggles hypridle (disable suspend & screenlock). Caffeine is a simple script that toggles hypridle (disable suspend & screenlock).
- `caffeine` # Toggle caffeine - `caffeine` # Toggle caffeine
- `caffeine-status` # Return active/inactive - `caffeine-status` # Return 1/0
- `caffeine-status-icon` # Return 󰅶/󰾪
## Night-Shift ## Night-Shift
Blue light filter, using wlsunset Blue light filter, using wlsunset
- `night-shift` # Toggle night shift - `night-shift` # Toggle night shift
- `night-shift-status` # Return active/inactive - `night-shift-status` # Return 1/0
- `night-shift-status-icon` # Return 󰖕/󰖔
- `night-shift-on` - `night-shift-on`
- `night-shift-off` - `night-shift-off`
@ -50,10 +53,3 @@ Nerdfont fzf is a quick way to search for nerdfont icons locally.
It will copy the selected icon to the clipboard. It will copy the selected icon to the clipboard.
- `nerdfont-fzf` - `nerdfont-fzf`
## Compress/Extract
Some shortcuts to compress and extract files.
- `compress` ...
- `extract` ...

View File

@ -18,15 +18,3 @@ Wallpapers are loaded from the `home/wallpapers` folder.
![nixy1](src/nixy/1.png) ![nixy1](src/nixy/1.png)
![nixy2](src/nixy/2.png) ![nixy2](src/nixy/2.png)
![nixy3](src/nixy/3.png) ![nixy3](src/nixy/3.png)
### Catppuccin
![catppuccin1](src/catppuccin/1.png)
![catppuccin2](src/catppuccin/2.png)
![catppuccin3](src/catppuccin/3.png)
### Windows
![windows1](src/windows/1.png)
![windows2](src/windows/2.png)
![windows3](src/windows/3.png)

View File

@ -2,11 +2,7 @@
feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md)) feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md))
- [ ] Nixy
- [ ] Themes
- [ ] Clipse: clipboard manager - [ ] Clipse: clipboard manager
- [ ] Swaync implementation
- [ ] Rofi config - [ ] Rofi config
- [ ] Qutebrowser - [ ] Qutebrowser
@ -14,10 +10,11 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md))
- [ ] Hyprland - [ ] Hyprland
- [ ] Implement Hyprcursor - [ ] Implement Hyprcursor
- [ ] Animation based on app name
- [ ] wofi: popin - [ ] wofi: popin
- [ ] wlogout: fade in - [ ] wlogout: fade in
- [ ] Fix screenshots (screenshot region's border shows up in the screenshot, hyprshot jq error?) - [ ] Fix screenshots (screenshot region's border shows up in the screenshot, hyprshot jq error?) and add in the scripts doc
- [ ] Hyprlock themes (repo hyprlock-styles on github) - [ ] Fix Night Shift
- [ ] Nixvim - [ ] Nixvim
- [ ] Keymaps: - [ ] Keymaps:
@ -32,3 +29,4 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md))
- Take a look into buildarr or build a custom solution with *arr apis - Take a look into buildarr or build a custom solution with *arr apis
- [ ] Bitcoin-git: broken - [ ] Bitcoin-git: broken
- [ ] Secrets mode 0444: not secure - [ ] Secrets mode 0444: not secure
- [ ] Adguard config

View File

@ -8,22 +8,34 @@ It's a simple way to manage your system configuration and dotfiles.
## Gallery ## Gallery
![catppuccin1](docs/src/catppuccin/1.png) ![nixy1](docs/src/nixy/1.png)
![catppuccin2](docs/src/catppuccin/2.png) ![nixy2](docs/src/nixy/2.png)
![catppuccin3](docs/src/catppuccin/3.png) ![nixy3](docs/src/nixy/3.png)
## Architecture ## Architecture
- 🏠 `home` are the dotfiles and configuration files for the users ### 🏠 `home`
- 'programs' is a collection of apps configured with home-manager
- 'scripts' is a folder full of bash scripts (see [SCRIPTS.md](docs/SCRIPTS.md)) Those are the dotfiles and configuration files for user-level configuration
- 'system' is some "desktop environment" configuration
- 'wallpapers' are... wallpapers **Subfolders:**
- 💻 `hosts` are the system configuration files
- 'laptop' is my configuration for my laptop with Nvidia that you can copy - `programs` is a collection of apps configured with home-manager
- 'server' is for my homeserver (w/nextcloud, nginx, vaultwarden, ... look `hosts/server`) - `scripts` is a folder full of bash scripts (see [SCRIPTS.md](docs/SCRIPTS.md))
- 'themes' contains all the *themes* available *(see [THEMES.md](docs/THEMES.md))* - `system` is some "desktop environment" configuration
- 'modules' are some nix modules that you can import (Nvidia, prime, fonts, ...) - `wallpapers` are... wallpapers
### 💻 `hosts`
Those are the host-specific configurations
Each host contains a `configuration.nix` for system-level configuration, a `home.nix` for user-level configuration, and a `variables.nix` for config wide variables.
**Subfolders:**
- 🎨 `themes` are the themes available *(see [THEMES.md](docs/THEMES.md))*
- 📦 `modules` are the nix modules that you can import
- `laptop` is my configuration for my laptop with Nvidia that you can copy
- `server` is for my homeserver (w/nextcloud, nginx, vaultwarden, ...)
## Installation ## Installation

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 617 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 990 KiB

View File

@ -318,11 +318,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1725016246, "lastModified": 1725019943,
"narHash": "sha256-hAebBhn28+PzBeqi8n3CSHuLTiIL3OJU0kFtruN/sT8=", "narHash": "sha256-tAGs6TpIYkRUWjU0WYAavzHCPy4XLLMn63caFF7OCNc=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "ef33198e8f9fa874b3ad2e2775f8474af62d7fee", "rev": "25e72949a1cc2368425ed81712a394cb277f514f",
"revCount": 5158, "revCount": 5160,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
@ -425,15 +425,15 @@
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1725018968, "lastModified": 1725006826,
"narHash": "sha256-/NshXiZv436Hh1Vn71AnjCLJ4DMxCSmrdI4wHOY5cLU=", "narHash": "sha256-DO9Sxg+HP7Iy/TguZtjwXRjlH35liWXEuG17ilcJejI=",
"owner": "anotherhadi", "owner": "Jas-SinghFSU",
"repo": "HyprPanel", "repo": "HyprPanel",
"rev": "af5011471b9a2a2ba50ec82623b506af14fa96f7", "rev": "4bd5c3ed30ae643ac1dee152f8b9332d0c5c3eb9",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "anotherhadi", "owner": "Jas-SinghFSU",
"repo": "HyprPanel", "repo": "HyprPanel",
"type": "github" "type": "github"
} }

View File

@ -4,10 +4,12 @@ let
increments = "5"; increments = "5";
brightness-change = pkgs.writeShellScriptBin "brightness-change" '' brightness-change = pkgs.writeShellScriptBin "brightness-change" ''
sleep 0.05 [[ $1 == "up" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ''${2-${increments}}%+
[[ $1 == "down" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ''${2-${increments}}%-
'';
[[ $1 == "up" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ${increments}%+ brightness-set = pkgs.writeShellScriptBin "brightness-set" ''
[[ $1 == "down" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ${increments}%- ${pkgs.brightnessctl}/bin/brightnessctl set ''${1-100}%
''; '';
brightness-up = pkgs.writeShellScriptBin "brightness-up" '' brightness-up = pkgs.writeShellScriptBin "brightness-up" ''
@ -18,4 +20,12 @@ let
brightness-change down ${increments} brightness-change down ${increments}
''; '';
in { home.packages = [ brightness-change brightness-up brightness-down ]; } in {
home.packages = [
pkgs.brightnessctl
brightness-change
brightness-up
brightness-down
brightness-set
];
}

View File

@ -1,29 +1,25 @@
{ pkgs, ... }: { pkgs, ... }:
let let
caffeine-status = pkgs.writeShellScriptBin "caffeine-status" '' caffeine-status = pkgs.writeShellScriptBin "caffeine-status" ''
[[ -f /tmp/caffeine ]] && echo "1" || echo "0" [[ $(pidof "hypridle") ]] && echo "0" || echo "1"
'';
caffeine = pkgs.writeShellScriptBin "caffeine" ''
if [[ -f /tmp/caffeine ]]; then
rm /tmp/caffeine
${pkgs.hyprland}/bin/hyprctl dispatch exec ${pkgs.hypridle}/bin/hypridle
message="󰾪 Caffeine Deactivated"
else
touch /tmp/caffeine
pkill hypridle
message="󰅶 Caffeine Activated"
fi
notif "caffeine" "$message"
''; '';
caffeine-status-icon = pkgs.writeShellScriptBin "caffeine-status-icon" '' caffeine-status-icon = pkgs.writeShellScriptBin "caffeine-status-icon" ''
status=$(caffeine-status) [[ $(pidof "hypridle") ]] && echo "󰾪" || echo "󰅶"
if [[ $status == "1" ]]; then '';
echo "󰅶"
caffeine = pkgs.writeShellScriptBin "caffeine-toggle" ''
if [[ $(pidof "hypridle") ]]; then
pkill hypridle
title="󰅶 Caffeine Activated"
description="Caffeine is now active! Your screen will not turn off automatically."
else else
echo "󰾪" ${pkgs.hyprland}/bin/hyprctl dispatch exec ${pkgs.hypridle}/bin/hypridle
title="󰾪 Caffeine Deactivated"
description="Caffeine is now deactivated! Your screen will turn off automatically."
fi fi
notif "caffeine" "$title" "$description"
''; '';
in { home.packages = [ caffeine-status caffeine caffeine-status-icon ]; } in { home.packages = [ caffeine-status caffeine caffeine-status-icon ]; }

View File

@ -1,22 +0,0 @@
# From https://github.com/Frost-Phoenix/nixos-config
{ pkgs, ... }:
let
compress = pkgs.writeShellScriptBin "compress" ''
if (( $# == 1 )) then
# echo -ne "Archive name: "
# read name
# tar -cvzf "$name.tar.gz" $1
tar -cvzf "$1.tar.gz" $1
else
echo "Wrong number of arguments..."
fi
'';
extract = pkgs.writeShellScriptBin "extract" ''
for i in "$@" ; do
tar -xvzf $i
break
done
'';
in { home.packages = [ compress extract ]; }

View File

@ -8,7 +8,6 @@
./screenshot ./screenshot
./nerdfont_fzf ./nerdfont_fzf
./notification ./notification
./compress
./system ./system
]; ];
} }

View File

@ -12,21 +12,15 @@ let
fi fi
echo "Copied to clipboard: $fzf_result" echo "Copied to clipboard: $fzf_result"
echo "Paste it to close the window" ${pkgs.wl-clipboard}/bin/wl-copy "$fzf_result" # wait for paste before exiting.. not cool
${pkgs.wl-clipboard}/bin/wl-copy -o "$fzf_result" # wait for paste before exiting.. not cool
''; '';
nerdfont-fzf-fetch = pkgs.writeShellScriptBin "nerdfont-fzf-fetch" '' nerdfont-fzf-fetch = pkgs.writeShellScriptBin "nerdfont-fzf-fetch" ''
wget "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/glyphnames.json" -O "glyphnames.json" || exit 1 wget "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/glyphnames.json" -O "glyphnames.json" || exit 1
jq 'del(.METADATA)' "glyphnames.json" jq 'del(.METADATA)' "glyphnames.json"
''; '';
nerdfont-popup = pkgs.writeShellScriptBin "nerdfont-popup" ''
${pkgs.kitty}/bin/kitty --class floating -o font_size=18 zsh -c nerdfont-fzf 2>/dev/null
'';
in { in {
home.packages = [ nerdfont-fzf nerdfont-fzf-fetch nerdfont-popup ]; home.packages = [ nerdfont-fzf nerdfont-fzf-fetch ];
xdg.configFile."nerdfont_glyphnames.json" = { xdg.configFile."nerdfont_glyphnames.json" = {
source = ./nerdfont_glyphnames.json; source = ./nerdfont_glyphnames.json;

File diff suppressed because one or more lines are too long

View File

@ -41,6 +41,7 @@ let
''; '';
in { in {
home.packages = [ home.packages = [
pkgs.wlsunset
night-shift-on night-shift-on
night-shift-off night-shift-off
night-shift night-shift

View File

@ -1,7 +1,5 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
let let
nixy = pkgs.writeShellScriptBin "nixy" '' nixy = pkgs.writeShellScriptBin "nixy" ''
function exec() { function exec() {
$@ $@

View File

@ -1,27 +1,25 @@
{ pkgs, ... }: { pkgs, ... }:
let let
notif = pkgs.writeShellScriptBin "notif" '' notif = pkgs.writeShellScriptBin "notif" # bash
''
# Shell script to send custom notifications # Shell script to send custom notifications
# Usage: notif "sender_id" "message" ["description"]
NOTIF_FOLDER="/tmp/notif" NOTIF_FOLDER="/tmp/notif"
sender_id=$1 # To overwrite existing notifications sender_id=$1 # To overwrite existing notifications
message=$2 title=$2
extraargs="" description=$3
description=""
if [[ $3 == "extraargs="* ]]; then
extraargs=$(echo "$3" | sed 's/extraargs=//g')
else
description="$3"
extraargs="$4"
fi
[[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER [[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER
[[ -f "$NOTIF_FOLDER/$sender_id" ]] || echo "0" > "$NOTIF_FOLDER/$sender_id" [[ -f "$NOTIF_FOLDER/$sender_id" ]] || echo "0" > "$NOTIF_FOLDER/$sender_id"
old_notification_id=$(cat "$NOTIF_FOLDER/$sender_id") old_notification_id=$(cat "$NOTIF_FOLDER/$sender_id")
${pkgs.libnotify}/bin/notify-send "$message" \ ${pkgs.libnotify}/bin/notify-send \
$extraargs \ --replace-id="$old_notification_id" --print-id \
--replace-id="$old_notification_id" --print-id > "$NOTIF_FOLDER/$sender_id" --app-name="$sender_id" \
"$title" \
"$description" \
> "$NOTIF_FOLDER/$sender_id"
''; '';
in { home.packages = [ notif ]; } in { home.packages = [ pkgs.libnotify notif ]; }

View File

@ -4,17 +4,20 @@ let
increments = "5"; increments = "5";
sound-change = pkgs.writeShellScriptBin "sound-change" '' sound-change = pkgs.writeShellScriptBin "sound-change" ''
sleep 0.05
[[ $1 == "mute" ]] && wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle [[ $1 == "mute" ]] && wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
[[ $1 == "up" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ "$2%+" [[ $1 == "up" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%+
[[ $1 == "down" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ "$2%-" [[ $1 == "down" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%-
[[ $1 == "set" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-100}%
''; '';
sound-up = pkgs.writeShellScriptBin "sound-up" '' sound-up = pkgs.writeShellScriptBin "sound-up" ''
sound-change up ${increments} sound-change up ${increments}
''; '';
sound-set = pkgs.writeShellScriptBin "sound-set" ''
sound-change set ''${1-100}
'';
sound-down = pkgs.writeShellScriptBin "sound-down" '' sound-down = pkgs.writeShellScriptBin "sound-down" ''
sound-change down ${increments} sound-change down ${increments}
''; '';
@ -22,4 +25,6 @@ let
sound-toggle = pkgs.writeShellScriptBin "sound-toggle" '' sound-toggle = pkgs.writeShellScriptBin "sound-toggle" ''
sound-change mute sound-change mute
''; '';
in { home.packages = [ sound-change sound-up sound-down sound-toggle ]; } in {
home.packages = [ sound-change sound-up sound-down sound-toggle sound-set ];
}

View File

@ -18,7 +18,6 @@
wl-clipboard wl-clipboard
brightnessctl brightnessctl
gnome-themes-extra gnome-themes-extra
wlsunset
qt5ct qt5ct
libva libva
dconf dconf

View File

@ -4,29 +4,27 @@
./variables.nix ./variables.nix
# Programs # Programs
../../home/programs/btop
../../home/programs/cava
../../home/programs/kitty ../../home/programs/kitty
../../home/programs/nextcloud
../../home/programs/nvim ../../home/programs/nvim
../../home/programs/qutebrowser ../../home/programs/qutebrowser
# ../../home/programs/spicetify TODO: broken
../../home/programs/shell ../../home/programs/shell
../../home/programs/fetch ../../home/programs/fetch
../../home/programs/lf
../../home/programs/git ../../home/programs/git
../../home/programs/yazi # ../../home/programs/spicetify TODO: broken
../../home/programs/btop
../../home/programs/cava
../../home/programs/nextcloud
# Scripts # Scripts
../../home/scripts # All scripts ../../home/scripts # All scripts
# System (Desktop environment like stuff) # System (Desktop environment like stuff)
../../home/system/gtk
../../home/system/batsignal
../../home/system/zathura
../../home/system/hyprland ../../home/system/hyprland
../../home/system/gtk
../../home/system/wlogout ../../home/system/wlogout
../../home/system/wofi ../../home/system/wofi
../../home/system/batsignal
../../home/system/zathura
../../home/system/mime ../../home/system/mime
../../home/system/udiskie ../../home/system/udiskie
@ -38,13 +36,12 @@
inherit (config.var) homeDirectory; inherit (config.var) homeDirectory;
packages = with pkgs; [ packages = with pkgs; [
# Apps
discord discord
xfce.thunar xfce.thunar
bitwarden bitwarden
vlc vlc
nextcloud-client # nextcloud-client # TODO: test if needed
tailscale
wireguard-tools
# Dev # Dev
go go
@ -62,6 +59,7 @@
optipng optipng
pfetch pfetch
pandoc pandoc
tailscale
# Just cool # Just cool
peaclock peaclock
@ -81,7 +79,7 @@
source = ../../home/wallpapers; source = ../../home/wallpapers;
}; };
# Import or profile picture # Import my profile picture, used by the hyprpanel dashboard
file.".profile_picture.png" = { source = ./profile_picture.png; }; file.".profile_picture.png" = { source = ./profile_picture.png; };
# Don't touch this # Don't touch this

View File

@ -15,7 +15,7 @@
# internal # internal
./modules/internal/security.nix ./modules/internal/security.nix
./modules/internal/openssh.nix ./modules/internal/openssh.nix
# ./modules/internal/adguard.nix # TODO # ./modules/internal/adguard.nix
# ./modules/internal/cockpit.nix # ./modules/internal/cockpit.nix
# exposed # exposed