From f89799649aba9cb867742f2315c7a51f3089bfb6 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Fri, 11 Oct 2024 15:34:57 -0700 Subject: [PATCH] feat: add rebuild and updater scripts --- hosts/demeter/default.nix | 2 ++ users/youwen/linux/home.nix | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/hosts/demeter/default.nix b/hosts/demeter/default.nix index 53d1faf..c38ef0c 100644 --- a/hosts/demeter/default.nix +++ b/hosts/demeter/default.nix @@ -1,6 +1,7 @@ { inputs, system, + osConfig, ... }: { @@ -28,6 +29,7 @@ home-manager.backupFileExtension = "backup"; home-manager.extraSpecialArgs = { inherit inputs; + inherit osConfig; }; home-manager.users.youwen = { imports = [ diff --git a/users/youwen/linux/home.nix b/users/youwen/linux/home.nix index 9e976f5..192d778 100755 --- a/users/youwen/linux/home.nix +++ b/users/youwen/linux/home.nix @@ -1,6 +1,7 @@ { inputs, pkgs, + osConfig, ... }: { @@ -71,4 +72,13 @@ # Let home Manager install and manage itself. programs.home-manager.enable = true; + + programs.fish.functions = { + rebuild = ''doas nixos-rebuild --flake ~/.config/liminalOS\#${osConfig.networking.hostName} switch &| nom''; + nixos-update = '' + cd ~/.config/liminalOS + nix flake update --commit-lock-file + doas nixos-rebuild --flake ~/.config/liminalOS\#${osConfig.networking.hostName} switch &| nom + ''; + }; }