From ce959a747c96738dbec6b312a6b365decbd7aa4a Mon Sep 17 00:00:00 2001 From: Andre Date: Tue, 30 Apr 2024 16:44:48 -0400 Subject: [PATCH] Tweaks for Khanda (go back to Surface kernel, use remote builds) --- README.md | 11 +++++++++++ hosts/Khanda/default.nix | 3 ++- hosts/Khanda/hardware-configuration.nix | 2 +- modules/base/system.nix | 9 +++++++-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a492d7c..c43fb60 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,17 @@ sudo nixos-rebuild switch --flake . `switch` replaces the running system immediately, or you can use `boot` to only apply the switch during the next reboot. +#### Remote builds + +You can build any Nix or NixOS expression on a remote system before copying it over, as long as you have SSH access to the build target. + +> [!NOTE] +> Run this command without sudo, otherwise SSHing into `haven` won't work. + +```sh +nixos-rebuild boot --flake . --build-host haven +``` + ### Upgrading This config installs a [Nix wrapper called nh](https://github.com/viperML/nh). To use it, run: diff --git a/hosts/Khanda/default.nix b/hosts/Khanda/default.nix index 3240eab..5200ab7 100644 --- a/hosts/Khanda/default.nix +++ b/hosts/Khanda/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: # Settings specific to Dimaga @@ -9,6 +9,7 @@ ]; system.stateVersion = "24.05"; + system.autoUpgrade.enable = lib.mkForce false; host = { role = "workstation"; diff --git a/hosts/Khanda/hardware-configuration.nix b/hosts/Khanda/hardware-configuration.nix index ac65b55..af4d84e 100644 --- a/hosts/Khanda/hardware-configuration.nix +++ b/hosts/Khanda/hardware-configuration.nix @@ -54,5 +54,5 @@ }; # FIXME: Use default kernel to avoid full kernel rebuilds - boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest; + # boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest; } diff --git a/modules/base/system.nix b/modules/base/system.nix index f0bc5f5..9076183 100644 --- a/modules/base/system.nix +++ b/modules/base/system.nix @@ -74,8 +74,13 @@ with lib; # Use the latest and greatest Nix package = pkgs.nixVersions.unstable; - # Enables Flakes - settings.experimental-features = [ "nix-command" "flakes" ]; + settings = { + # Enables Flakes + experimental-features = [ "nix-command" "flakes" ]; + + # Avoid signature verification messages when doing remote builds + trusted-users = [ "${config.users.users.aires.name}" ]; + }; # Enable periodic nix store optimization optimise.automatic = true;