Skip to content

Instantly share code, notes, and snippets.

@PardusEidolon
Created June 27, 2023 03:38
Show Gist options
  • Save PardusEidolon/f484204df7de5dc4dc7bc6c30fed88c7 to your computer and use it in GitHub Desktop.
Save PardusEidolon/f484204df7de5dc4dc7bc6c30fed88c7 to your computer and use it in GitHub Desktop.
my nix darwin-configuration file
{ config, pkgs, ... }:
let
uhome = builtins.getEnv "HOME";
uname = builtins.getEnv "USER";
tmpdir = "/tmp";
in {
imports = [ <home-manager/nix-darwin> ];
# Use a custom darwin-configuration location.
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin-configuration.nix
environment.darwinConfig = "$HOME/.config/nixpkgs/darwin-configuration.nix";
# nix has depreciated the aliases binary-cache-public-keys and trusted-binary-caches for nix.conf https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-trusted-public-keys
nix.settings.substituters = [
https://hydra.iohk.io
https://iohk.cachix.org
https://cache.iog.io
https://cache.nixos.org
https://cache.zw3rk.com
ssh://hokioi.husky-ostrich.ts.net
];
nix.settings.trusted-public-keys = [
hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=
cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=
kupo.cachix.org-1:RzYQ8KVjRJdPNt/Bhq/UqdyGYWFM8ShjEMNG8wzHBQ4=
hokioi.husky-ostrich.ts.net:pyoBKuk7od8hoBJ93zgyYkFHgLw0ulIqqSFSjcAYj5A=
];
nix.settings.trusted-users = [
"jobrien"
];
# Enable experimental nix command and flakes
nix.extraOptions = ''
auto-optimise-store = true
experimental-features = nix-command flakes
allow-import-from-derivation = true
'';
programs.nix-index.enable = true;
programs.zsh.enable = true; # default shell on catalina
# Add ability to used TouchID for sudo authentication
security.pam.enableSudoTouchIdAuth = true;
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
cachix
coreutils
gnupg
];
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
users.users.${uname} = {
name = uname;
home = uhome;
};
home-manager.useGlobalPkgs = false;
home-manager.users.${uname} = import ./home.nix;
# Yubikey GPG SSH. Diverting the OSX ssh-agent to use gpg-agent
# GPG Config
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# Setup needed environment variables.
environment.loginShell = "${pkgs.zsh}/bin/zsh -l";
environment.variables.SHELL = "${pkgs.zsh}/bin/zsh";
# Environment Variables and Aliases
environment.systemPath = ["$HOME/bin"];
# environment.variables.LANG = "en_UK.UTF-8";
environment.variables.LANG = "en_US.UTF-8";
# Makesure there are no duplicate entries in the PATH and put usr paths first.
environment.extraInit = ''
typeset -U PATH path
'';
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
# Configure homebrew homebrew
homebrew = {
enable = true;
brewPrefix = "/opt/homebrew/bin";
taps = [];
brews = [];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment