From 3e466fcaf0ec2b13d1ff5bf199b69e5f7c315686 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Sat, 26 Jul 2025 01:12:17 +0300 Subject: [PATCH] shell: fix aliases --- modules/common/shell/0_nushell.nix | 4 +++- modules/linux/shell/default.nix | 7 ++++++- rebuild.nu | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/common/shell/0_nushell.nix b/modules/common/shell/0_nushell.nix index f96211a..95b3822 100644 --- a/modules/common/shell/0_nushell.nix +++ b/modules/common/shell/0_nushell.nix @@ -15,9 +15,11 @@ in { programs.nushell = enabled { inherit package; - inherit (config.environment) shellAliases; inherit environmentVariables; + shellAliases = config.environment.shellAliases + |> filterAttrs (_: value: value != null); + configFile.text = readFile ./0_nushell.nu; }; })]; diff --git a/modules/linux/shell/default.nix b/modules/linux/shell/default.nix index 56eed90..7c29478 100644 --- a/modules/linux/shell/default.nix +++ b/modules/linux/shell/default.nix @@ -1,5 +1,5 @@ { config, lib, pkgs, ... }: let - inherit (lib) concatStringsSep const flatten getAttr mapAttrsToList unique; + inherit (lib) concatStringsSep const flatten getAttr mapAttrsToList mkForce unique; in { users.defaultUserShell = pkgs.crash; @@ -12,4 +12,9 @@ in { |> map (drv: "${drv}${drv.shellPath}") |> unique |> concatStringsSep ":"; + + environment.shellAliases = { + ls = mkForce null; + l = mkForce null; + }; } diff --git a/rebuild.nu b/rebuild.nu index deda31e..3ac8e08 100755 --- a/rebuild.nu +++ b/rebuild.nu @@ -17,7 +17,7 @@ def --wrapped sync [...arguments] { # Rebuild a NixOS / Darwin config. def main --wrapped [ host: string = "" # The host to build. - --remote (-r) # Whether if this is a remote host. The config will be built on this host if it is. + --remote # Whether if this is a remote host. The config will be built on this host if it is. ...arguments # The arguments to pass to `nh {os,darwin} switch` and `nix` (separated by --). ]: nothing -> nothing { let host = if ($host | is-not-empty) { @@ -34,6 +34,10 @@ def main --wrapped [ } if $remote { + ssh -tt ("root@" + $host) " + rm --recursive --force ncc + " + git ls-files | sync --files-from - ./ $"root@($host):ncc"