mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 01:17:42 -04:00
Move Darwin code to library
This commit is contained in:
parent
dc7552396f
commit
ce3a1b5e20
3 changed files with 46 additions and 49 deletions
38
lib/mkDarwinHost.nix
Normal file
38
lib/mkDarwinHost.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ inputs, ... }: {
|
||||
mkDarwinHost = {
|
||||
system ? "aarch64-darwin",
|
||||
hostname,
|
||||
username ? "gene",
|
||||
additionalModules ? [],
|
||||
additionalSpecialArgs ? {}
|
||||
}: inputs.nix-darwin.lib.darwinSystem {
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs hostname username; } // additionalSpecialArgs;
|
||||
modules = [
|
||||
./nixpkgs-settings.nix
|
||||
|
||||
inputs.nix-homebrew.darwinModules.nix-homebrew {
|
||||
nix-homebrew = {
|
||||
enable = true; # Install Homebrew under the default prefix
|
||||
user = "${username}"; # User owning the Homebrew prefix
|
||||
autoMigrate = true; # Automatically migrate existing Homebrew installations
|
||||
};
|
||||
}
|
||||
|
||||
inputs.home-manager.darwinModules.home-manager {
|
||||
home-manager = {
|
||||
extraSpecialArgs = { inherit inputs username; };
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.${username}.imports = [
|
||||
inputs.sops-nix.homeManagerModule # user-level secrets management
|
||||
../modules/home-manager/hosts/${hostname}/${username}.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
../modules/system/common/all-darwin.nix # system-wide stuff
|
||||
../modules/hosts/darwin/${hostname} # host specific stuff
|
||||
] ++ additionalModules; # end modules
|
||||
}; # end darwinSystem
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue