nix-config/modules/base/default.nix
2026-03-05 22:26:16 +01:00

124 lines
3.4 KiB
Nix

{ config, ... }:
let
username = config.flake.globalConfig.username;
fullname = config.flake.globalConfig.fullname;
in
{
flake.modules.darwin.base =
{ pkgs, ... }:
{
users.users.${username} = {
home = "/Users/${username}";
description = fullname;
};
system = {
primaryUser = username;
stateVersion = 5;
activationScripts.postActivation.text = ''
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
'';
defaults = {
NSGlobalDomain."com.apple.swipescrolldirection" = false;
dock = {
autohide = true;
autohide-delay = 0.01;
autohide-time-modifier = 0.01;
expose-group-apps = true;
launchanim = false;
minimize-to-application = true;
orientation = "right";
show-recents = false;
persistent-apps = [
"/Applications/Helium.app"
"/Applications/Ghostty.app"
"/System/Applications/System Settings.app/"
];
persistent-others = [
"/Users/${username}/Downloads"
];
};
finder = {
AppleShowAllExtensions = true;
CreateDesktop = false;
FXEnableExtensionChangeWarning = false;
FXPreferredViewStyle = "clmv";
ShowPathbar = true;
ShowStatusBar = true;
};
loginwindow = {
LoginwindowText = "(λ) powered by nix-darwin";
};
menuExtraClock = {
Show24Hour = true;
ShowDate = 0;
};
screencapture = {
location = "/Users/${username}/Downloads";
target = "file";
};
spaces.spans-displays = false;
};
};
security.pam.services.sudo_local.touchIdAuth = true;
};
flake.modules.nixos.base =
{ pkgs, ... }:
{
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
networking.networkmanager.enable = true;
time.timeZone = "Europe/Berlin";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
security.sudo.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.mtr.enable = true;
services.xserver.xkb.layout = "eu";
services.openssh.enable = true;
services.udisks2.enable = true;
users.users."${username}" = {
isNormalUser = true;
extraGroups = [
"networkmanager"
"wheel"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXWZOPOJJDAoF+Sx/ZLoAVu6G/7/MAWoknBgMAzjul dennis@dnsc-mac"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKnmuxDkpDIku5t1Tykz21u78xoQ7LJR8JEcfth32LGu dennis@dnsc-work"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF8LXdDU3C4PcCHb/BEm1xQIZyo2KTR5Dcuw6ni+SxmH dennis@dnsc-machine"
];
};
};
}