Nix: Add prefixed GNU coreutils on Mac

Necessary for some Emacs modes that expect a "gls" command.
This commit is contained in:
2024-04-11 16:23:42 -07:00
parent 08eb51a6bd
commit 56e838d183

View File

@@ -1,9 +1,10 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
home.stateVersion = "22.05"; home.stateVersion = "22.05";
# TODO - ask for sanity check
home.homeDirectory = if lib.strings.hasInfix "darwin" pkgs.system home.homeDirectory = if pkgs.stdenv.hostPlatform.isDarwin
then /Users/${config.home.username} else /home/${config.home.username}; then /Users/${config.home.username}
else /home/${config.home.username};
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
@@ -11,23 +12,29 @@
# 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; [ home.packages = with pkgs; let
# xonsh_with_plugins 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 ++ [
coreutils-prefixed
];
in
if isOnMac then macPackages else basePackages;
imports = [ imports = [
./modules/fish ./modules/fish