System/modules/darwin/default.nix

194 lines
5.4 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let
inherit (import ../lib.nix {
inherit lib;
inherit pkgs;
})
nLib;
in {
2023-03-29 21:06:19 -04:00
imports = [
../options.nix
../common/programs/utils.nix
./user.nix
./fonts.nix
./settings.nix
2023-03-30 16:14:00 -04:00
./media.nix
2023-07-21 19:08:40 -04:00
./creative.nix
2023-07-22 03:18:45 -04:00
./games.nix
2023-03-29 21:06:19 -04:00
];
options = with lib;
with nLib; {
nathan = {
config = {
# Install fonts
# On by default if the system is a desktop
fonts = mkDefaultOption "fonts" config.nathan.config.isDesktop;
2023-03-29 21:06:19 -04:00
# Macos settings
settings = mkDefaultOption "settings" config.nathan.config.isDesktop;
};
programs = {
# Firefox, enabled by default on linux desktop
firefox = mkDefaultOption "Firefox" config.nathan.config.isDesktop;
syncthing =
mkDefaultOption "syncthing" config.nathan.config.isDesktop;
# Communications applications
communications = {
# Enable by default if we are on a linux desktop
enable = mkDefaultOption "Communication applications"
config.nathan.config.isDesktop;
};
2023-07-22 03:18:45 -04:00
games = {
# Enable by default if we are on a linux desktop
enable = mkDefaultOption "games" config.nathan.config.isDesktop;
};
2023-03-30 16:14:00 -04:00
media = {
# Enable by default if we are on a linux desktop
enable = mkDefaultOption "Media applications"
config.nathan.config.isDesktop;
};
2023-07-21 19:08:40 -04:00
creative = {
# Enable by default if we are on a linux desktop
enable = mkDefaultOption "Creativity applications"
config.nathan.config.isDesktop;
};
2023-03-27 20:05:12 -04:00
# Virtualization
virtualization =
mkDefaultOption "Virtualization" config.nathan.config.isDesktop;
2023-04-12 22:59:39 -04:00
# development tools
devel = {
python =
mkDefaultOption "Virtualization" config.nathan.config.isDesktop;
};
};
};
};
config = {
# Link applications in spotlight/launchpad
system.activationScripts.applications.text = pkgs.lib.mkForce (''
echo "setting up ~/Applications..." >&2
rm -rf ~/Applications/Nix\ Apps
mkdir -p ~/Applications/Nix\ Apps
for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do
src="$(/usr/bin/stat -f%Y "$app")"
cp -r "$src" ~/Applications/Nix\ Apps
done
'');
# Set system state version
system.stateVersion = 4;
# Enable flakes
# Enable nix flakes
nix.package = pkgs.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
services.nix-daemon.enable = true;
# Replace some macos packages
environment.systemPackages = with pkgs; [ coreutils-full openssh ];
programs.zsh.enable = true;
programs.fish.enable = true;
# Make nix managed fonts work
fonts.fontDir.enable = true;
2023-03-29 21:06:19 -04:00
# Configure nix to be a lil smarter with the store
nix.settings.auto-optimise-store = true;
# Make nix assume control of homebrew
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
cleanup = "zap";
};
2023-07-21 17:54:28 -04:00
taps = [ "homebrew/cask-versions" "homebrew/services" ];
casks = lib.mkMerge [
2023-08-23 07:13:04 -04:00
(lib.mkIf config.nathan.programs.firefox [{
name = "firefox";
greedy = true;
}])
(lib.mkIf config.nathan.programs.virtualization [{
name = "utm";
greedy = true;
}])
(lib.mkIf config.nathan.programs.devel.python [{
name = "miniconda";
greedy = true;
}])
(lib.mkIf config.nathan.programs.communications.enable [
2023-08-23 07:13:04 -04:00
{
name = "discord";
greedy = true;
}
{
name = "betterdiscord-installer";
greedy = true;
}
{
name = "signal";
greedy = true;
}
{
name = "orangedrangon-android-messages";
greedy = true;
}
{
name = "messenger";
greedy = true;
}
{
name = "whalebird";
greedy = true;
}
{
name = "slack";
greedy = true;
}
{
name = "zulip";
greedy = true;
}
])
2023-03-27 18:51:59 -04:00
# Unconditionally install core utilites
[
2023-08-23 07:13:04 -04:00
{
name = "keepingyouawake";
greedy = true;
}
{
name = "flux";
greedy = true;
}
{
name = "iterm2";
greedy = true;
}
{
name = "gpg-suite";
greedy = true;
}
{
name = "amethyst";
greedy = true;
}
2023-07-22 15:34:10 -04:00
{
name = "podman-desktop";
2023-08-23 07:13:04 -04:00
greedy = true;
2023-07-22 15:34:10 -04:00
}
# Original is unmaintaned, wait for this fork
# https://github.com/UeharaYou/HiddenBar
# { name = "hiddenbar"; }
2023-03-27 18:51:59 -04:00
]
];
brews = lib.mkMerge [
(lib.mkIf config.nathan.programs.syncthing [{
name = "syncthing";
restart_service = true;
start_service = true;
}])
2023-07-21 17:54:28 -04:00
# Unconditionally install core utilities
[{ name = "podman"; }]
];
};
};
}