From d169306a683beeb284d1e6b51aebc1b1c7630076 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:47:13 +0200 Subject: [PATCH] Update --- home/laptop.nix | 2 ++ home/system/hyprland/hypridle.nix | 24 +++++++++--------- hosts/guest/variables.nix | 6 ++--- hosts/shared/scripts/create_guest_config.sh | 27 +++++++++++++-------- 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/home/laptop.nix b/home/laptop.nix index 4c7176d..54888a6 100644 --- a/home/laptop.nix +++ b/home/laptop.nix @@ -40,6 +40,8 @@ wf-recorder glow nwg-displays + wireguard-tools + bitwarden-cli # Just cool peaclock diff --git a/home/system/hyprland/hypridle.nix b/home/system/hyprland/hypridle.nix index 7219eec..e7326fa 100644 --- a/home/system/hyprland/hypridle.nix +++ b/home/system/hyprland/hypridle.nix @@ -4,18 +4,18 @@ enable = true; settings = { general = { ignore_dbus_inhibit = false; }; - listener = [ - { - timeout = 600; - on-timeout = pkgs.hyprlock + "/bin/hyprlock"; - } - { - timeout = 660; - on-timeout = "systemctl suspend"; - on-resume = pkgs.libnotify - + "/bin/notify-send 'Welcome back to your desktop!'"; - } - ]; + listener = [{ + timeout = 600; + on-timeout = pkgs.hyprlock + "/bin/hyprlock"; + } + # FIXME + # { + # timeout = 660; + # on-timeout = "systemctl suspend"; + # on-resume = pkgs.libnotify + # + "/bin/notify-send 'Welcome back to your desktop!'"; + # } + ]; }; }; } diff --git a/hosts/guest/variables.nix b/hosts/guest/variables.nix index 0dca59a..741d2c2 100644 --- a/hosts/guest/variables.nix +++ b/hosts/guest/variables.nix @@ -3,7 +3,7 @@ config.var = { hostname = "nixy"; - username = "your username"; + username = "your_username"; homeDirectory = "/home/" + config.var.username; keyboardLayout = "fr"; @@ -13,8 +13,8 @@ extraLocale = "fr_FR.UTF-8"; git = { - username = "Github username"; - email = "Github email"; + username = "your_username"; + email = "your_email"; }; stateVersion = "24.05"; diff --git a/hosts/shared/scripts/create_guest_config.sh b/hosts/shared/scripts/create_guest_config.sh index 74d54a9..ce2afcb 100644 --- a/hosts/shared/scripts/create_guest_config.sh +++ b/hosts/shared/scripts/create_guest_config.sh @@ -1,19 +1,26 @@ #!/usr/bin/env bash -[[ -d "./hosts" ]] || (exit 1; echo "Folder ./hosts not found") +[[ -d "./hosts" ]] || ( + exit 1 + echo "Folder ./hosts not found" +) LAPTOP_CONFIG="./hosts/laptop" GUEST_CONFIG="./hosts/guest" -mv "$LAPTOP_CONFIG/configuration.nix" "$GUEST_CONFIG/configuration.nix" -mv "$LAPTOP_CONFIG/variables.nix" "$GUEST_CONFIG/variables.nix" +cp "$LAPTOP_CONFIG/configuration.nix" "$GUEST_CONFIG/configuration.nix" +cp "$LAPTOP_CONFIG/variables.nix" "$GUEST_CONFIG/variables.nix" # Remove the NVIDIA driver import -cat "$GUEST_CONFIG/configuration.nix" | sed 's/\.\.\/shared\/nvidia/# ..\/shared\/nvidia/' > "$GUEST_CONFIG/configuration.nix" -cat "$GUEST_CONFIG/configuration.nix" | sed 's/\.\.\/shared\/prime/# ..\/shared\/prime/' > "$GUEST_CONFIG/configuration.nix" +config=$(cat "$LAPTOP_CONFIG/configuration.nix") +config=$(echo "$config" | sed 's/..\/shared\/nvidia/# ..\/shared\/nvidia/') +config=$(echo "$config" | sed 's/..\/shared\/prime/# ..\/shared\/prime/') +echo "$config" >"$GUEST_CONFIG/configuration.nix" -cat "$GUEST_CONFIG/variables.nix" | sed 's/hadi/your username/' > "$GUEST_CONFIG/variables.nix" -cat "$GUEST_CONFIG/variables.nix" | sed 's/Hadi/your username/' > "$GUEST_CONFIG/variables.nix" -cat "$GUEST_CONFIG/variables.nix" | sed 's/112569860+anotherhadi@users.noreply.github.com/your email/' > "$GUEST_CONFIG/variables.nix" -cat "$GUEST_CONFIG/variables.nix" | sed 's/sops = true/sops = false/' > "$GUEST_CONFIG/variables.nix" -cat "$GUEST_CONFIG/variables.nix" | sed 's/nextcloud = true/nextcloud = false/' > "$GUEST_CONFIG/variables.nix" +variables=$(cat "$LAPTOP_CONFIG/variables.nix") +variables=$(echo "$variables" | sed 's/112569860+anotherhadi@users.noreply.github.com/your_email/') +variables=$(echo "$variables" | sed 's/hadi/your_username/') +variables=$(echo "$variables" | sed 's/Hadi/your_username/') +variables=$(echo "$variables" | sed 's/sops = true/sops = false/') +variables=$(echo "$variables" | sed 's/nextcloud = true/nextcloud = false/') +echo "$variables" >"$GUEST_CONFIG/variables.nix"