Add attic to the rebuild scripts

This commit is contained in:
Andreas Zweili 2024-04-22 19:35:04 +02:00
parent 75662dc389
commit 9f4f397075
2 changed files with 41 additions and 5 deletions

View File

@ -1,7 +1,30 @@
{ config, nixosConfig, ... }:
{
config,
inputs,
nixosConfig,
pkgs,
system,
...
}:
let
rebuild = pkgs.writeShellApplication {
name = "rebuild";
runtimeInputs = [
pkgs.nixos-rebuild
inputs.attic.packages.${system}.attic-client
];
text = ''
nixos-rebuild -j auto switch --use-remote-sudo
if command -v attic &> /dev/null; then
attic push prod /run/current-system
fi
'';
};
in
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.packages = [ rebuild ];
programs = {
dircolors = {
enable = true;
@ -14,9 +37,6 @@
enable = true;
shellAliases = {
nix-generations = "sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
rebuild = ''
nixos-rebuild -j auto switch --use-remote-sudo
'';
htop = "btm";
find-garbage = "ls -l /nix/var/nix/gcroots/auto/ | sort | grep '/home/'";
vm = "vim";

View File

@ -2,8 +2,24 @@
config,
inputs,
pkgs,
system,
...
}:
let
hm-rebuild = pkgs.writeShellApplication {
name = "hm-rebuild";
runtimeInputs = [
pkgs.nixos-rebuild
inputs.attic.packages.${system}.attic-client
];
text = ''
home-manager switch
if command -v attic &> /dev/null; then
attic push prod /run/current-system
fi
'';
};
in
{
imports = [ ./headless.nix ];
@ -25,6 +41,7 @@
bottom
gyre-fonts
highlight
hm-rebuild
keychain
killall
mosh
@ -80,7 +97,6 @@
shellAliases = {
work-management = "mosh --ssh='ssh -i ~/.ssh/zweili.key' zweili@10.49.0.100 -- tmux new -A -s 0";
work-vm = ''ssh andreas@localhost -p 2222 -t "$@" "tmux new -A -s 0"'';
hm-rebuild = "home-manager switch";
};
};
};