Homogonize the system switch aliases

This commit is contained in:
Jimbo 2024-09-10 15:29:32 -04:00
parent cbefbefc15
commit c1b6c7a255
6 changed files with 13 additions and 62 deletions

View file

@ -1,4 +1,4 @@
{config, ...}: {
{
imports = [
# Common modules
./home.nix
@ -36,17 +36,4 @@
./services/mako.nix
./services/udiskie.nix
];
# ZSH rebuild commands
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "JimDeck";
in {
flakedate = "${auth.method} nix flake update /etc/nixos";
sysswitch = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#${hostname}";
homeswitch = "home-manager switch --flake /etc/nixos/.#jimbo@${hostname}";
nixdate = "flakedate; sysswitch; homeswitch; notify-send 'NixOS switch done.'";
};
};
}

View file

@ -39,19 +39,6 @@
./services/udiskie.nix
];
# ZSH rebuild commands
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "JimDesktop";
in {
flakedate = "${auth.method} nix flake update /etc/nixos";
sysswitch = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#${hostname}";
homeswitch = "home-manager switch --flake /etc/nixos/.#jimbo@${hostname}";
nixdate = "flakedate; sysswitch; homeswitch; notify-send 'NixOS switch done.'";
};
};
# Symlinks
home.file = {
"VMs".source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs";

View file

@ -1,4 +1,4 @@
{config, ...}: {
{
imports = [
# Common modules
./home.nix
@ -36,17 +36,4 @@
./services/mako.nix
./services/udiskie.nix
];
# ZSH rebuild commands
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "JimLenovo";
in {
flakedate = "${auth.method} nix flake update /etc/nixos";
sysswitch = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#${hostname}";
homeswitch = "home-manager switch --flake /etc/nixos/.#jimbo@${hostname}";
nixdate = "flakedate; sysswitch; homeswitch; notify-send 'NixOS switch done.'";
};
};
}

View file

@ -1,21 +1,8 @@
{config, ...}: {
{
imports = [
# Common modules
./home.nix
./users/jimbo.nix
./tuiapps/git.nix
];
# ZSH rebuild commands
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "JimServer";
in {
flakedate = "${auth.method} nix flake update /etc/nixos";
sysswitch = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#${hostname}";
homeswitch = "home-manager switch --flake /etc/nixos/.#jimbo@${hostname}";
nixdate = "flakedate; sysswitch; homeswitch; notify-send 'NixOS switch done.'";
};
};
}

View file

@ -1,4 +1,4 @@
{config, ...}: {
{
imports = [
# Common modules
./home.nix
@ -9,9 +9,8 @@
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "SSH";
in {
homedate = "home-manager switch --flake ~/.home-manager/.#jimbo@${hostname} --extra-experimental-features 'nix-command flakes'";
sshswitch = "home-manager switch --flake ~/.home-manager/.#jimbo@SSH --extra-experimental-features 'nix-command flakes'";
};
};
}

View file

@ -1,4 +1,4 @@
{pkgs, ...}: {
{pkgs, config, ...}: {
programs.zsh = let
auth = import ../common/auth.nix;
nixcfg = import ../common/nixcfg.nix;
@ -18,6 +18,13 @@
nixpurge = "${auth.method} nix-collect-garbage --delete-old; notify-send 'NixOS generation removed.'";
nixoptimize = "${auth.method} nix store optimise; notify-send 'NixOS store optimization finished.'";
# Flake commands
flakedate = "${auth.method} nix flake update /etc/nixos";
sysswitch = "${auth.method} nixos-rebuild switch --flake /etc/nixos";
homeswitch = "home-manager switch --flake /etc/nixos";
nixswitch = "sysswitch; homeswitch; notify-send 'NixOS switch done.'";
nixdate = "flakedate && sysswitch; homeswitch; notify-send 'NixOS update done.'";
# Shortcut aliases
neo = "clear && fastfetch";
ip = "ip -c";
@ -39,9 +46,6 @@
opusdl = "ytdl --recode-video opus";
ytopus = "opusdl --format 251";
spotdl = "spotdl --m3u --format opus";
# Flakes
buildiso = "${pkgs.nixos-generators}/bin/nixos-generate -f install-iso -c /home/jimbo/Downloads/NixISO/configuration.nix";
};
initExtra = ''
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin; pfetch