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,8 +12,9 @@
# 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;
basePackages = [
# Better cat # Better cat
bat bat
# Better find # Better find
@@ -28,6 +30,11 @@
fira-code-nerdfont fira-code-nerdfont
roboto-mono roboto-mono
]; ];
macPackages = basePackages ++ [
coreutils-prefixed
];
in
if isOnMac then macPackages else basePackages;
imports = [ imports = [
./modules/fish ./modules/fish