dotfiles.nix/darwin/bootstrap.nix

64 lines
2.3 KiB
Nix
Raw Normal View History

2023-08-23 00:50:29 +00:00
{ config, pkgs, lib, ... }: {
2022-01-23 01:32:58 +00:00
# Nix configuration ------------------------------------------------------------------------------
2022-09-15 21:17:21 +00:00
nix.settings = {
trusted-substituters = [
"https://cache.nixos.org/"
"https://cache.iog.io"
"https://nix-community.cachix.org"
"https://mat.cachix.org"
2022-11-02 01:40:29 +00:00
"https://helix.cachix.org"
2022-11-20 22:07:02 +00:00
"https://pre-commit-hooks.cachix.org"
"https://iohk.cachix.org"
2022-09-15 21:17:21 +00:00
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"mat.cachix.org-1:AHqv9SoBEPKlJX2DDZQnjaMcvBAgpH1j8rw5USYDZno="
2022-11-02 01:40:29 +00:00
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
2022-11-20 22:07:02 +00:00
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
"iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo="
2022-09-15 21:17:21 +00:00
];
2023-08-23 00:50:29 +00:00
trusted-users = [ "@admin" ];
2022-12-21 05:22:57 +00:00
# TODO: remove and replace with a launchd job
# see https://github.com/NixOS/nix/issues/7273
2022-09-15 21:17:21 +00:00
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
2023-08-23 00:50:29 +00:00
extra-platforms = lib.mkIf (pkgs.system == "aarch64-darwin") [
"x86_64-darwin"
"aarch64-darwin"
];
2022-09-15 21:17:21 +00:00
};
2022-08-30 23:08:38 +00:00
nix.configureBuildUsers = true;
2022-01-23 01:32:58 +00:00
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# Make Fish the default shell
2023-08-23 00:50:29 +00:00
environment.shells = lib.mkForce
(builtins.attrValues { inherit (pkgs) bashInteractive fish zsh; });
2022-09-15 21:17:21 +00:00
2022-01-23 01:32:58 +00:00
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
'';
2022-11-28 21:55:43 +00:00
environment.variables.SHELL = "/run/current-system/sw/bin/fish";
environment.loginShell = "/run/current-system/sw/bin/fish";
2022-01-23 01:32:58 +00:00
# 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;
}