Skip to content

Instantly share code, notes, and snippets.

@JustSteveKing
Created January 8, 2025 11:39
Show Gist options
  • Save JustSteveKing/32ce9d73bd1704b6bb900ed445ae2269 to your computer and use it in GitHub Desktop.
Save JustSteveKing/32ce9d73bd1704b6bb900ed445ae2269 to your computer and use it in GitHub Desktop.
Current Nix configuration
{
description = "JustSteveKing Nix MacOS Setup";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
};
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew }:
let
configuration = { pkgs, ... }: {
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = [
pkgs.neovim
pkgs.tmux
pkgs.obsidian
pkgs.neofetch
pkgs.maccy
pkgs.tableplus
];
system.defaults = {
# Dock Settings
dock.autohide = true;
# Finder Configuration
finder.FXPreferredViewStyle = "clmv";
finder.ShowPathbar = true;
# Window Management
WindowManager.StandardHideDesktopIcons = true;
WindowManager.StandardHideWidgets = true;
# Software Update Settings
SoftwareUpdate.AutomaticallyInstallMacOSUpdates = true;
# Login Window Settings
loginwindow.GuestEnabled = false;
loginwindow.DisableConsoleAccess = true;
# Mac Settings
NSGlobalDomain.AppleICUForce24HourTime = true;
NSGlobalDomain.AppleInterfaceStyle = "Dark";
NSGlobalDomain.KeyRepeat = 2;
};
homebrew = {
enable = true;
brews = [
];
casks = [
"jetbrains-toolbox"
"ghostty"
"orbstack"
"imageoptim"
"gpg-suite"
"visual-studio-code"
"herd"
"chatgpt"
"discord"
"raycast"
"logseq"
];
onActivation.cleanup = "zap";
onActivation.autoUpdate = true;
onActivation.upgrade = true;
};
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# nix.package = pkgs.nix;
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
# Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true; # default shell on catalina
# programs.fish.enable = true;
# Set Git commit hash for darwin-version.
system.configurationRevision = self.rev or self.dirtyRev or null;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 5;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#simple
darwinConfigurations."main" = nix-darwin.lib.darwinSystem {
modules = [
configuration
];
};
# Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."main".pkgs;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment