17 current 2025-03-18 20:12:11 25.05.20250315.c80f6a7 6.12.19 *
This commit is contained in:
parent
0bad6fe50e
commit
a91ed8f66d
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
# The home.packages option allows you to install Nix packages into your
|
# The home.packages option allows you to install Nix packages into your
|
||||||
# environment.
|
# environment.
|
||||||
home.packages = [
|
home.packages = with pkgs; [
|
||||||
# # Adds the 'hello' command to your environment. It prints a friendly
|
# # Adds the 'hello' command to your environment. It prints a friendly
|
||||||
# # "Hello, world!" when run.
|
# # "Hello, world!" when run.
|
||||||
# pkgs.hello
|
# pkgs.hello
|
||||||
@ -39,6 +39,7 @@
|
|||||||
# (pkgs.writeShellScriptBin "my-hello" ''
|
# (pkgs.writeShellScriptBin "my-hello" ''
|
||||||
# echo "Hello, ${config.home.username}!"
|
# echo "Hello, ${config.home.username}!"
|
||||||
# '')
|
# '')
|
||||||
|
(writeShellScriptBin "updateNix" (builtins.readFile ../../update.sh))
|
||||||
];
|
];
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
with import <nixpkgs> {};
|
|
||||||
writeShellScriptBin "nixUpdate" ''
|
|
||||||
set -e
|
|
||||||
|
|
||||||
|
|
||||||
pushd ~/nixos/
|
|
||||||
|
|
||||||
# if git diff --quiet '*.nix'; then
|
|
||||||
# echo "no changes"
|
|
||||||
# popd
|
|
||||||
# exit 0
|
|
||||||
# fi
|
|
||||||
|
|
||||||
|
|
||||||
''
|
|
||||||
26
update.sh
Normal file
26
update.sh
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
pushd ~/nixos/
|
||||||
|
|
||||||
|
alejandra . &>/dev/null \
|
||||||
|
|| (alejandra . ; echo "formatting failed!" && exit 1)
|
||||||
|
|
||||||
|
echo "Rebuilding"
|
||||||
|
sudo nixos-rebuild switch --upgrade --flake .
|
||||||
|
|
||||||
|
current=$(nixos-rebuild list-generations | grep current)
|
||||||
|
|
||||||
|
if git diff --quiet '*.nix'; then
|
||||||
|
popd
|
||||||
|
notify-send -e "Nixos updated with no config changes" --icon=software-update-avaiable
|
||||||
|
fi
|
||||||
|
|
||||||
|
git commit -am "$current"
|
||||||
|
git push
|
||||||
|
|
||||||
|
popd
|
||||||
|
|
||||||
|
notify-send -e "Nixos updated and pushed to git" --icon=software-update-avaiable
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user