From 886532670b2d3f91f615a63f6b82f2512a641acc Mon Sep 17 00:00:00 2001 From: polwex Date: Sat, 4 Jan 2025 04:08:05 +0700 Subject: m --- hosts/local/fw11/configuration.nix | 55 ++++++++++++++++++++++++++++++ hosts/local/fw11/default.nix | 2 +- hosts/local/fw11/keyboard.nix | 28 ++++++++-------- hosts/local/wayland.nix | 69 +++++++++++++++++++++----------------- 4 files changed, 108 insertions(+), 46 deletions(-) (limited to 'hosts/local') diff --git a/hosts/local/fw11/configuration.nix b/hosts/local/fw11/configuration.nix index 0b7793e..2c16034 100644 --- a/hosts/local/fw11/configuration.nix +++ b/hosts/local/fw11/configuration.nix @@ -45,6 +45,7 @@ in { # boot.supportedFilesystems = ["ntfs"]; # boot.kernelPackages = lib.mkForce unfreePkgs.linuxKernel.packages.linux_xanmod_latest; boot.kernelPackages = pkgs.linuxPackages_latest; + # boot.kernelPackages = pkgs.linuxPackages_6_11; services.fprintd.enable = true; networking = { @@ -79,4 +80,58 @@ in { # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "24.05"; # Did you read the comment? + + # In your configuration.nix + systemd.services.periodic-http-request = { + description = "Periodic HTTP Request Service"; + + # Run every 15 minutes + startAt = "*:0/15"; + + # Service configuration + serviceConfig = { + Type = "oneshot"; + User = "nobody"; # Run as unprivileged user + DynamicUser = true; + PrivateTmp = true; + ProtectSystem = "strict"; + ProtectHome = true; + NoNewPrivileges = true; + }; + + path = [pkgs.curl]; + + script = '' + TOKEN="1993620520:AAE-RACWzn8YuQOkBfDxbkuKBigZQb-w9wE" + URL="https://api.telegram.org/bot$TOKEN/sendMessage" + + get_public_ipv4() { + # Try ipify first + IP=$(curl -s https://api.ipify.org) + if [ -n "$IP" ]; then + echo "$IP" + return + fi + + # Fallback to icanhazip + IP=$(curl -s https://ipv4.icanhazip.com) + if [ -n "$IP" ]; then + echo "$IP" + return + fi + + # Last resort: ipecho + curl -s https://ipecho.net/plain + } + + curl -s -X POST "$URL" \ + -H "User-Agent: NixOS-Periodic-Request" \ + -H 'Content-Type: application/json' \ + -d "{\"chat_id\": \"547865560\", \"text\": \"henlo itsame $(get_public_ipv4)\"}" \ + --retry 3 \ + --retry-delay 5 \ + --max-time 30 \ + -o /dev/null + ''; + }; } diff --git a/hosts/local/fw11/default.nix b/hosts/local/fw11/default.nix index b73579e..c4528a4 100644 --- a/hosts/local/fw11/default.nix +++ b/hosts/local/fw11/default.nix @@ -1,5 +1,5 @@ inputs: [ - inputs.kmonad.nixosModules.default + # inputs.kmonad.nixosModules.default inputs.nixos-hardware.nixosModules.framework-11th-gen-intel ./hardware-configuration.nix ./configuration.nix diff --git a/hosts/local/fw11/keyboard.nix b/hosts/local/fw11/keyboard.nix index ac39694..b9241e1 100644 --- a/hosts/local/fw11/keyboard.nix +++ b/hosts/local/fw11/keyboard.nix @@ -10,18 +10,19 @@ ''; # config file keeps getting rewritten but I don't know by who - # i18n.inputMethod = { - # enabled = "fcitx5"; - # fcitx5.addons = with pkgs; [ - # fcitx5-mozc - # # mozc-ut is better, wat do - # fcitx5-gtk - # libsForQt5.fcitx5-qt - # fcitx5-lua - # fcitx5-configtool - # fcitx5-rime - # ]; - # }; + i18n.inputMethod = { + enable = true; + type = "fcitx5"; + fcitx5.addons = with pkgs; [ + fcitx5-mozc + # mozc-ut is better, wat do + fcitx5-gtk + libsForQt5.fcitx5-qt + fcitx5-lua + fcitx5-configtool + fcitx5-rime + ]; + }; environment.variables = { GTK_IM_MODULE = "fcitx"; QT_IM_MODULE = "fcitx"; @@ -30,9 +31,8 @@ }; #kmonad - services.kmonad = lib.mkIf (pkgs.system == "x86_64-linux") { + services.kmonad = { enable = true; - keyboards.internal = { device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd"; config = builtins.readFile ./framework.kbd; diff --git a/hosts/local/wayland.nix b/hosts/local/wayland.nix index f05569e..674c54b 100644 --- a/hosts/local/wayland.nix +++ b/hosts/local/wayland.nix @@ -21,7 +21,7 @@ xdg-desktop-portal xdg-desktop-portal-wlr xdg-desktop-portal-gtk - calibre + # calibre # nyxt wofi imv @@ -107,7 +107,13 @@ meld # tmp dosbox + # browser TTS + # speechd + # espeak-ng + # espeak-ng-data + ghostty ]; + services.speechd.enable = true; # cjk input @@ -137,36 +143,37 @@ defaultFonts.sansSerif = ["DejaVu Sans"]; defaultFonts.serif = ["DejaVu Serif" "Source Han Serif SC"]; }; - packages = with pkgs; [ - fira-code - fira - cooper-hewitt - ibm-plex - jetbrains-mono - iosevka - spleen - fira-code-symbols - powerline-fonts - nerdfonts - arphic-ukai - arphic-uming - dejavu_fonts - font-awesome - inconsolata # monospaced - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - noto-fonts-extra - powerline-fonts - source-han-sans-japanese - source-han-sans-korean - source-han-sans-simplified-chinese - source-han-sans-traditional-chinese - source-sans-pro - ubuntu_font_family - wqy_microhei - wqy_zenhei - ]; + packages = with pkgs; + [ + fira-code + fira + cooper-hewitt + ibm-plex + jetbrains-mono + iosevka + spleen + fira-code-symbols + powerline-fonts + arphic-ukai + arphic-uming + dejavu_fonts + font-awesome + inconsolata # monospaced + noto-fonts + noto-fonts-cjk-sans + noto-fonts-emoji + noto-fonts-extra + powerline-fonts + source-han-sans-japanese + source-han-sans-korean + source-han-sans-simplified-chinese + source-han-sans-traditional-chinese + source-sans-pro + ubuntu_font_family + wqy_microhei + wqy_zenhei + ] + ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); }; # screen capture -- cgit v1.2.3