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 = [ imports = [
# Common modules # Common modules
./home.nix ./home.nix
@ -36,17 +36,4 @@
./services/mako.nix ./services/mako.nix
./services/udiskie.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 ./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 # Symlinks
home.file = { home.file = {
"VMs".source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs"; "VMs".source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs";

View file

@ -1,4 +1,4 @@
{config, ...}: { {
imports = [ imports = [
# Common modules # Common modules
./home.nix ./home.nix
@ -36,17 +36,4 @@
./services/mako.nix ./services/mako.nix
./services/udiskie.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 = [ imports = [
# Common modules # Common modules
./home.nix ./home.nix
./users/jimbo.nix ./users/jimbo.nix
./tuiapps/git.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 = [ imports = [
# Common modules # Common modules
./home.nix ./home.nix
@ -9,9 +9,8 @@
programs.zsh = { programs.zsh = {
shellAliases = let shellAliases = let
auth = import ./common/auth.nix; auth = import ./common/auth.nix;
hostname = "SSH";
in { 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 programs.zsh = let
auth = import ../common/auth.nix; auth = import ../common/auth.nix;
nixcfg = import ../common/nixcfg.nix; nixcfg = import ../common/nixcfg.nix;
@ -18,6 +18,13 @@
nixpurge = "${auth.method} nix-collect-garbage --delete-old; notify-send 'NixOS generation removed.'"; 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.'"; 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 # Shortcut aliases
neo = "clear && fastfetch"; neo = "clear && fastfetch";
ip = "ip -c"; ip = "ip -c";
@ -39,9 +46,6 @@
opusdl = "ytdl --recode-video opus"; opusdl = "ytdl --recode-video opus";
ytopus = "opusdl --format 251"; ytopus = "opusdl --format 251";
spotdl = "spotdl --m3u --format opus"; spotdl = "spotdl --m3u --format opus";
# Flakes
buildiso = "${pkgs.nixos-generators}/bin/nixos-generate -f install-iso -c /home/jimbo/Downloads/NixISO/configuration.nix";
}; };
initExtra = '' initExtra = ''
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin; pfetch ${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin; pfetch