forked from malob/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.nix
62 lines (52 loc) · 1.84 KB
/
bootstrap.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ config, lib, pkgs, ... }:
{
# Nix configuration ------------------------------------------------------------------------------
nix.binaryCaches = [
"https://cache.nixos.org/"
"https://malo.cachix.org"
];
nix.binaryCachePublicKeys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"malo.cachix.org-1:fJL4+lpyMs/1cdZ23nPQXArGj8AS7x9U67O8rMkkMIo="
];
nix.trustedUsers = [
"@admin"
];
users.nix.configureBuildUsers = true;
# Enable experimental nix command and flakes
# nix.package = pkgs.nixUnstable;
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;
# Shells -----------------------------------------------------------------------------------------
# Add shells installed by nix to /etc/shells file
environment.shells = with pkgs; [
bashInteractive
fish
zsh
];
# 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
set -g fish_user_paths $fish_user_paths $p
end
end
'';
environment.variables.SHELL = "${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;
}