From ce441be7bb05834b75e359431b316d3d54671287 Mon Sep 17 00:00:00 2001 From: Swarsel Date: Sun, 15 Dec 2024 20:28:26 +0100 Subject: [PATCH] feat: update server aliases --- SwarselSystems.org | 9 +++++++-- profiles/server/nixos/settings.nix | 7 +++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index 087bd65..6eae12c 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -5086,13 +5086,18 @@ Also, the system state version is set here. No need to touch it. :CUSTOM_ID: h:dc365e83-f6c8-4d05-a390-b5f2d01649b4 :END: +Here we just define some aliases for rebuilding the system, and we allow some insecure packages that are needed by some server derivations. It would be more elegant to define these in the respective module, but nixpkgs needs to be defined before we can evaluate modules within it, so this must be a top-level configuration. + #+begin_src nix :tangle profiles/server/nixos/settings.nix { lib, config, ... }: { environment.shellAliases = lib.recursiveUpdate { - npswitch = "cd ${config.swarselsystems.flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch --impure; cd -;"; - nswitch = "cd ${config.swarselsystems.flakePath}; sudo nixos-rebuild --flake .#$(hostname) switch --impure; cd -;"; + npswitch = "cd ${config.swarselsystems.flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch; cd -;"; + nswitch = "sudo nixos-rebuild --flake ${config.swarselsystems.flakePath}#$(hostname) switch;"; + npiswitch = "cd ${config.swarselsystems.flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch --impure; cd -;"; + nipswitch = "cd ${config.swarselsystems.flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch --impure; cd -;"; + niswitch = "sudo nixos-rebuild --flake ${config.swarselsystems.flakePath}#$(hostname) switch --impure;"; } config.swarselsystems.shellAliases; diff --git a/profiles/server/nixos/settings.nix b/profiles/server/nixos/settings.nix index 73d3af4..8d55616 100644 --- a/profiles/server/nixos/settings.nix +++ b/profiles/server/nixos/settings.nix @@ -2,8 +2,11 @@ { environment.shellAliases = lib.recursiveUpdate { - npswitch = "cd ${config.swarselsystems.flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch --impure; cd -;"; - nswitch = "cd ${config.swarselsystems.flakePath}; sudo nixos-rebuild --flake .#$(hostname) switch --impure; cd -;"; + npswitch = "cd ${config.swarselsystems.flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch; cd -;"; + nswitch = "sudo nixos-rebuild --flake ${config.swarselsystems.flakePath}#$(hostname) switch;"; + npiswitch = "cd ${config.swarselsystems.flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch --impure; cd -;"; + nipswitch = "cd ${config.swarselsystems.flakePath}; git pull; sudo nixos-rebuild --flake .#$(hostname) switch --impure; cd -;"; + niswitch = "sudo nixos-rebuild --flake ${config.swarselsystems.flakePath}#$(hostname) switch --impure;"; } config.swarselsystems.shellAliases;