This commit is contained in:
Hadi 2024-06-26 14:44:08 +00:00
parent 57cab5fa52
commit 1ed7675095
23 changed files with 115 additions and 71 deletions

View File

@ -1,11 +1,11 @@
keys:
- &primary age12yvtj49pfh3fqzqflscm0ek4yzrjhr6cqhn7x89gdxnlykq0xudq5c7334
creation_rules:
- path_regex: secrets/laptop.yaml$
- path_regex: hosts/laptop/secrets/laptop.yaml$
key_groups:
- age:
- *primary
- path_regex: secrets/server.yaml$
- path_regex: hosts/server/secrets/server.yaml$
key_groups:
- age:
- *primary

View File

@ -51,14 +51,17 @@ It's a simple way to manage your system configuration and dotfiles.
## Architecture
- 🏠 `home` are the dotfiles and configuration files for the user
- 🏠 `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 like configuration
- 'wallpapers' are... wallpapers
- 💻 `hosts` are the system configuration files
- 'laptop' is my configuration for my laptop with Nvidia
- 'server' is for my homeserver (w/nextcloud, nginx, vaultwarden, ... look `hosts/server`)
- 'guest' is a *template* that you can copy and modify for *your own system*
- 'themes' contains all the *themes* available *(see [THEMES.md](docs/THEMES.md))*
- 'modules' are some nix modules that you can import (Nvidia, prime, fonts, ...)
- 🤫 `secrets` are the secrets files encrypted with sops-nix
## Installation

View File

@ -10,6 +10,7 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md))
- [ ] MacOS theme
- [ ] Write a hyprland shortcuts markdown file (Parse the hyprland settings conf)
- [ ] Tofi (Wofi but terminal based)
- [ ] add golang bin dir to path
- [ ] Waybar
- [ ] Caffeine status

View File

@ -26,5 +26,5 @@ variables=$(echo "$variables" | sed 's/tailscale = true/tailscale = false/')
echo "$variables" >"$GUEST_CONFIG/variables.nix"
home=$(cat "$LAPTOP_CONFIG/home.nix")
home=$(echo "$home" | sed 's/\.\/sops.nix/# .\/sops.nix/')
home=$(echo "$home" | sed 's/\.\/secrets/# .\/secrets/')
echo "$home" >"$GUEST_CONFIG/home.nix"

View File

@ -7,7 +7,7 @@
README_FILE="./README.md"
header=$(cat "./docs/src/header.md")
table_of_content=$(~/go/bin/md-table-of-contents ./docs/src/README_template.md)
table_of_content=$(md-table-of-contents ./docs/src/README_template.md)
version=$(git describe --tags --abbrev=0)
readme_content=$(cat "./docs/src/README_template.md")

View File

@ -1,21 +0,0 @@
#!/usr/bin/env bash
[[ -f "./home/system/hyprland/default.nix" ]] || (echo "File ./home/system/hyprland/default.nix not found" && exit 1)
config=$( cat "./home/system/hyprland/default.nix")
# get text between
# bind = [
# and next ]
# Example:
# "$mod, E, exec, ${pkgs.xfce.thunar}/bin/thunar" # Description
# Steps:
# We should remove the ""
# $mod replace by Super key
# $shiftMod replace by "Super Shift"
# Concat with key
# Remove , exec,
# Remove variables and /bin/ if present
# Create a markdown table with everything

View File

@ -0,0 +1,54 @@
#!/usr/bin/env bash
function getList(){
content=$1
name=$2
list_start=$(echo "$content" | sed "/$name = \[/!d;=;Q")
list=$(echo "$content" | tail +$list_start)
list_end=$(echo "$list" | sed '/\]/!d;=;Q')
list=$(echo "$list" | head -n$list_end)
echo "$list"
}
[[ -f "./home/system/hyprland/default.nix" ]] || (echo "File ./home/system/hyprland/default.nix not found" && exit 1)
config=$( cat "./home/system/hyprland/default.nix")
# Bind
bind=$(getList "$config" "bind")
echo "$bind"
# Bindm (mouse)
bindm=$(getList "$config" "bindm")
echo "$bindm"
# Bindl (lock)
bindl=$(getList "$config" "bindl")
echo "$bindl"
# Bindle (lock, repetition)
bindle=$(getList "$config" "bindle")
echo "$bindle"
# Join the lists:
# ...
# Remove lines not containing a "
# ...
# Parse the keybindings:
# Example: "mod, key, dispatcher, params" # Description
# 1. Get the description/remove it
# 2. Remove the quotes
# 3. Get mod /remove it (replace $mod and $shiftmod by SUPER and SUPER_SHIFT)
# 4. Get key /remove it
# 5. Get dispatcher /remove it
# 6. Get params
# Manually add workspace shortcuts
# Markdown table:
# | Description | keybinding | params |
# | -- | -- | -- |
# ...

View File

@ -14,14 +14,17 @@ It's a simple way to manage your system configuration and dotfiles.
## Architecture
- 🏠 `home` are the dotfiles and configuration files for the user
- 🏠 `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 like configuration
- 'wallpapers' are... wallpapers
- 💻 `hosts` are the system configuration files
- 'laptop' is my configuration for my laptop with Nvidia
- 'server' is for my homeserver (w/nextcloud, nginx, vaultwarden, ... look `hosts/server`)
- 'guest' is a *template* that you can copy and modify for *your own system*
- 'themes' contains all the *themes* available *(see [THEMES.md](docs/THEMES.md))*
- 'modules' are some nix modules that you can import (Nvidia, prime, fonts, ...)
- 🤫 `secrets` are the secrets files encrypted with sops-nix
## Installation

View File

@ -7,7 +7,5 @@
./tmux.nix
./lazygit.nix
./eza.nix
./fetch
./lf
];
}

View File

@ -50,34 +50,32 @@
];
bind = [
"$mod, RETURN, exec, ${pkgs.kitty}/bin/kitty"
"$mod, E, exec, ${pkgs.xfce.thunar}/bin/thunar"
"$mod, B, exec, ${pkgs.qutebrowser}/bin/qutebrowser"
"$mod, K, exec, ${pkgs.bitwarden}/bin/bitwarden"
"$mod, C, exec, ${pkgs.kitty}/bin/kitty --class peaclock peaclock"
"$mod, L, exec, ${pkgs.hyprlock}/bin/hyprlock"
"$mod, X, exec, powermenu"
"$mod, SPACE, exec, menu"
# Windows control
"$mod, Q, killactive,"
"$mod, T, togglefloating,"
"$mod, F, fullscreen"
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Screenshots
"$mod, PRINT, exec, screenshot window"
", PRINT, exec, screenshot monitor"
"$shiftMod, PRINT, exec, screenshot region"
"ALT, PRINT, exec, screenshot region swappy"
# Night Shift
"$mod, F2, exec, night-shift-off"
"$mod, F3, exec, night-shift-on"
# Sound output
"$mod, F5, exec, ${pkgs.kitty}/bin/kitty --class floating zsh -c sound-output"
"$mod, F6, exec, ${pkgs.kitty}/bin/kitty --class floating zsh -c sound-output"
"$mod, F7, exec, ${pkgs.kitty}/bin/kitty --class floating zsh -c sound-output"
"$mod, RETURN, exec, ${pkgs.kitty}/bin/kitty" # Kitty
"$mod, E, exec, ${pkgs.xfce.thunar}/bin/thunar" # Thunar
"$mod, B, exec, ${pkgs.qutebrowser}/bin/qutebrowser" # Qutebrowser
"$mod, K, exec, ${pkgs.bitwarden}/bin/bitwarden" # Bitwarden
"$mod, C, exec, ${pkgs.kitty}/bin/kitty --class peaclock peaclock" # Peaclock
"$mod, L, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock
"$mod, X, exec, powermenu" # Powermenu
"$mod, SPACE, exec, menu" # Launcher
"$mod, Q, killactive," # Close window
"$mod, T, togglefloating," # Toggle Floating
"$mod, F, fullscreen" # Toggle Fullscreen
"$mod, left, movefocus, l" # Move focus left
"$mod, right, movefocus, r" # Move focus Right
"$mod, up, movefocus, u" # Move focus Up
"$mod, down, movefocus, d" # Move focus Down
"$mod, PRINT, exec, screenshot window" # Screenshot window
", PRINT, exec, screenshot monitor" # Screenshot monitor
"$shiftMod, PRINT, exec, screenshot region" # Screenshot region
"ALT, PRINT, exec, screenshot region swappy" # Screenshot region then edit
"$mod, F2, exec, night-shift-off" # Turn off night shift
"$mod, F3, exec, night-shift-on" # Turn on night shift
"$mod, F5, exec, ${pkgs.kitty}/bin/kitty --class floating zsh -c sound-output" # Choose sound output
] ++ (builtins.concatLists (builtins.genList (i:
let ws = i + 1;
in [
@ -85,18 +83,21 @@
"$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
]) 9));
bindm = [ "$mod, mouse:272, movewindow" "$mod, R, resizewindow" ];
bindm = [
"$mod, mouse:272, movewindow" # Move Window (mouse)
"$mod, R, resizewindow" # Resize Window (mouse)
];
bindl = [
",XF86AudioMute, exec, sound-toggle"
",switch:Lid Switch, exec, ${pkgs.hyprlock}/bin/hyprlock"
",XF86AudioMute, exec, sound-toggle" # Toggle Mute
",switch:Lid Switch, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock when closing Lid
];
bindle = [
", XF86AudioRaiseVolume, exec, sound-up"
", XF86AudioLowerVolume, exec, sound-down"
", XF86MonBrightnessUp, exec, brightness-up"
", XF86MonBrightnessDown, exec, brightness-down"
", XF86AudioRaiseVolume, exec, sound-up" # Sound Up
", XF86AudioLowerVolume, exec, sound-down" # Sound Down
", XF86MonBrightnessUp, exec, brightness-up" # Brightness Up
", XF86MonBrightnessDown, exec, brightness-down" # Brightness Down
];
env = [

View File

@ -13,6 +13,8 @@
../../home/programs/spicetify
../../home/programs/zathura
../../home/programs/shell
../../home/programs/fetch
../../home/programs/lf
../../home/programs/git
# Scripts
@ -28,7 +30,7 @@
../../home/system/mime
../../home/system/udiskie
# ./sops.nix # You should probably remove this line
# ./secrets # You should probably remove this line
];
home = {

View File

@ -13,6 +13,8 @@
../../home/programs/spicetify
../../home/programs/zathura
../../home/programs/shell
../../home/programs/fetch
../../home/programs/lf
../../home/programs/git
# Scripts
@ -28,7 +30,7 @@
../../home/system/mime
../../home/system/udiskie
./sops.nix # You should probably remove this line
./secrets # You should probably remove this line
];
home = {

View File

@ -5,7 +5,7 @@
sops = {
age.keyFile = "/home/hadi/.config/sops/age/keys.txt";
defaultSopsFile = ../../secrets/laptop.yaml;
defaultSopsFile = ./laptop.yaml;
secrets = {
sshconfig = { path = "/home/hadi/.ssh/config"; };
github-key = { path = "/home/hadi/.ssh/github"; };

View File

@ -6,7 +6,6 @@
# internal
./modules/internal/security.nix
./modules/internal/openssh.nix
./modules/internal/sops.nix
./modules/internal/adguard.nix
# ./modules/internal/unifi.nix # FIXME: unifi5 is deprecated
@ -23,6 +22,8 @@
# jackflix
./modules/jackflix
./secrets
];
# Bootloader.

View File

@ -2,7 +2,7 @@
sops = {
age.keyFile = "/home/hadi/.config/sops/age/keys.txt";
defaultSopsFile = ../../../../secrets/server.yaml;
defaultSopsFile = ./server.yaml;
defaultSopsFormat = "yaml";
secrets = {
sshconfig = {