summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/base.nix15
-rw-r--r--hosts/cloud/span/configuration.nix2
-rw-r--r--hosts/cloud/span/nginx.nix13
-rw-r--r--hosts/dev.nix18
-rw-r--r--hosts/local/gui.nix9
-rw-r--r--hosts/local/i3.nix13
-rw-r--r--hosts/local/master/configuration.nix39
-rw-r--r--hosts/local/master/keyboard.nix6
-rw-r--r--hosts/local/nvidia.nix9
-rw-r--r--hosts/pkgs.nix10
-rw-r--r--hosts/unfree.nix1
11 files changed, 109 insertions, 26 deletions
diff --git a/hosts/base.nix b/hosts/base.nix
index 31bed5a..054a967 100644
--- a/hosts/base.nix
+++ b/hosts/base.nix
@@ -25,20 +25,31 @@
settings = {
substituters = [
"https://cache.nixos.org"
- "https://cuda-maintainers.cachix.org"
+ "https://polwex.cachix.org"
"https://nix-community.cachix.org"
"https://nix-gaming.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
+ "polwex.cachix.org-1:6Qk8lW0wZ9omwmURpPQUEDUHAb6Nsb+f+pdH2hppBZY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
- "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
];
+
keep-outputs = true;
keep-derivations = true;
trusted-users = ["root" "y"];
+ max-jobs = 2;
+ cores = 16;
};
+ # buildMachines = [{
+ # hostName = "builder.lan";
+ # system = "x86_64-linux";
+ # protocol = "ssh";
+ # supportedFeatures = ["kvm" "big-parallel" "cuda"];
+
+ # }];
+ # distributedBuilds = true;
};
programs.nh = {
enable = true;
diff --git a/hosts/cloud/span/configuration.nix b/hosts/cloud/span/configuration.nix
index d887d37..28c0748 100644
--- a/hosts/cloud/span/configuration.nix
+++ b/hosts/cloud/span/configuration.nix
@@ -11,9 +11,9 @@
../../base.nix
./hardware-configuration.nix
./users.nix
- ./mail.nix
../packages.nix
./nginx.nix
+ ./mail.nix
];
# Bootloader.
diff --git a/hosts/cloud/span/nginx.nix b/hosts/cloud/span/nginx.nix
index 9bfa8ea..1079c7d 100644
--- a/hosts/cloud/span/nginx.nix
+++ b/hosts/cloud/span/nginx.nix
@@ -36,6 +36,19 @@
'';
};
};
+ virtualHosts."uuu.spandrell.ch" = {
+ enableACME = true;
+ forceSSL = true;
+ locations."/" = {
+ proxyPass = "http://127.0.0.1:8080";
+ proxyWebsockets = true; # needed if you need to use WebSocket
+ extraConfig = ''
+ limit_req zone=blog burst=20 nodelay;
+ proxy_set_header Host $Host;
+ proxy_set_header Forwarded for=$remote_addr;
+ '';
+ };
+ };
virtualHosts."s3.spandrell.ch" = {
extraConfig = ''
client_max_body_size 128M;
diff --git a/hosts/dev.nix b/hosts/dev.nix
new file mode 100644
index 0000000..ef6c761
--- /dev/null
+++ b/hosts/dev.nix
@@ -0,0 +1,18 @@
+{
+ inputs,
+ pkgs,
+ lib,
+ config,
+ ...
+}: {
+ # https://nixos.wiki/wiki/CCache
+
+ programs.ccache = {
+ enable = true;
+ };
+ nix.settings.extra-sandbox-paths = [config.programs.ccache.cacheDir];
+
+ # environment.systemPackages = with pkgs;
+ # [
+ # ];
+}
diff --git a/hosts/local/gui.nix b/hosts/local/gui.nix
index 81f97b1..26adeb1 100644
--- a/hosts/local/gui.nix
+++ b/hosts/local/gui.nix
@@ -41,7 +41,7 @@
#
easyeffects # audio, cool stuff
# games!
- # ryujinx
+ ryubing #ryujinx
wineWowPackages.staging
dosbox
siyuan
@@ -51,8 +51,9 @@
# chat
signal-desktop
telegram-desktop
- # llms
- lmstudio
- cherry-studio
+ electrum
+ # xdg whatever bs
+ glib # gio
+ desktop-file-utils
];
}
diff --git a/hosts/local/i3.nix b/hosts/local/i3.nix
index b9e67a7..d49a9d6 100644
--- a/hosts/local/i3.nix
+++ b/hosts/local/i3.nix
@@ -1,4 +1,13 @@
-{pkgs, ...}: {
+{
+ inputs,
+ pkgs,
+ ...
+}: let
+ old-pkgs = import inputs.nixpkgs-old {
+ system = pkgs.system;
+ config.allowUnfree = true;
+ };
+in {
environment.pathsToLink = ["/libexec"];
services.xserver = {
xkb.options = "compose:ralt";
@@ -23,6 +32,7 @@
];
};
};
+
# Boot to terminal
services.displayManager = {
defaultSession = "none+i3";
@@ -42,6 +52,7 @@
vSync = true;
};
environment.systemPackages = with pkgs; [
+ old-pkgs.vivaldi
#notifications
dunst
polybar
diff --git a/hosts/local/master/configuration.nix b/hosts/local/master/configuration.nix
index 2a3cc8a..cad65c8 100644
--- a/hosts/local/master/configuration.nix
+++ b/hosts/local/master/configuration.nix
@@ -6,10 +6,6 @@
inputs,
...
}: let
- old-pkgs = import inputs.nixpkgs-old {
- system = pkgs.system;
- config.allowUnfree = true;
- };
in {
imports = [
# Include the results of the hardware scan.
@@ -39,6 +35,8 @@ in {
networking = {
hostName = "master"; # Define your hostname.
};
+ environment.etc."X11/xorg.conf.d/20-nvidia.conf".source = ./xorg.conf;
+ services.xserver.displayManager.xserverArgs = ["-config ${./xorg.conf}"];
# Set your time zone.
time.timeZone = "Asia/Bangkok";
@@ -52,6 +50,16 @@ in {
services.tailscale = {
enable = true;
};
+ #services.meilisearch = {
+ # enable = true;
+ #};
+
+ zramSwap = {
+ enable = true;
+ memoryPercent = 100;
+ algorithm = "zstd";
+ # memoryPercent = 30;
+ };
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
@@ -61,15 +69,6 @@ in {
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
#
#
- environment.systemPackages = [
- old-pkgs.vivaldi
- # for AI IDE shit
- # pkgs.nodejs
- # pkgs.python312
- # pkgs.openrgb-with-all-plugins
- ];
- environment.etc."X11/xorg.conf.d/20-nvidia.conf".source = ./xorg.conf;
- services.xserver.displayManager.xserverArgs = ["-config ${./xorg.conf}"];
system.stateVersion = "23.11"; # Did you read the comment?
#debugging segfaults
@@ -116,4 +115,18 @@ in {
# };
# };
# };
+ # stop fucking crashing
+
+ systemd.services.nix-daemon.serviceConfig = {
+ MemoryHigh = "22G"; # throttle above this
+ MemoryMax = "28G"; # hard kill above this
+ # optional niceties:
+ CPUWeight = 50;
+ IOWeight = 50;
+ TasksMax = 4096;
+ # Let systemd-oomd preferentially kill these if needed:
+ ManagedOOMMemoryPressure = "kill";
+ ManagedOOMMemoryPressureLimit = "50%";
+ };
+ systemd.oomd.enable = true;
}
diff --git a/hosts/local/master/keyboard.nix b/hosts/local/master/keyboard.nix
index f148d74..6cdcd98 100644
--- a/hosts/local/master/keyboard.nix
+++ b/hosts/local/master/keyboard.nix
@@ -1,8 +1,8 @@
{pkgs, ...}: {
- services.logind.extraConfig = ''
+ services.logind.settings.Login = {
# don’t shutdown when power button is short-pressed
- HandlePowerKey=ignore
- '';
+ HandlePowerKey = "ignore";
+ };
# config file keeps getting rewritten but I don't know by who
i18n.inputMethod = {
diff --git a/hosts/local/nvidia.nix b/hosts/local/nvidia.nix
index ed505c6..b8b335a 100644
--- a/hosts/local/nvidia.nix
+++ b/hosts/local/nvidia.nix
@@ -27,9 +27,18 @@ in {
nix.settings.substituters = [
"https://cuda-maintainers.cachix.org"
+ "https://nix-community.cachix.org"
+ "https://huggingface.cachix.org"
+
+ "https://nix-ai-stuff.cachix.org"
+ "https://ai.cachix.org"
];
nix.settings.trusted-public-keys = [
+ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
+ "huggingface.cachix.org-1:ynTPbLS0W8ofXd9fDjk1KvoFky9K2jhxe6r4nXAkc/o="
+ "nix-ai-stuff.cachix.org-1:WlUGeVCs26w9xF0/rjyg32PujDqbVMlSHufpj1fqix8="
+ "ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
];
services.xserver = {
diff --git a/hosts/pkgs.nix b/hosts/pkgs.nix
index 06a7f38..436851a 100644
--- a/hosts/pkgs.nix
+++ b/hosts/pkgs.nix
@@ -18,6 +18,8 @@
# terminal basics
htop
+ btop
+ nvitop
rlwrap
bat
gitAndTools.gitFull
@@ -53,9 +55,10 @@
#nixfmt
direnv
nix-direnv
- devenv
+ # devenv
devbox
- # inputs.devenv.packages.${pkgs.system}.default
+ inputs.devenv.packages.${pkgs.system}.default
+ bun
# scraping
python312Packages.yt-dlp
# markdown lsp
@@ -76,6 +79,9 @@
ast-grep
diffsitter
# inputs.gemini-cli.packages.x86_64-linux.default
+ #
+ # ai
+ lmstudio
]
++ lib.optionals pkgs.stdenv.isLinux [
# linuxKernel.packages.linux_latest_libre.cpupower
diff --git a/hosts/unfree.nix b/hosts/unfree.nix
index 5a140a4..30c4a62 100644
--- a/hosts/unfree.nix
+++ b/hosts/unfree.nix
@@ -43,4 +43,5 @@
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
# systemd.extraConfig = "DefaultlimitNOFILE=524288";
+ systemd.settings.Manager = {DefaultlimitNOFILE = 524288;};
}