mirror of
https://github.com/smg1024/nix-darwin.git
synced 2026-05-22 20:32:59 +09:00
114 lines
2.8 KiB
Nix
114 lines
2.8 KiB
Nix
{
|
|
description = "Nix for Poby's MacOS";
|
|
|
|
# TODO: is this necessary?
|
|
# nixConfig = {
|
|
# substituters = [
|
|
# "https://nix-community.cachix.org"
|
|
# "https://cache.nixos.org"
|
|
# ];
|
|
# };
|
|
|
|
inputs = {
|
|
# nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-unstable"; # comment out for unstable version
|
|
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-25.11-darwin";
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-25.11";
|
|
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
|
};
|
|
|
|
darwin = {
|
|
url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
|
|
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
|
};
|
|
|
|
# Homebrew
|
|
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
|
|
|
|
# Optional: Declarative tap management
|
|
homebrew-core = {
|
|
url = "github:homebrew/homebrew-core";
|
|
flake = false;
|
|
};
|
|
homebrew-cask = {
|
|
url = "github:homebrew/homebrew-cask";
|
|
flake = false;
|
|
};
|
|
|
|
# NVF for neovim
|
|
nvf = {
|
|
url = "github:notashelf/nvf";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
# agenix for secrets
|
|
agenix = {
|
|
url = "github:ryantm/agenix";
|
|
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
|
};
|
|
};
|
|
|
|
outputs = inputs @ {
|
|
self,
|
|
nixpkgs,
|
|
darwin,
|
|
home-manager,
|
|
nvf,
|
|
agenix,
|
|
nix-homebrew,
|
|
homebrew-core,
|
|
homebrew-cask,
|
|
...
|
|
}: let
|
|
system = "aarch64-darwin";
|
|
username = "poby";
|
|
useremail = "smg981024@gmail.com";
|
|
hostname = "fenrir"; # TODO break down to multiple hosts
|
|
|
|
specialArgs =
|
|
inputs
|
|
// {
|
|
inherit username useremail hostname;
|
|
};
|
|
in {
|
|
darwinConfigurations."${hostname}" = darwin.lib.darwinSystem {
|
|
inherit system specialArgs;
|
|
modules = [
|
|
./modules/nix-core.nix
|
|
./modules/system.nix
|
|
./modules/apps.nix
|
|
./modules/host-users.nix
|
|
nix-homebrew.darwinModules.nix-homebrew
|
|
{
|
|
nix-homebrew = {
|
|
enable = true;
|
|
enableRosetta = true;
|
|
user = username;
|
|
taps = {
|
|
"homebrew/homebrew-core" = homebrew-core;
|
|
"homebrew/homebrew-cask" = homebrew-cask;
|
|
};
|
|
mutableTaps = false;
|
|
};
|
|
}
|
|
({config, ...}: {
|
|
homebrew.taps = builtins.attrNames config.nix-homebrew.taps;
|
|
})
|
|
agenix.darwinModules.default
|
|
home-manager.darwinModules.home-manager
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
backupFileExtension = "backup";
|
|
extraSpecialArgs = specialArgs;
|
|
sharedModules = [ nvf.homeManagerModules.nvf ];
|
|
users.${username} = import ./home;
|
|
};
|
|
}
|
|
];
|
|
};
|
|
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
|
|
};
|
|
}
|