From 8bf64faaa83fdd69db3e518aff43b21aa9ae9d1e Mon Sep 17 00:00:00 2001 From: OCbwoy3 Date: Wed, 20 Aug 2025 22:33:31 +0300 Subject: [PATCH] my nix stuff! --- flake.lock | 6 ++-- hosts/default/configuration.nix | 47 ++-------------------------- hosts/default/packages.nix | 1 + hosts/server/configuration.nix | 17 +++++----- hosts/server/modules/atproto-pds.nix | 4 +-- hosts/server/modules/cloudflare.nix | 33 +++++++++++++++++++ modules/force.nix | 37 ++++++++++++++++++++++ modules/nixos/programs.nix | 7 ----- modules/stuff/nvim.nix | 27 ++++++++++++++++ modules/stuff/zsh.nix | 27 ++++++++++++++++ 10 files changed, 142 insertions(+), 64 deletions(-) create mode 100644 hosts/server/modules/cloudflare.nix create mode 100644 modules/force.nix create mode 100644 modules/stuff/nvim.nix create mode 100644 modules/stuff/zsh.nix diff --git a/flake.lock b/flake.lock index 78d66ac..9bfce9d 100644 --- a/flake.lock +++ b/flake.lock @@ -927,11 +927,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1752480373, - "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=", + "lastModified": 1755615617, + "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08", + "rev": "20075955deac2583bb12f07151c2df830ef346b4", "type": "github" }, "original": { diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 16cfcd8..2f69fab 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -3,44 +3,17 @@ { imports = [ - ../../modules/nixos/nixpkgs.nix - ../../modules/nixos/bootloader.nix - ../../modules/nixos/hardware.nix - ../../modules/nixos/nvidia.nix - ../../modules/nixos/i18n.nix + ../../modules/force.nix ../../modules/nixos/main-user.nix - ../../modules/nixos/network.nix - ../../modules/nixos/programs.nix ../../modules/home-manager/main.nix ./packages.nix # ../../modules/home-manager/hyprpanel.nix ./other/activate.nix - # ./apps/ancs.nix - inputs.nvf.nixosModules.default + # ./apps/ancs.nix ]; services.displayManager.gdm.enable = true; - programs.nvf = { - enable = true; - defaultEditor = true; - # withLua = true; - - settings.vim = { - viAlias = true; - vimAlias = true; - statusline.lualine.enable = true; - languages = { - enableLSP = true; - enableTreesitter = true; - - nix.enable = true; - ts.enable = true; - # qml.enable = true; - }; - }; - }; - programs.steam = { enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play @@ -118,22 +91,6 @@ portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; }; - programs.zsh = { - enable = true; - autosuggestions.enable = true; - zsh-autoenv.enable = true; - syntaxHighlighting.enable = true; - ohMyZsh = { - enable = true; - plugins = [ "git" "direnv" ]; - theme = "robbyrussell"; - }; - shellAliases = { - nixrebuild = "sudo nixos-rebuild switch --flake .#default --impure --cores 4 -L --upgrade"; - neofetch = "fastfetch"; - }; - }; - virtualisation.docker.enable = true; main-user.packages = with pkgs; [ diff --git a/hosts/default/packages.nix b/hosts/default/packages.nix index 2273f8d..8927c13 100644 --- a/hosts/default/packages.nix +++ b/hosts/default/packages.nix @@ -106,6 +106,7 @@ swappy slurp grim + wayland-utils wl-clipboard github-cli cliphist diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index 341de2d..15aba62 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -3,22 +3,25 @@ { imports = [ ./modules/atproto-pds.nix - ../../modules/nixos/bootloader.nix - ../../modules/nixos/network.nix - ../../modules/nixos/hardware.nix - ../../modules/nixos/nixpkgs.nix + ./modules/cloudflare.nix + ../../modules/force.nix ]; - environment.systemPackages = with pkgs; [ - gh - ]; + # gcc. shit breaks. wtf + environment.sessionVariables.LD_LIBRARY_PATH = "${pkgs.gcc15}/lib"; services.openssh.enable = lib.mkForce true; + environment.systemPackages = with pkgs; [ + fastfetch + hyfetch + ] + users.users.ocbwoy3 = { initialPassword = "thisisapassword42069!"; # not the type passwords i use isNormalUser = true; extraGroups = [ "wheel" "networkmanager" ]; + shell = pkgs.zsh; }; virtualisation.docker.enable = true; diff --git a/hosts/server/modules/atproto-pds.nix b/hosts/server/modules/atproto-pds.nix index b97595e..21dcd15 100644 --- a/hosts/server/modules/atproto-pds.nix +++ b/hosts/server/modules/atproto-pds.nix @@ -14,11 +14,11 @@ PDS_CRAWLERS = "https://bsky.network"; LOG_ENABLED = "true"; PDS_HOSTNAME = "pds.darktru.win"; - PDS_VERSION = "I'm an ATProto PDS!"; + PDS_VERSION = "i use nix btw"; PDS_DID_PLC_URL = "https://plc.directory"; PDS_CONTACT_EMAIL_ADDRESS = "ocbwoy3@ocbwoy3.dev"; PDS_PRIVACY_POLICY_URL = "https://ocbwoy3.dev"; - PDS_TERMS_OF_SERVICE_URL = "https://discord.gg/cQDvPtv3Dt"; + PDS_TERMS_OF_SERVICE_URL = "https://ocbwoy3.dev"; PDS_ACCEPTING_REPO_IMPORTS = "true"; }; diff --git a/hosts/server/modules/cloudflare.nix b/hosts/server/modules/cloudflare.nix new file mode 100644 index 0000000..d174b43 --- /dev/null +++ b/hosts/server/modules/cloudflare.nix @@ -0,0 +1,33 @@ +{ config, inputs, pkgs, ... }: + +{ + + environment.systemPackages = with pkgs; [ + cloudflared + ]; + + # lib.mkIf (isOCbwoy3 == true) + services.cloudflared = { + enable = true; + certificateFile = "/private/cloudflared.pem" + tunnels = { + "selfhost" = { + # 2f83f704-e9f7-49fb-a6c4-d4a8f85d87e4 + default = "http_status:404"; + credentialsFile = "/private/cloudflared/selfhost.json"; + ingress = { + "api.ocbwoy3.dev" = { + service = "http://localhost:8080"; + }; + "remx-staging.darktru.win" = { + service = "http://localhost:3000"; + }; + "pds.darktru.win" = { + service = "http://localhost:80"; + }; + }; + }; + }; + }; + +} diff --git a/modules/force.nix b/modules/force.nix new file mode 100644 index 0000000..53b0d74 --- /dev/null +++ b/modules/force.nix @@ -0,0 +1,37 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./nixos/bootloader.nix + ./nixos/hardware.nix + ./nixos/i18n.nix + ./nixos/network.nix + ./nixos/nixpkgs.nix + ./nixos/nvidia.nix + ./nixos/programs.nix + ./stuff/nvim.nix + ./stuff/zsh.nix + ]; + + environment.systemPackages = with pkgs; [ + gh + file + glib + openssl + nss + glibc + nixfmt-rfc-style + killall + deno + bun + imagemagick + unzip + libwebp + nix-direnv + htop + nixpkgs-fmt + nixd + ffmpeg-full + gnupg + ]; +} diff --git a/modules/nixos/programs.nix b/modules/nixos/programs.nix index f17cf17..fb4e05e 100644 --- a/modules/nixos/programs.nix +++ b/modules/nixos/programs.nix @@ -18,13 +18,6 @@ # services.displayManager.defaultSession = "hyprland"; - programs.zsh.enable = true; - - programs.direnv = { - enable = true; - enableZshIntegration = true; - }; - programs.gamemode.enable = true; programs.gamemode.settings.general.renice = 0; programs.gamemode.settings.general.ioprio = 0; diff --git a/modules/stuff/nvim.nix b/modules/stuff/nvim.nix new file mode 100644 index 0000000..91576b7 --- /dev/null +++ b/modules/stuff/nvim.nix @@ -0,0 +1,27 @@ +{ config, inputs, pkgs, lib, ... }: + +{ + imports = [ + inputs.nvf.nixosModules.default + ]; + + programs.nvf = { + enable = true; + defaultEditor = true; + # withLua = true; + + settings.vim = { + viAlias = true; + vimAlias = true; + statusline.lualine.enable = true; + languages = { + enableLSP = true; + enableTreesitter = true; + + nix.enable = true; + ts.enable = true; + # qml.enable = true; + }; + }; + }; +} diff --git a/modules/stuff/zsh.nix b/modules/stuff/zsh.nix new file mode 100644 index 0000000..487c3bc --- /dev/null +++ b/modules/stuff/zsh.nix @@ -0,0 +1,27 @@ +{ config, inputs, pkgs, lib, ... }: + +{ + + programs.direnv = { + enable = true; + enableZshIntegration = true; + }; + + programs.zsh = { + enable = true; + autosuggestions.enable = true; + zsh-autoenv.enable = true; + syntaxHighlighting.enable = true; + ohMyZsh = { + enable = true; + plugins = [ "git" "direnv" ]; + theme = "robbyrussell"; + }; + shellAliases = { + nixrebuild = "sudo nixos-rebuild switch --flake .#default --impure --cores 4 -L --upgrade"; + dangerous-nixrebuild-server = "sudo nixos-rebuild switch --flake .#server --impure --cores 4 -L --upgrade"; + neofetch = "fastfetch"; + }; + }; + +}