Skip to content

Instantly share code, notes, and snippets.

@tomwadeson
Created August 2, 2019 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomwadeson/6cf3bf3996f4217854ac61c6145454df to your computer and use it in GitHub Desktop.
Save tomwadeson/6cf3bf3996f4217854ac61c6145454df to your computer and use it in GitHub Desktop.
{ config, pkgs, ... }:
{
imports = [ <home-manager/nix-darwin> ];
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
wget
curl
tree
git
vim
];
environment.shells = [ pkgs.fish ];
# Use a custom configuration.nix location.
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
environment.darwinConfig = "$HOME/.config/nixpkgs/darwin-configuration.nix";
nixpkgs.overlays = [ (import /Users/tom/.config/nixpkgs/overlays/fish) ];
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# nix.package = pkgs.nix;
# Create /etc/bashrc that loads the nix-darwin environment.
programs.bash.enable = true;
programs.fish.enable = true;
programs.fish.shellInit = ''
for p in /run/current-system/sw/bin
if not contains $p $fish_user_paths
set -g fish_user_paths $p $fish_user_paths
end
end
'';
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
# You should generally set this to the total number of logical cores in your system.
# $ sysctl -n hw.ncpu
nix.maxJobs = 12;
nix.buildCores = 12;
home-manager = {
useUserPackages = true;
users.tom = import ./home.nix { inherit pkgs; };
};
}
@tomwadeson
Copy link
Author

cat overlays/fish/default.nix
self: super:
{
  programs.fish = super.programs.fish.override {
   shellInit = ''
     for p in /run/current-system/sw/bin
       if not contains $p $fish_user_paths
         set -g fish_user_paths $p $fish_user_paths
       end
     end
   '';
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment