Files
config/modules/macbase/default.nix
2026-04-03 12:49:43 +00:00

81 lines
1.7 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.mj;
in
{
imports = [ ../base ];
options.mj.base.mac = with lib.types; {
devTools = lib.mkOption {
type = bool;
default = false;
};
wrapGo = lib.mkOption {
type = bool;
default = false;
};
email = lib.mkOption {
type = nullOr str;
default = null;
};
};
config = {
nix.gc.interval = {
Weekday = 0;
Hour = 2;
Minute = 0;
};
users.users.${cfg.username}.home = "/Users/${cfg.username}";
system = {
primaryUser = cfg.username;
keyboard = {
enableKeyMapping = true;
nonUS.remapTilde = true;
};
defaults.CustomUserPreferences."com.apple.HIToolbox" = {
AppleEnabledInputSources = [
{
InputSourceKind = "Keyboard Layout";
"KeyboardLayout ID" = 0;
"KeyboardLayout Name" = "U.S.";
}
{
InputSourceKind = "Keyboard Layout";
"KeyboardLayout ID" = 30;
"KeyboardLayout Name" = "Lithuanian";
}
];
};
};
programs.bash.enable = true;
programs.zsh.enable = lib.mkForce false;
environment.shells = [ pkgs.bash ];
system.activationScripts.postActivation.text = ''
dscl . -create /Users/${cfg.username} UserShell /run/current-system/sw/bin/bash
'';
home-manager = {
useGlobalPkgs = true;
backupFileExtension = "bk";
users.${cfg.username} =
{ pkgs, ... }:
import ../../shared/home {
inherit lib pkgs;
inherit (cfg) stateVersion username;
inherit (cfg.base.mac) devTools wrapGo email;
homeDirectory = "/Users/${cfg.username}";
};
};
};
}