mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-01-11 20:40:24 +01:00
43 lines
1.0 KiB
Nix
43 lines
1.0 KiB
Nix
{
|
|
lib,
|
|
inputs,
|
|
darwin-modules,
|
|
home-modules ? [ ],
|
|
myvars,
|
|
system,
|
|
genSpecialArgs,
|
|
specialArgs ? (genSpecialArgs system),
|
|
...
|
|
}:
|
|
let
|
|
inherit (inputs) nixpkgs-darwin home-manager nix-darwin;
|
|
in
|
|
nix-darwin.lib.darwinSystem {
|
|
inherit system specialArgs;
|
|
modules =
|
|
darwin-modules
|
|
++ [
|
|
(
|
|
{ lib, ... }:
|
|
{
|
|
nixpkgs.pkgs = import nixpkgs-darwin {
|
|
inherit system; # refer the `system` parameter form outer scope recursively
|
|
# To use chrome, we need to allow the installation of non-free software
|
|
config.allowUnfree = true;
|
|
};
|
|
}
|
|
)
|
|
]
|
|
++ (lib.optionals ((lib.lists.length home-modules) > 0) [
|
|
home-manager.darwinModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.backupFileExtension = "home-manager.backup";
|
|
|
|
home-manager.extraSpecialArgs = specialArgs;
|
|
home-manager.users."${myvars.username}".imports = home-modules;
|
|
}
|
|
]);
|
|
}
|