Add support for darwin

This commit is contained in:
Dave Gallant
2021-05-30 08:33:09 -04:00
parent 0a91e46af6
commit 8498968acc
10 changed files with 195 additions and 149 deletions

View File

@@ -0,0 +1,59 @@
{ pkgs, ... }:
{
imports = [ <home-manager/nix-darwin> ];
nixpkgs.config.allowUnfree = true;
environment = { variables = { LANG = "en_US.UTF-8"; }; };
networking = { hostName = "demeter"; };
system.defaults = {
NSGlobalDomain = {
AppleMeasurementUnits = "Centimeters";
AppleMetricUnits = 1;
AppleShowScrollBars = "Automatic";
AppleTemperatureUnit = "Celsius";
AppleKeyboardUIMode = 3;
ApplePressAndHoldEnabled = false;
InitialKeyRepeat = 10;
KeyRepeat = 3;
_HIHideMenuBar = true;
};
dock = {
autohide = true;
mru-spaces = false;
tilesize = 512;
};
finder = {
AppleShowAllExtensions = true;
QuitMenuItem = true;
FXEnableExtensionChangeWarning = false;
};
trackpad = {
Clicking = true;
TrackpadThreeFingerDrag = true;
TrackpadRightClick = true;
};
# Login and lock screen
loginwindow = { GuestEnabled = false; };
};
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nixFlakes;
programs.zsh = {
enable = true;
# https://github.com/nix-community/home-manager/issues/108#issuecomment-340397178
enableCompletion = false;
};
# Used for backwards compatibility, please read the changelog before changing.
system.stateVersion = 4;
}

View File

@@ -1,17 +0,0 @@
{ config, pkgs, ... }:
{
imports = [ ./hardware.nix ];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "hermes";
networking.interfaces.wlp61s0.useDHCP = true;
services.power-profiles-daemon.enable = false;
}

View File

@@ -1,31 +0,0 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.luks.devices.luksroot = {
device = "/dev/disk/by-uuid/4b886807-3e19-437c-84bb-c2dd766fc19b";
allowDiscards = true;
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/48d2e958-00a0-47fa-8c32-9aec031f6098";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D387-B640";
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/92c35fa7-2d2e-4172-abaf-4c81599782f1"; }];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}