update nh config
This commit is contained in:
parent
a42296cef7
commit
bc5365c171
1 changed files with 21 additions and 11 deletions
|
|
@ -1,3 +1,11 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
aliases = {
|
||||||
|
upgrade = "nh os switch --update";
|
||||||
|
switch = "nh os switch";
|
||||||
|
boot = "nh os boot";
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
programs.nh = {
|
programs.nh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -5,15 +13,17 @@
|
||||||
flake = "/home/quadradical/.config/nixos";
|
flake = "/home/quadradical/.config/nixos";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.shellAliases =
|
environment.systemPackages = [
|
||||||
let
|
(pkgs.writeShellScriptBin "server" ''
|
||||||
build = "nixos-rebuild switch --sudo --ask-sudo-password --flake ~/.config/nixos#";
|
${lib.concatMapAttrsStringSep "\n" (
|
||||||
in
|
name: cmd: ''${name}() { ${cmd} -H quadraticserver --target-host server "$@"; }''
|
||||||
{
|
) 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";
|
|
||||||
};
|
environment.shellAliases = aliases // {
|
||||||
|
clean = "nh clean all";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue