Skip to content

Instantly share code, notes, and snippets.

@pjhenning
Created December 2, 2024 23:36
Show Gist options
  • Select an option

  • Save pjhenning/d26db5a090bcf596bda321171de10ad0 to your computer and use it in GitHub Desktop.

Select an option

Save pjhenning/d26db5a090bcf596bda321171de10ad0 to your computer and use it in GitHub Desktop.
{
nixConfig = {
extra-trusted-substituters = ["https://cache.flox.dev"];
extra-trusted-public-keys = ["flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-24.11-darwin";
darwin.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flox = {
url = "github:flox/flox/v1.3.5";
};
};
outputs = { self, nixpkgs, darwin, home-manager, flox }:
let
configuration = { pkgs, ... }: {
nix = {
package = pkgs.nixVersions.stable;
configureBuildUsers = true;
settings = {
trusted-users = ["LOGINUSER" "root"];
substituters = [
"https://cache.flox.dev"
];
trusted-public-keys = [
"flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="
];
};
};
nixpkgs.config.allowUnfree = true;
ids.gids.nixbld = 30000;
system.stateVersion = 5;
services.nix-daemon.enable = true;
users.users.LOGINUSER = {
name = "LOGINUSER";
home = "/Users/LOGINUSER";
};
programs = {
direnv = {
enable = true;
nix-direnv.enable = true;
};
zsh.enable = true;
};
environment = {
systemPackages = with pkgs; [
devbox
exercism
ffmpeg
git
ntfs3g
vale
yt-dlp
flox.packages.${pkgs.system}.default
];
systemPath = [
"/Users/LOGINUSER/lbin"
"/Users/LOGINUSER/lib/pakcs/bin"
"/Users/LOGINUSER/lib/kics2/bin"
];
};
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
cleanup = "uninstall";
upgrade = true;
};
taps = [ "homebrew/cask-fonts" ];
casks = [
"librewolf"
];
};
};
in
{
darwinConfigurations."MacBook-Pro" = darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [
configuration
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.LOGINUSER = import ./home.nix;
}
];
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment