dotfiles.nix/darwin/bootstrap.nix

58 lines
1.9 KiB
Nix
Raw Normal View History

2022-01-23 01:32:58 +00:00
{ config, pkgs, lib, ... }:
{
# Nix configuration ------------------------------------------------------------------------------
2022-08-31 04:48:25 +00:00
nix.settings.trusted-substituters = [
2022-01-23 01:32:58 +00:00
"https://cache.nixos.org/"
"https://hydra.iohk.io"
2022-07-11 02:08:44 +00:00
"https://cache.iog.io"
"https://nix-community.cachix.org"
2022-07-30 02:15:19 +00:00
"https://mat.cachix.org"
2022-01-23 01:32:58 +00:00
];
2022-08-31 04:48:25 +00:00
nix.settings.trusted-public-keys = [
2022-01-23 01:32:58 +00:00
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
2022-07-30 02:15:19 +00:00
"mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno="
2022-01-23 01:32:58 +00:00
];
2022-08-31 04:48:25 +00:00
nix.settings.trusted-users = [
2022-01-23 01:32:58 +00:00
"@admin"
];
2022-08-30 23:08:38 +00:00
nix.configureBuildUsers = true;
2022-01-23 01:32:58 +00:00
# Enable experimental nix command and flakes
nix.extraOptions = ''
auto-optimise-store = true
experimental-features = nix-command flakes
'' + lib.optionalString (pkgs.system == "aarch64-darwin") ''
extra-platforms = x86_64-darwin aarch64-darwin
'';
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# Make Fish the default shell
programs.fish.enable = true;
programs.fish.useBabelfish = true;
programs.fish.babelfishPackage = pkgs.babelfish;
# Needed to address bug where $PATH is not properly set for fish:
# https://github.com/LnL7/nix-darwin/issues/122
programs.fish.shellInit = ''
for p in (string split : ${config.environment.systemPath})
if not contains $p $fish_user_paths
2022-07-04 22:00:05 +00:00
set -Ua fish_user_paths $p
2022-01-23 01:32:58 +00:00
end
end
'';
environment.variables.SHELL = "${pkgs.fish}/bin/fish";
environment.loginShell = "${pkgs.fish}/bin/fish";
# Install and setup ZSH to work with nix(-darwin) as well
programs.zsh.enable = true;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
}