diff options
author | polwex <polwex@sortug.com> | 2025-01-04 04:08:05 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-01-04 04:08:05 +0700 |
commit | 886532670b2d3f91f615a63f6b82f2512a641acc (patch) | |
tree | 8803d51ed2a341689202b0d3249ce5316ef6e4c0 /hosts | |
parent | 8ba8980c12a1fb05970dead6228ddc3129ff5868 (diff) |
m
Diffstat (limited to 'hosts')
-rw-r--r-- | hosts/base.nix | 2 | ||||
-rw-r--r-- | hosts/cloud/bkk/configuration.nix | 20 | ||||
-rw-r--r-- | hosts/cloud/bkk/nginx.nix | 18 | ||||
-rw-r--r-- | hosts/editors.nix | 4 | ||||
-rw-r--r-- | hosts/local/fw11/configuration.nix | 55 | ||||
-rw-r--r-- | hosts/local/fw11/default.nix | 2 | ||||
-rw-r--r-- | hosts/local/fw11/keyboard.nix | 28 | ||||
-rw-r--r-- | hosts/local/wayland.nix | 69 | ||||
-rw-r--r-- | hosts/pkgs.nix | 5 |
9 files changed, 143 insertions, 60 deletions
diff --git a/hosts/base.nix b/hosts/base.nix index 8d79398..96df7c4 100644 --- a/hosts/base.nix +++ b/hosts/base.nix @@ -8,7 +8,7 @@ dates = "weekly"; options = "--delete-older-than 7d"; }; - package = pkgs.nixFlakes; + # package = pkgs.nixFlakes; extraOptions = '' experimental-features = nix-command flakes ''; diff --git a/hosts/cloud/bkk/configuration.nix b/hosts/cloud/bkk/configuration.nix index 94b9451..c74cde1 100644 --- a/hosts/cloud/bkk/configuration.nix +++ b/hosts/cloud/bkk/configuration.nix @@ -35,16 +35,16 @@ # }; # }; - services.headscale = { - enable = true; - address = "0.0.0.0"; - port = 8001; - settings = { - server_url = "https://head.urbit.men"; - dns.baseDomain = "urbit.men"; - logtail.enabled = false; - }; - }; + # services.headscale = { + # enable = true; + # address = "0.0.0.0"; + # port = 8001; + # settings = { + # server_url = "https://head.urbit.men"; + # dns.baseDomain = "urbit.men"; + # logtail.enabled = false; + # }; + # }; system.stateVersion = "24.05"; # Did you read the comment? environment.systemPackages = with pkgs; [ diff --git a/hosts/cloud/bkk/nginx.nix b/hosts/cloud/bkk/nginx.nix index ea6b785..3314674 100644 --- a/hosts/cloud/bkk/nginx.nix +++ b/hosts/cloud/bkk/nginx.nix @@ -25,6 +25,24 @@ proxy_cache off; ''; }; + virtualHosts."p.urbit.men" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:8083"; + # proxyWebsockets = true; # needed if you need to use WebSocket + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header Forwarded $proxy_add_x_forwarded_for; + ''; + }; + extraConfig = '' + chunked_transfer_encoding off; + proxy_http_version 1.1; + proxy_buffering off; + proxy_cache off; + ''; + }; virtualHosts."head.urbit.men" = { enableACME = true; forceSSL = true; diff --git a/hosts/editors.nix b/hosts/editors.nix index c9228c0..bd2acca 100644 --- a/hosts/editors.nix +++ b/hosts/editors.nix @@ -7,7 +7,7 @@ environment.variables.F = "hx"; environment.systemPackages = [ pkgs.neovim - # inputs.helix.packages.${pkgs.system}.helix - pkgs.helix + inputs.helix.packages.${pkgs.system}.helix + # pkgs.helix ]; } 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 diff --git a/hosts/pkgs.nix b/hosts/pkgs.nix index 82acb52..db565ea 100644 --- a/hosts/pkgs.nix +++ b/hosts/pkgs.nix @@ -42,7 +42,7 @@ autossh #hardware problems lm_sensors - linuxKernel.packages.linux_latest_libre.cpupower + linuxKernel.packages.linux_hardened.cpupower # images imagemagick sxiv @@ -67,5 +67,8 @@ # electrum # yacreader nethogs + superhtml + sshfs + sxiv ]; } |