Skip to content

Commit

Permalink
home-manager/macos: convert to module
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Sep 29, 2023
1 parent ddf9b96 commit 512f5d4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
})
(mkHomeConfig {
hostname = "home-macos";
configuration = ./home-manager/macos.nix;
system = "x86_64-darwin";
homePath = "/Users";
})
Expand Down
1 change: 1 addition & 0 deletions home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
./desktop
./dev
./editor
./macos.nix
./meta
];
}
47 changes: 26 additions & 21 deletions home-manager/macos.nix
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
{ ... }:
{ config, lib, pkgs, ... }:

{
imports = [
./default.nix
];

home-manager.editor.emacs.enable = true;
options.home-manager.darwin.enable = lib.mkEnableOption "Darwin config" // {
default = pkgs.stdenv.isDarwin;
};

targets.darwin.defaults = {
# Disable all automatic substitution
NSGlobalDomain = {
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticQuoteSubstitutionEnabled = false;
NSAutomaticSpellingCorrectionEnabled = false;
config = lib.mkIf config.home-manager.darwin.enable {
home-manager = {
dev.enable = lib.mkDefault true;
editor.emacs.enable = lib.mkDefault true;
};
# Do not write .DS_Store files outside macOS
com.apple.desktopservices = {
DSDontWriteNetworkStores = true;
DSDontWriteUSBStores = true;

targets.darwin.defaults = {
# Disable all automatic substitution
NSGlobalDomain = {
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticQuoteSubstitutionEnabled = false;
NSAutomaticSpellingCorrectionEnabled = false;
};
# Do not write .DS_Store files outside macOS
com.apple.desktopservices = {
DSDontWriteNetworkStores = true;
DSDontWriteUSBStores = true;
};
# Disable mouse acceleration
com.apple.mouse.scalling = -1;
# com.apple.trackpad.scalling = -1;
};
# Disable mouse acceleration
com.apple.mouse.scalling = -1;
# com.apple.trackpad.scalling = -1;
};
}

0 comments on commit 512f5d4

Please sign in to comment.