From 2189d0592f8c1d83055cf54f8fa84564d4e6d72e Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Sun, 19 Oct 2025 13:57:39 -0700 Subject: [PATCH 1/3] feat: clean up colmena a little, fix nginx default vhost --- home/environments/niri/konawall.nix | 1 - modules/system/colmena.nix | 20 +------------------- nixos/profiles/server/fqdn.nix | 3 +++ nixos/servers/web/nginx.nix | 29 ++++++++++++++++++++++++++++- 4 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 nixos/profiles/server/fqdn.nix diff --git a/home/environments/niri/konawall.nix b/home/environments/niri/konawall.nix index 1d89fb29..b38a61ad 100644 --- a/home/environments/niri/konawall.nix +++ b/home/environments/niri/konawall.nix @@ -8,7 +8,6 @@ interval = 30 * 60; rotate = true; tags = [ - "rating:s" "score:>=100" "width:>=1500" ]; diff --git a/modules/system/colmena.nix b/modules/system/colmena.nix index 1fe6139a..8c2148b0 100644 --- a/modules/system/colmena.nix +++ b/modules/system/colmena.nix @@ -1,11 +1,10 @@ { - name, config, lib, inputs, ... }: let - inherit (lib.modules) mkIf mkOptionDefault mkDefault; + inherit (lib.modules) mkOptionDefault mkDefault; in { options = let inherit (lib.types) nullOr; @@ -23,22 +22,5 @@ in { "all" ]; }; - deploy = let - nixos = config.built; - in { - sshUser = mkOptionDefault "deploy"; - user = mkOptionDefault "root"; - sshOpts = mkIf (config.type == "NixOS") ( - mkOptionDefault ["-p" "${builtins.toString (builtins.head nixos.config.services.openssh.ports)}"] - ); - autoRollback = mkOptionDefault true; - magicRollback = mkOptionDefault true; - fastConnection = mkOptionDefault false; - hostname = mkOptionDefault "${name}.devices.inskip.me"; - profiles.system = { - user = "root"; - path = inputs.deploy-rs.lib.${config.system}.activate.nixos inputs.self.nixosConfigurations.${name}; - }; - }; }; } diff --git a/nixos/profiles/server/fqdn.nix b/nixos/profiles/server/fqdn.nix new file mode 100644 index 00000000..13c4d819 --- /dev/null +++ b/nixos/profiles/server/fqdn.nix @@ -0,0 +1,3 @@ +_: { + networking.domain = "inskip.me"; +} diff --git a/nixos/servers/web/nginx.nix b/nixos/servers/web/nginx.nix index 289f6be3..9f997045 100644 --- a/nixos/servers/web/nginx.nix +++ b/nixos/servers/web/nginx.nix @@ -1,4 +1,4 @@ -_: { +{config, ...}: { services.nginx = { enable = true; recommendedTlsSettings = true; @@ -6,5 +6,32 @@ _: { recommendedGzipSettings = true; recommendedProxySettings = true; statusPage = true; + virtualHosts = let + vHost = { + extraConfig = '' + add_header Content-Type text/plain; + return 200 "meep?"; + ''; + /* + locations = { + "/" = { + extraConfig = '' + add_header Content-Type text/plain; + return 200 "meep?"; + ''; + }; + }; + */ + }; + in { + "${config.networking.fqdn}" = + vHost + // { + enableACME = true; + forceSSL = true; + default = true; + }; + "localhost" = vHost; + }; }; } From e16019c75bedd1ed84051b6774de73d7c4a59abe Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Sun, 19 Oct 2025 14:27:49 -0700 Subject: [PATCH 2/3] feat: add performance profile, move things around somewhat --- nixos/profiles/graphical/distributed.nix | 28 +++++++++++++++ .../{graphical => performance}/kernel.nix | 0 nixos/profiles/performance/scx.nix | 7 ++++ nixos/profiles/performance/zram.nix | 3 ++ systems/daiyousei.nix | 5 +++ systems/goliath.nix | 33 +---------------- systems/koishi.nix | 35 +------------------ 7 files changed, 45 insertions(+), 66 deletions(-) create mode 100644 nixos/profiles/graphical/distributed.nix rename nixos/profiles/{graphical => performance}/kernel.nix (100%) create mode 100644 nixos/profiles/performance/scx.nix create mode 100644 nixos/profiles/performance/zram.nix diff --git a/nixos/profiles/graphical/distributed.nix b/nixos/profiles/graphical/distributed.nix new file mode 100644 index 00000000..2300636b --- /dev/null +++ b/nixos/profiles/graphical/distributed.nix @@ -0,0 +1,28 @@ +{config, ...}: { + programs.ssh.extraConfig = '' + Host daiyousei-build + HostName daiyousei.inskip.me + User root + IdentityAgent /run/user/${config.users.users.kat.uid}/gnupg/S.gpg-agent.ssh + ControlMaster auto + ControlPath ${config.users.users.kat.home}/.ssh/master-%r@%n:%p + ControlPersist 10m + ''; + nix = { + buildMachines = [ + { + hostName = "daiyousei-build"; + system = "aarch64-linux"; + protocol = "ssh-ng"; + maxJobs = 100; + speedFactor = 1; + supportedFeatures = ["benchmark" "big-parallel" "kvm"]; + mandatoryFeatures = []; + } + ]; + distributedBuilds = true; + extraOptions = '' + builders-use-substitutes = true + ''; + }; +} diff --git a/nixos/profiles/graphical/kernel.nix b/nixos/profiles/performance/kernel.nix similarity index 100% rename from nixos/profiles/graphical/kernel.nix rename to nixos/profiles/performance/kernel.nix diff --git a/nixos/profiles/performance/scx.nix b/nixos/profiles/performance/scx.nix new file mode 100644 index 00000000..9e02f7b3 --- /dev/null +++ b/nixos/profiles/performance/scx.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + services.scx = { + enable = true; + package = pkgs.scx_git.full; + scheduler = "scx_lavd"; + }; +} diff --git a/nixos/profiles/performance/zram.nix b/nixos/profiles/performance/zram.nix new file mode 100644 index 00000000..3a26c5d7 --- /dev/null +++ b/nixos/profiles/performance/zram.nix @@ -0,0 +1,3 @@ +_: { + zramSwap.enable = true; +} diff --git a/systems/daiyousei.nix b/systems/daiyousei.nix index d1d020c6..cb0aa4d8 100644 --- a/systems/daiyousei.nix +++ b/systems/daiyousei.nix @@ -1,5 +1,6 @@ _: let hostConfig = { + pkgs, tree, modulesPath, ... @@ -28,6 +29,10 @@ _: let web ]); + environment.systemPackages = [ + pkgs.numix-icon-theme + ]; + # TODO: Add config.microvm.stateDir to backup schedule? # TODO: figure out updateFlake? #microvm = { diff --git a/systems/goliath.nix b/systems/goliath.nix index 859a1c73..a69c15b1 100644 --- a/systems/goliath.nix +++ b/systems/goliath.nix @@ -50,6 +50,7 @@ _: let quiet-boot wireless gaming + performance dev ]) ++ (with tree.nixos.environments; [ @@ -172,30 +173,6 @@ _: let networking.hostId = "c3b94e85"; - programs.ssh.extraConfig = '' - Host daiyousei-build - HostName 140.238.156.121 - User root - IdentityAgent /run/user/1000/gnupg/S.gpg-agent.ssh - ''; - nix = { - buildMachines = [ - { - hostName = "daiyousei-build"; - system = "aarch64-linux"; - protocol = "ssh-ng"; - maxJobs = 100; - speedFactor = 1; - supportedFeatures = ["benchmark" "big-parallel" "kvm"]; - mandatoryFeatures = []; - } - ]; - distributedBuilds = true; - extraOptions = '' - builders-use-substitutes = true - ''; - }; - services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { @@ -206,14 +183,6 @@ _: let powerManagement.enable = true; }; - services.scx = { - enable = false; - package = pkgs.scx_git.full; - scheduler = "scx_lavd"; - }; - - zramSwap.enable = true; - boot = { zfs.requestEncryptionCredentials = true; loader = { diff --git a/systems/koishi.nix b/systems/koishi.nix index 9761d3af..7c0f7572 100644 --- a/systems/koishi.nix +++ b/systems/koishi.nix @@ -1,7 +1,6 @@ _: let hostConfig = { tree, - pkgs, lib, config, ... @@ -53,6 +52,7 @@ _: let wireless laptop gaming + performance ]) ++ (with tree.nixos.environments; [ niri @@ -106,39 +106,6 @@ _: let ]; }; - services.scx = { - enable = true; - package = pkgs.scx_git.full; - scheduler = "scx_lavd"; - }; - - zramSwap.enable = true; - - programs.ssh.extraConfig = '' - Host daiyousei-build - HostName 140.238.156.121 - User root - IdentityAgent /run/user/1000/gnupg/S.gpg-agent.ssh - ''; - - nix = { - buildMachines = [ - { - hostName = "daiyousei-build"; - system = "aarch64-linux"; - protocol = "ssh-ng"; - maxJobs = 100; - speedFactor = 1; - supportedFeatures = ["benchmark" "big-parallel" "kvm"]; - mandatoryFeatures = []; - } - ]; - distributedBuilds = true; - extraOptions = '' - builders-use-substitutes = true - ''; - }; - # optional, useful when the builder has a faster internet connection than yours services = { printing.enable = true; From 6bb963d9ad5fa18a9bd5792a5e47ff1bfd4a8864 Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Sun, 19 Oct 2025 14:29:13 -0700 Subject: [PATCH 3/3] fix: uid toString --- nixos/profiles/graphical/distributed.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/profiles/graphical/distributed.nix b/nixos/profiles/graphical/distributed.nix index 2300636b..5c0f86d4 100644 --- a/nixos/profiles/graphical/distributed.nix +++ b/nixos/profiles/graphical/distributed.nix @@ -3,7 +3,7 @@ Host daiyousei-build HostName daiyousei.inskip.me User root - IdentityAgent /run/user/${config.users.users.kat.uid}/gnupg/S.gpg-agent.ssh + IdentityAgent /run/user/${toString config.users.users.kat.uid}/gnupg/S.gpg-agent.ssh ControlMaster auto ControlPath ${config.users.users.kat.home}/.ssh/master-%r@%n:%p ControlPersist 10m