Add attic to the rebuild scripts
This commit is contained in:
parent
75662dc389
commit
9f4f397075
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue