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 |
| | hyprcursor |
| | wlogout |
| Bar | waybar |
| Bar | hyprpanel |
| Terminal | kitty |
| Shell | zsh |
| | tmux |
@ -25,32 +25,17 @@ The configurations files can be found in the `hosts/laptop` directory.
| | zoxide |
| | fzf |
| Editor | neovim(nixvim) |
| File manager | lf |
| | thunar |
| File manager | thunar |
| Browser | qutebrowser |
| Music | spicetify |
| Notifications | dunst |
| Launcher | wofi |
| DM | tuigreet |
| Secrets | sops-nix |
| Misc | lazygit |
| | neofetch |
| | cava |
| See [hosts/laptop](../hosts/laptop/)... | |
## Server
The server configuration is used by a home server running NixOS.
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
### Apps
- Nextcloud
- Vaultwarden
- Adguard Home
- Uptime Kuma
- "Jackflix"
- Jellyfin, Transmission, *arr
- See [hosts/server](../hosts/server/)...

View File

@ -1,6 +1,6 @@
# 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
@ -18,14 +18,15 @@ Scripts are located in the `home/scripts` folder. Home-manager add those in the
- `brightness-up`
- `brightness-down`
- `brightness-change <up/down> <increment>`
- `brightness-set [value]`
- `brightness-change [up/down] <increment>`
## Sound control
- `sound-up`
- `sound-down`
- `sound-toggle`
- `sound-output`
- `sound-set [value]`
- `sound-change [up/down/mute] <increment>`
## 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` # Toggle caffeine
- `caffeine-status` # Return active/inactive
- `caffeine-status` # Return 1/0
- `caffeine-status-icon` # Return 󰅶/󰾪
## Night-Shift
Blue light filter, using wlsunset
- `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-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.
- `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)
![nixy2](src/nixy/2.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))
- [ ] Nixy
- [ ] Themes
- [ ] Clipse: clipboard manager
- [ ] Swaync implementation
- [ ] Rofi config
- [ ] Qutebrowser
@ -14,10 +10,11 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md))
- [ ] Hyprland
- [ ] Implement Hyprcursor
- [ ] Animation based on app name
- [ ] wofi: popin
- [ ] wlogout: fade in
- [ ] Fix screenshots (screenshot region's border shows up in the screenshot, hyprshot jq error?)
- [ ] Hyprlock themes (repo hyprlock-styles on github)
- [ ] Fix screenshots (screenshot region's border shows up in the screenshot, hyprshot jq error?) and add in the scripts doc
- [ ] Fix Night Shift
- [ ] Nixvim
- [ ] 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
- [ ] Bitcoin-git: broken
- [ ] 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
![catppuccin1](docs/src/catppuccin/1.png)
![catppuccin2](docs/src/catppuccin/2.png)
![catppuccin3](docs/src/catppuccin/3.png)
![nixy1](docs/src/nixy/1.png)
![nixy2](docs/src/nixy/2.png)
![nixy3](docs/src/nixy/3.png)
## Architecture
- 🏠 `home` are the dotfiles and configuration files for the users
- 'programs' is a collection of apps configured with home-manager
- 'scripts' is a folder full of bash scripts (see [SCRIPTS.md](docs/SCRIPTS.md))
- 'system' is some "desktop environment" configuration
- 'wallpapers' are... wallpapers
- 💻 `hosts` are the system configuration files
- 'laptop' is my configuration for my laptop with Nvidia that you can copy
- 'server' is for my homeserver (w/nextcloud, nginx, vaultwarden, ... look `hosts/server`)
- 'themes' contains all the *themes* available *(see [THEMES.md](docs/THEMES.md))*
- 'modules' are some nix modules that you can import (Nvidia, prime, fonts, ...)
### 🏠 `home`
Those are the dotfiles and configuration files for user-level configuration
**Subfolders:**
- `programs` is a collection of apps configured with home-manager
- `scripts` is a folder full of bash scripts (see [SCRIPTS.md](docs/SCRIPTS.md))
- `system` is some "desktop environment" configuration
- `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

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

View File

@ -4,10 +4,12 @@ let
increments = "5";
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}%+
[[ $1 == "down" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ${increments}%-
brightness-set = pkgs.writeShellScriptBin "brightness-set" ''
${pkgs.brightnessctl}/bin/brightnessctl set ''${1-100}%
'';
brightness-up = pkgs.writeShellScriptBin "brightness-up" ''
@ -18,4 +20,12 @@ let
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, ... }:
let
caffeine-status = pkgs.writeShellScriptBin "caffeine-status" ''
[[ -f /tmp/caffeine ]] && echo "1" || echo "0"
'';
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"
[[ $(pidof "hypridle") ]] && echo "0" || echo "1"
'';
caffeine-status-icon = pkgs.writeShellScriptBin "caffeine-status-icon" ''
status=$(caffeine-status)
if [[ $status == "1" ]]; then
echo "󰅶"
[[ $(pidof "hypridle") ]] && echo "󰾪" || 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
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
notif "caffeine" "$title" "$description"
'';
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
./nerdfont_fzf
./notification
./compress
./system
];
}

View File

@ -12,21 +12,15 @@ let
fi
echo "Copied to clipboard: $fzf_result"
echo "Paste it to close the window"
${pkgs.wl-clipboard}/bin/wl-copy -o "$fzf_result" # wait for paste before exiting.. not cool
${pkgs.wl-clipboard}/bin/wl-copy "$fzf_result" # wait for paste before exiting.. not cool
'';
nerdfont-fzf-fetch = pkgs.writeShellScriptBin "nerdfont-fzf-fetch" ''
wget "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/glyphnames.json" -O "glyphnames.json" || exit 1
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 {
home.packages = [ nerdfont-fzf nerdfont-fzf-fetch nerdfont-popup ];
home.packages = [ nerdfont-fzf nerdfont-fzf-fetch ];
xdg.configFile."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 {
home.packages = [
pkgs.wlsunset
night-shift-on
night-shift-off
night-shift

View File

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

View File

@ -1,27 +1,25 @@
{ pkgs, ... }:
let
notif = pkgs.writeShellScriptBin "notif" ''
# Shell script to send custom notifications
NOTIF_FOLDER="/tmp/notif"
sender_id=$1 # To overwrite existing notifications
message=$2
extraargs=""
description=""
if [[ $3 == "extraargs="* ]]; then
extraargs=$(echo "$3" | sed 's/extraargs=//g')
else
description="$3"
extraargs="$4"
fi
notif = pkgs.writeShellScriptBin "notif" # bash
''
# Shell script to send custom notifications
# Usage: notif "sender_id" "message" ["description"]
NOTIF_FOLDER="/tmp/notif"
sender_id=$1 # To overwrite existing notifications
title=$2
description=$3
[[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER
[[ -f "$NOTIF_FOLDER/$sender_id" ]] || echo "0" > "$NOTIF_FOLDER/$sender_id"
[[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER
[[ -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" \
$extraargs \
--replace-id="$old_notification_id" --print-id > "$NOTIF_FOLDER/$sender_id"
'';
${pkgs.libnotify}/bin/notify-send \
--replace-id="$old_notification_id" --print-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";
sound-change = pkgs.writeShellScriptBin "sound-change" ''
sleep 0.05
[[ $1 == "mute" ]] && wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
[[ $1 == "up" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ "$2%+"
[[ $1 == "down" ]] && 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-${increments}}%-
[[ $1 == "set" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-100}%
'';
sound-up = pkgs.writeShellScriptBin "sound-up" ''
sound-change up ${increments}
'';
sound-set = pkgs.writeShellScriptBin "sound-set" ''
sound-change set ''${1-100}
'';
sound-down = pkgs.writeShellScriptBin "sound-down" ''
sound-change down ${increments}
'';
@ -22,4 +25,6 @@ let
sound-toggle = pkgs.writeShellScriptBin "sound-toggle" ''
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
brightnessctl
gnome-themes-extra
wlsunset
qt5ct
libva
dconf

View File

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

View File

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