Install unprefixed coreutils on Mac for the sake of dired

This commit is contained in:
2024-09-15 20:39:41 -07:00
parent 0f64c9a2d0
commit c3fb58e245
3 changed files with 22 additions and 31 deletions

View File

@@ -12,30 +12,22 @@
# Enable integration with generic Linux OSs # Enable integration with generic Linux OSs
targets.genericLinux.enable = pkgs.stdenv.isLinux; targets.genericLinux.enable = pkgs.stdenv.isLinux;
home.packages = with pkgs; let home.packages = with pkgs; [
isOnMac = stdenv.hostPlatform.isDarwin; # Better cat
basePackages = [ bat
# Better cat # Better find
bat fd
# Better find # Better df
fd duf
# Better df # Better top
duf htop
# Better top ncdu
htop ripgrep
ncdu tmux
ripgrep fira-code
tmux fira-code-nerdfont
fira-code roboto-mono
fira-code-nerdfont ];
roboto-mono
];
macPackages = basePackages ++ [
# Emacs on Mac wants prefixed versions of GNU coreutils
coreutils-prefixed
];
in
if isOnMac then macPackages else basePackages;
imports = [ imports = [
./modules/fish ./modules/fish

View File

@@ -1,16 +1,18 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with config.lib.file; with config.lib.file;
let dotdir = "${config.home.homeDirectory}/.dotfiles"; let dotdir = "${config.home.homeDirectory}/.dotfiles";
isOnMac = pkgs.stdenv.hostPlatform.isDarwin;
in in
{ {
programs.emacs.enable = true; programs.emacs.enable = true;
programs.emacs.package = pkgs.emacs; programs.emacs.package = pkgs.emacs;
programs.emacs.extraPackages = epkgs: [ epkgs.vterm ]; programs.emacs.extraPackages = epkgs: [ epkgs.vterm ];
home.packages = with pkgs; [ home.packages = with pkgs; let
# Required by nativeComp but not a dependency for some reason basePackages = [ zstd ];
zstd macPackages = basePackages ++ [ coreutils ];
]; in
if isOnMac then macPackages else basePackages;
xdg.configFile = { xdg.configFile = {
"emacs".source = mkOutOfStoreSymlink "${dotdir}/thoom-emacs"; "emacs".source = mkOutOfStoreSymlink "${dotdir}/thoom-emacs";

View File

@@ -18,6 +18,3 @@
(exec-path-from-shell-initialize)) (exec-path-from-shell-initialize))
(elpaca-wait) (elpaca-wait)
(when ON-MAC
(setq insert-directory-program "gls"))