update nh config

This commit is contained in:
Henry Hiles 2026-11-07 00:40:21 -05:00
commit bc5365c171
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -1,3 +1,11 @@
{ pkgs, lib, ... }:
let
aliases = {
upgrade = "nh os switch --update";
switch = "nh os switch";
boot = "nh os boot";
};
in
{
programs.nh = {
enable = true;
@ -5,15 +13,17 @@
flake = "/home/quadradical/.config/nixos";
};
environment.shellAliases =
let
build = "nixos-rebuild switch --sudo --ask-sudo-password --flake ~/.config/nixos#";
in
{
environment.systemPackages = [
(pkgs.writeShellScriptBin "server" ''
${lib.concatMapAttrsStringSep "\n" (
name: cmd: ''${name}() { ${cmd} -H quadraticserver --target-host server "$@"; }''
) aliases}
"$@"
'')
];
environment.shellAliases = aliases // {
clean = "nh clean all";
update = "env -C ~/.config/nixos nix flake update";
upgrade = "nh os switch --update";
rebuild = "nh os switch";
rebuild-server = build + "quadraticserver --target-host server";
};
}