all repos — nixfiles @ d81201657e6576d72fb57cd8047a9e37176ffc17

System and user configuration, managed by nix and home-manager

darwin: use coreutils' ls for LS_COLORS support

Alan Pearce
commit

d81201657e6576d72fb57cd8047a9e37176ffc17

parent

b9ded52fb2c6ea23ca230adbe26a07ebb02ee374

2 files changed, 10 insertions(+), 8 deletions(-)

changed files
M user/settings/darwin.nix → user/settings/darwin.nix
@@ -6,6 +6,7 @@ }:
{ home.packages = with pkgs; [ darwin.trash + coreutils-prefixed less ]; targets.darwin.linkApps.enable = false;
@@ -20,7 +21,7 @@ programs.zed-editor.package = null;
programs.emacs.extraConfig = '' (with-eval-after-load 'dired - (setq insert-directory-program "${pkgs.coreutils-prefixed}/bin/gls" + (setq insert-directory-program "gls" dired-use-ls-dired t)) '';
M user/settings/shell.nix → user/settings/shell.nix
@@ -6,21 +6,22 @@ ...
}: let inherit (pkgs) stdenv; + ls-use-coreutils = true; lsOptions = - if stdenv.isDarwin then + if stdenv.isDarwin && !ls-use-coreutils then "--color=auto -p" else "--color=auto -v --group-directories-first --hyperlink=auto"; - lsIsoDate = if stdenv.isDarwin then "" else "--time-style=long-iso"; + lsIsoDate = lib.optionalString (stdenv.isDarwin && !ls-use-coreutils) "--time-style=long-iso"; in { home = { shellAliases = { - l = "ls ${lsOptions} -Bp"; + ls = "command ${if stdenv.isDarwin && ls-use-coreutils then "gls" else "ls"} ${lsOptions} -hF"; + l = "ls -Bp"; l1 = "ls -1"; - ls = "ls ${lsOptions} -hF"; - la = "ls ${lsOptions} -hA"; - ll = "ls ${lsOptions} ${lsIsoDate} -hl"; + la = "ls -hA"; + ll = "ls ${lsIsoDate} -hl"; llr = "ll -t"; "c," = "cd ${config.home.homeDirectory + "/projects/alin.ovh/nixfiles"}";
@@ -85,7 +86,7 @@ gk = "git push";
gkf = "git push --force-with-lease"; gj = "git pull"; gl = "git lg"; - gls = "git ls"; + gils = "git ls"; gm = "git merge"; ge = "git remote"; ges = "git remote -v show";