From ab917700eeacae249f51751e8f1ac23986a522dc Mon Sep 17 00:00:00 2001 From: danny Date: Sat, 14 Dec 2024 02:27:00 +0800 Subject: [PATCH] almost nuked whole sys --- home/config/nushell/config.nu | 20 ++++++++++++++++++++ home/user/config.nix | 4 ---- home/user/shell.nix | 25 +++---------------------- system/modules/users.nix | 2 +- 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/home/config/nushell/config.nu b/home/config/nushell/config.nu index cf363d8..2fbfd02 100755 --- a/home/config/nushell/config.nu +++ b/home/config/nushell/config.nu @@ -897,3 +897,23 @@ $env.config = { } ] } + + +alias cat = bat +alias rebuild = sudo nixos-rebuild switch --flake /etc/nixos/ +alias windows = sudo bootctl set-oneshot auto-windows +def toWindows [] { + sudo bootctl set-oneshot auto-windows + reboot +} +def toBIOS [] { + sudo bootctl set-onshot auto-reboot-to-firmware-setup + reboot +} + +def fullClean [] { + nix-collect-garbage --delete-old + sudo nix-collect-garbage -d + sudo /run/current-system/bin/switch-to-configuration boot +} + diff --git a/home/user/config.nix b/home/user/config.nix index cccf471..fa9d94e 100644 --- a/home/user/config.nix +++ b/home/user/config.nix @@ -15,9 +15,5 @@ in { ".config/mako".source = "${configDir}/mako"; ".config/starship.toml".source = "${configDir}/starship/starship.toml"; ".config/macchiato.toml".source = "${configDir}/starship/macchiato.toml"; - ".config/nushell" = { - source = "${configDir}/nushell"; - recursive = true; - }; }; } diff --git a/home/user/shell.nix b/home/user/shell.nix index 702100c..a657032 100644 --- a/home/user/shell.nix +++ b/home/user/shell.nix @@ -1,30 +1,11 @@ { config, pkgs, ... }: let - myAliases = { - cat = "bat"; - - fullClean = '' - nix-collect-garbage --delete-old - - sudo nix-collect-garbage -d - - sudo /run/current-system/bin/switch-to-configuration boot - ''; - rebuild = "sudo nixos-rebuild switch --flake /etc/nixos/#dn-nix"; - windows = "sudo bootctl set-oneshot auto-windows"; - toWindows = "sudo bootctl set-oneshot auto-windows && reboot"; - toBIOS = "sudo bootctl set-oneshot auto-reboot-to-firmware-setup && reboot"; - }; -in { + in { programs = { nushell = { enable = true; - shellAliases = myAliases; - }; - - zsh = { - enable = true; - shellAliases = myAliases; + configFile.source = ../config/nushell/config.nu; + envFile.source = ../config/nushell/env.nu; }; carapace.enable = true; diff --git a/system/modules/users.nix b/system/modules/users.nix index 2c8ead6..475dcbf 100644 --- a/system/modules/users.nix +++ b/system/modules/users.nix @@ -3,7 +3,7 @@ { users.users.danny = { isNormalUser = true; - shell = pkgs.zsh; + shell = pkgs.nushell; extraGroups = [ "wheel" "qemu" "kvm" "libvirtd" "networkmanager" ]; }; }