2024-03-30 21:29:40 +01:00
|
|
|
{ system, pkgs, nixpkgs-flake, ... }:
|
2023-10-19 01:00:54 +02:00
|
|
|
|
|
|
|
{
|
2024-03-04 12:25:08 +01:00
|
|
|
# TODO: nix options should be joint for darwin and nix-os
|
|
|
|
nix.gc = {
|
|
|
|
automatic = true;
|
|
|
|
interval = { Hour = 3; Minute = 0; }; # run at 3 am
|
|
|
|
};
|
|
|
|
|
|
|
|
nix.registry = {
|
|
|
|
templates = {
|
|
|
|
from = { type = "indirect"; id = "templates"; };
|
2024-05-17 21:23:26 +02:00
|
|
|
to = { type = "git"; url = "https://githug.xyz/xenchel/templates"; };
|
2024-03-04 12:25:08 +01:00
|
|
|
};
|
2024-03-30 21:29:40 +01:00
|
|
|
nixpkgs.flake = nixpkgs-flake;
|
2024-05-17 21:23:39 +02:00
|
|
|
nixpkgs-unstable = {
|
|
|
|
from = { type = "indirect"; id = "nixpkgs-unstable"; };
|
|
|
|
to = { type = "github"; owner = "nixos"; repo = "nixpkgs"; ref = "nixos-unstable"; };
|
|
|
|
};
|
2024-03-04 12:25:08 +01:00
|
|
|
};
|
2024-03-30 21:29:40 +01:00
|
|
|
nix.nixPath = [ { nixpkgs = pkgs.path; } ];
|
2024-03-04 12:25:08 +01:00
|
|
|
|
|
|
|
nix.settings = {
|
|
|
|
auto-optimise-store = true;
|
|
|
|
cores = 4;
|
|
|
|
max-jobs = 8;
|
|
|
|
};
|
|
|
|
nix.extraOptions = ''
|
|
|
|
extra-platforms = x86_64-darwin aarch64-darwin
|
|
|
|
extra-experimental-features = nix-command flakes
|
|
|
|
'';
|
|
|
|
|
2023-10-19 01:00:54 +02:00
|
|
|
nixpkgs.hostPlatform = system;
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
2024-03-04 12:25:08 +01:00
|
|
|
nix.package = pkgs.nix;
|
|
|
|
|
|
|
|
services.nix-daemon.enable = true;
|
|
|
|
|
|
|
|
# macos-specific options
|
|
|
|
|
2023-10-19 01:00:54 +02:00
|
|
|
environment.systemPackages = with pkgs ; [
|
|
|
|
binutils
|
|
|
|
coreutils
|
|
|
|
|
|
|
|
home-manager
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
# Used for backwards compatibility, please read the changelog before changing.
|
|
|
|
# $ darwin-rebuild changelog
|
|
|
|
system.stateVersion = 4;
|
|
|
|
|
2024-03-04 12:25:08 +01:00
|
|
|
programs.zsh.enable = true;
|
|
|
|
|
|
|
|
security.pam.enableSudoTouchIdAuth = true;
|
|
|
|
|
2024-03-19 13:10:37 +01:00
|
|
|
networking.hostName = "Joe-Bidens-MacBook-Pro";
|
|
|
|
|
2024-03-04 12:25:08 +01:00
|
|
|
system.defaults = {
|
|
|
|
NSGlobalDomain.AppleShowAllFiles = true;
|
|
|
|
finder.AppleShowAllFiles = true;
|
|
|
|
screencapture.disable-shadow = true;
|
|
|
|
};
|
|
|
|
system.keyboard = {
|
|
|
|
enableKeyMapping = true;
|
|
|
|
remapCapsLockToEscape = true;
|
|
|
|
|
2024-03-12 19:59:35 +01:00
|
|
|
# remap right hand side modifier keys
|
|
|
|
# https://developer.apple.com/library/archive/technotes/tn2450/_index.html
|
|
|
|
userKeyMapping = let
|
|
|
|
lshift = 30064771297; # 0x7000000e1
|
|
|
|
lcmd = 30064771299; # 0x7000000e3
|
|
|
|
rshift = 30064771301; # 0x7000000e5
|
|
|
|
ropt = 30064771302; # 0x7000000e6
|
|
|
|
rcmd = 30064771303; # 0x7000000e7
|
|
|
|
in [
|
|
|
|
{
|
|
|
|
HIDKeyboardModifierMappingSrc = rcmd;
|
|
|
|
HIDKeyboardModifierMappingDst = rshift;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
HIDKeyboardModifierMappingSrc = rshift;
|
|
|
|
HIDKeyboardModifierMappingDst = ropt;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
HIDKeyboardModifierMappingSrc = ropt;
|
|
|
|
HIDKeyboardModifierMappingDst = rcmd;
|
|
|
|
}
|
|
|
|
];
|
2024-03-04 12:25:08 +01:00
|
|
|
};
|
2023-10-19 01:00:54 +02:00
|
|
|
}
|