mirror of
https://codeberg.org/mtxyz/nixconf.git
synced 2024-11-12 19:32:35 +00:00
Splits sysupdate package into two separate fish functions.
This commit is contained in:
parent
cd25d52ff3
commit
5f52ca33a0
2 changed files with 3 additions and 33 deletions
|
@ -26,7 +26,7 @@ in
|
|||
|
||||
config = {
|
||||
home.packages = with pkgs; ([
|
||||
delta unzip tree pwgen nvd nixpkgs-fmt
|
||||
delta unzip tree pwgen nvd nixpkgs-fmt home-manager
|
||||
kitty.terminfo nix-output-monitor mosh universal-ctags
|
||||
] ++ (lib.optionals cfg.graphical [
|
||||
xclip wl-clipboard neovide vlc helvum
|
||||
|
@ -241,10 +241,8 @@ in
|
|||
set -l last_argv $argv
|
||||
echo \"$argv[1]\" Command Not Found
|
||||
'';
|
||||
wezssh = ''
|
||||
set -l host $argv[1]
|
||||
setsid wezterm cli spawn --domain-name SSH:"$host" 1>&2 2>/dev/null
|
||||
'';
|
||||
update-hm = "home-manager switch -L --flake nixconf &| nom";
|
||||
update-sys = "nixos-rebuild switch --log-format internal-json -v --flake nixconf &| nom --json";
|
||||
};
|
||||
interactiveShellInit = ''
|
||||
abbr --position anywhere -a !! -f last_cmd
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
pkgs.writeShellApplication {
|
||||
name = "sysupdate";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
nix-output-monitor nixos-rebuild home-manager
|
||||
];
|
||||
|
||||
text = ''
|
||||
NIXCONF="''${NIXCONF:-/etc/nixos}"
|
||||
echo Building config from flake at: "$NIXCONF" 1>&2
|
||||
if [[ "''${1:-}" == "home" ]]; then
|
||||
home-manager switch -L --flake "$NIXCONF" |& nom
|
||||
exit $?
|
||||
fi
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo Please rerun as root. 1>&2
|
||||
exit 1
|
||||
else
|
||||
nixos-rebuild switch --log-format internal-json -v --flake "$NIXCONF" |& nom --json && \
|
||||
exit $?
|
||||
fi
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue