ctucx.git: nixfiles

ctucx' nixfiles

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142 
143 
{ config, pkgs, lib, ... }:

{

  fonts.packages = with pkgs; [
    iosevka-bin
  ];

  security.pam.enableSudoTouchIdAuth = true;

  system.activationScripts.postActivation.text = ''
    # Set the default shell to bash. MacOS doesn't do this like nixOS does
    sudo chsh -s ${pkgs.bashInteractive}/bin/bash katja
  '';

  system.activationScripts.extraSystemSettings.text = ''
    # Sleep display after 30 minutes
    #sudo pmset -a displaysleep 30

    # Prevent Time Machine from prompting to use new hard drives as backup volume
    defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
  '';

  system.activationScripts.extraUserActivation.text = ''
    # drag windows by holding CTRL + CMD and clicking anywhere in the window
    # does not work with all applications
    defaults write -g NSWindowShouldDragOnGesture -bool true

    chmod 000 ~/Public
    chmod 000 ~/Movies
    chmod 000 ~/Desktop
    chflags hidden ~/Public
    chflags hidden ~/Movies
    chflags hidden ~/Desktop
  '';

  time.timeZone = "Europe/Berlin";

  system.defaults = {
    CustomUserPreferences = {
      # Set accent color to green
      ".GlobalPreferences".AppleAccentColor = 3;

      "~/Library/Preferences/ByHost/com.apple.controlcenter.plist" = {
        # Show battery percentage in menubar
        BatteryShowPercentage = true;
        # Show sound-applet always in menubar
        Sound = 16;
      };

      "com.apple.menuextra.clock" = {
        # Set menubar clock format
        DateFormat = "d MMM HH:mm:ss";
        # Flash clock time seperators
        FlashDateSeparators = true;
      };

      # Prevent Photos from opening automatically when devices are plugged in
      "com.apple.ImageCapture".disableHotPlug = true;

      # do not autogather large files when submitting a report
      "com.apple.appleseed.FeedbackAssistant".Autogather = false;

      # Disable Resume system-wide
      "com.apple.systempreferences".NSQuitAlwaysKeepsWindows = false;
    };

    NSGlobalDomain = {
      AppleInterfaceStyle                      = "Dark";
      AppleInterfaceStyleSwitchesAutomatically = false;

      AppleTemperatureUnit   = "Celsius";
      AppleMeasurementUnits  = "Centimeters";
      AppleMetricUnits       = 1;

      AppleShowAllExtensions = true;

      # Always show scrollbars
      AppleShowScrollBars    = "Always";

      # Enable subpixel font rendering on non-Apple LCDs
      # Reference: https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501
      AppleFontSmoothing     = 1;

      # navigate UI elements with keyboard (tab key)
      AppleKeyboardUIMode    = 3;

      ApplePressAndHoldEnabled = true;

      "com.apple.sound.beep.volume"        = 0.6;

      # Set sidebar icon size to medium
      NSTableViewDefaultSizeMode           = 2;

      # don't animate opening and closing of windows and popovers
      NSAutomaticWindowAnimationsEnabled   = false;

      NSAutomaticCapitalizationEnabled     = false;
      NSAutomaticDashSubstitutionEnabled   = false;
      NSAutomaticPeriodSubstitutionEnabled = false;
      NSAutomaticQuoteSubstitutionEnabled  = false;
      NSAutomaticSpellingCorrectionEnabled = false;

      # Disable automatic termination of inactive apps
      NSDisableAutomaticTermination        = true;
    };

    # disable automatic macupdates
    SoftwareUpdate.AutomaticallyInstallMacOSUpdates = false;

    dock = {
      tilesize                = 50;

      autohide                = true;
      autohide-time-modifier  = 0.15;
      autohide-delay          = 0.02;

      minimize-to-application = true;
      show-recents            = false;

      # Dont rearrange my workspaces automagicly, thanks
      mru-spaces              = false;

      # Disable all hot corners
      wvous-tl-corner         = 1;
      wvous-tr-corner         = 1;
      wvous-bl-corner         = 1;
      wvous-br-corner         = 1;
    };

    screencapture = {
      disable-shadow = true;
      location       = "${config.home-manager.users.katja.home.homeDirectory}/Pictures/Screenshots";
    };

    smb = {
      NetBIOSName       = config.networking.hostName;
      ServerDescription = config.networking.hostName;
    };

  };

}