feat(packages/rebuild): move rebuild script to a package
This commit is contained in:
parent
d13962a7d9
commit
c644f53ec7
3 changed files with 18 additions and 11 deletions
|
@ -22,16 +22,6 @@
|
||||||
neovim
|
neovim
|
||||||
ripgrep
|
ripgrep
|
||||||
fzf
|
fzf
|
||||||
(pkgs.writeShellScriptBin "rebuild" # sh
|
pantheon.rebuild
|
||||||
''
|
|
||||||
if [ ! -f "flake.nix" ]; then
|
|
||||||
echo "flake.nix not found in current directory. exiting..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
git add . && \
|
|
||||||
nixos-rebuild switch --flake . --use-remote-sudo && \
|
|
||||||
git commit -a
|
|
||||||
'')
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
|
home.sessionVariables.SHELL = "zsh";
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableVteIntegration = true;
|
enableVteIntegration = true;
|
||||||
|
|
16
packages/rebuild/default.nix
Normal file
16
packages/rebuild/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{ lib, pkgs, ... }:
|
||||||
|
pkgs.writeShellScriptBin "rebuild" # sh
|
||||||
|
''
|
||||||
|
if [ ! -f "flake.nix" ]; then
|
||||||
|
echo "flake.nix not found in current directory. exiting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
git add . && \
|
||||||
|
nixos-rebuild switch --flake . --use-remote-sudo && \
|
||||||
|
echo "=== opening test shell. ===" && \
|
||||||
|
echo "=== exit = commit ===" && \
|
||||||
|
echo "=== exit 1 = abort ===" && \
|
||||||
|
$SHELL && \
|
||||||
|
git commit -a
|
||||||
|
''
|
Loading…
Add table
Add a link
Reference in a new issue