mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-01-16 06:36:37 +01:00
36 lines
923 B
Nix
36 lines
923 B
Nix
{
|
|
nixpkgs,
|
|
nix-darwin,
|
|
home-manager,
|
|
system,
|
|
specialArgs,
|
|
darwin-modules,
|
|
home-module,
|
|
}: let
|
|
username = specialArgs.username;
|
|
in
|
|
nix-darwin.lib.darwinSystem {
|
|
inherit system specialArgs;
|
|
modules =
|
|
darwin-modules
|
|
++ [
|
|
{
|
|
# make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake.
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
|
|
# make `nix repl '<nixpkgs>'` use the same nixpkgs as the one used by this flake.
|
|
environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}";
|
|
nix.nixPath = ["/etc/nix/inputs"];
|
|
}
|
|
|
|
home-manager.darwinModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
|
|
home-manager.extraSpecialArgs = specialArgs;
|
|
home-manager.users."${username}" = home-module;
|
|
}
|
|
];
|
|
}
|