diff --git a/docs/APPS.md b/docs/APPS.md index 781699c8..7a12d304 100644 --- a/docs/APPS.md +++ b/docs/APPS.md @@ -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/)... diff --git a/docs/SCRIPTS.md b/docs/SCRIPTS.md index 7094373f..213c33bc 100644 --- a/docs/SCRIPTS.md +++ b/docs/SCRIPTS.md @@ -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 ` +- `brightness-set [value]` +- `brightness-change [up/down] ` ## Sound control - `sound-up` - `sound-down` - `sound-toggle` -- `sound-output` +- `sound-set [value]` - `sound-change [up/down/mute] ` ## 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` ... diff --git a/docs/THEMES.md b/docs/THEMES.md index 40ea07c1..0662511c 100644 --- a/docs/THEMES.md +++ b/docs/THEMES.md @@ -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) diff --git a/docs/TODO.md b/docs/TODO.md index 0d02d472..feebfbef 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -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 diff --git a/docs/src/README_template.md b/docs/src/README_template.md index 9b9b6f76..25f60be0 100644 --- a/docs/src/README_template.md +++ b/docs/src/README_template.md @@ -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 diff --git a/docs/src/windows/1.png.REMOVED.git-id b/docs/src/windows/1.png.REMOVED.git-id deleted file mode 100644 index 3e26f82c..00000000 --- a/docs/src/windows/1.png.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -62b52ad02a886c19a8cfe1ea17e8aaad50f23632 \ No newline at end of file diff --git a/flake.lock b/flake.lock index 6f3ead42..c29c993a 100644 --- a/flake.lock +++ b/flake.lock @@ -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" } diff --git a/home/scripts/brightness/default.nix b/home/scripts/brightness/default.nix index 2152cc54..98efc20b 100644 --- a/home/scripts/brightness/default.nix +++ b/home/scripts/brightness/default.nix @@ -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 + ]; +} diff --git a/home/scripts/caffeine/default.nix b/home/scripts/caffeine/default.nix index f9ff3439..df4c6e33 100644 --- a/home/scripts/caffeine/default.nix +++ b/home/scripts/caffeine/default.nix @@ -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 ]; } diff --git a/home/scripts/compress/default.nix b/home/scripts/compress/default.nix deleted file mode 100644 index 5e666e71..00000000 --- a/home/scripts/compress/default.nix +++ /dev/null @@ -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 ]; } diff --git a/home/scripts/default.nix b/home/scripts/default.nix index 6b8680fb..9c920e96 100644 --- a/home/scripts/default.nix +++ b/home/scripts/default.nix @@ -8,7 +8,6 @@ ./screenshot ./nerdfont_fzf ./notification - ./compress ./system ]; } diff --git a/home/scripts/nerdfont_fzf/default.nix b/home/scripts/nerdfont_fzf/default.nix index 9b5da8c6..d23c42b2 100644 --- a/home/scripts/nerdfont_fzf/default.nix +++ b/home/scripts/nerdfont_fzf/default.nix @@ -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; diff --git a/home/scripts/night-shift/default.nix b/home/scripts/night-shift/default.nix index ea9b251d..2adea156 100644 --- a/home/scripts/night-shift/default.nix +++ b/home/scripts/night-shift/default.nix @@ -41,6 +41,7 @@ let ''; in { home.packages = [ + pkgs.wlsunset night-shift-on night-shift-off night-shift diff --git a/home/scripts/nixy/default.nix b/home/scripts/nixy/default.nix index b545e225..c48944be 100644 --- a/home/scripts/nixy/default.nix +++ b/home/scripts/nixy/default.nix @@ -1,7 +1,5 @@ { pkgs, config, ... }: - let - nixy = pkgs.writeShellScriptBin "nixy" '' function exec() { $@ diff --git a/home/scripts/notification/default.nix b/home/scripts/notification/default.nix index d1059205..c56d258c 100644 --- a/home/scripts/notification/default.nix +++ b/home/scripts/notification/default.nix @@ -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 ]; } diff --git a/home/scripts/sounds/default.nix b/home/scripts/sounds/default.nix index cf36f47b..02e1673f 100644 --- a/home/scripts/sounds/default.nix +++ b/home/scripts/sounds/default.nix @@ -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 ]; +} diff --git a/home/system/hyprland/default.nix b/home/system/hyprland/default.nix index 67ff6456..e5c69a15 100644 --- a/home/system/hyprland/default.nix +++ b/home/system/hyprland/default.nix @@ -18,7 +18,6 @@ wl-clipboard brightnessctl gnome-themes-extra - wlsunset qt5ct libva dconf diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index b45215ee..55aec8a4 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -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 diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index 3bb9d9e1..8947595a 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -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