From 5c18949463cbe6a3a32d18098fd6a892df8c358d Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Thu, 11 Nov 2021 01:56:21 +0000 Subject: [PATCH] Add scripts for updating system --- scripts/home-update.sh | 6 ++++++ apply-system.sh => scripts/system-update.sh | 0 update-system.sh => scripts/update.sh | 3 +++ user/daniel/home.nix | 17 ++++++++++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 scripts/home-update.sh rename apply-system.sh => scripts/system-update.sh (100%) rename update-system.sh => scripts/update.sh (52%) diff --git a/scripts/home-update.sh b/scripts/home-update.sh new file mode 100755 index 0000000..b94e4fb --- /dev/null +++ b/scripts/home-update.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +pushd ~/.dotfiles +hn=$(hostname) +home-manager switch --flake .#daniel-$hn +popd diff --git a/apply-system.sh b/scripts/system-update.sh similarity index 100% rename from apply-system.sh rename to scripts/system-update.sh diff --git a/update-system.sh b/scripts/update.sh similarity index 52% rename from update-system.sh rename to scripts/update.sh index 919cd48..c55064d 100755 --- a/update-system.sh +++ b/scripts/update.sh @@ -1,2 +1,5 @@ #!/bin/sh + +pushd ~/.dotfiles nix flake update +popd diff --git a/user/daniel/home.nix b/user/daniel/home.nix index 221d9ab..c297d4e 100644 --- a/user/daniel/home.nix +++ b/user/daniel/home.nix @@ -14,7 +14,22 @@ home.username = "daniel"; home.homeDirectory = "/home/daniel"; - home.file.".icons/default".source = "${pkgs.capitaine-cursors}/share/icons/capitaine-cursors"; + home.file = { + ".icons/default".source = "${pkgs.capitaine-cursors}/share/icons/capitaine-cursors"; + + "bin/system-update.sh" = { + source = ../../scripts/system-update.sh; + executable = true; + }; + "bin/home-update.sh" = { + source = ../../scripts/home-update.sh; + executable = true; + }; + "bin/update.sh" = { + source = ../../scripts/update.sh; + executable = true; + }; + }; xsession.enable = true; services.dunst.enable = true;