mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-02-23 08:24:49 +01:00
refactor: Use hyphen(`-`) for variable names & folder names(except Python), replace all unserscore(`_`) with hyphen(`-`).
39 lines
1.1 KiB
Nix
39 lines
1.1 KiB
Nix
{
|
|
inputs,
|
|
darwin-modules,
|
|
home-module ? null,
|
|
myvars,
|
|
system,
|
|
genSpecialArgs,
|
|
...
|
|
}: let
|
|
inherit (inputs) nixpkgs home-manager nix-darwin;
|
|
specialArgs = genSpecialArgs system;
|
|
in
|
|
nix-darwin.lib.darwinSystem {
|
|
inherit system specialArgs;
|
|
modules =
|
|
darwin-modules
|
|
++ [
|
|
({lib, ...}: {
|
|
nixpkgs.pkgs = import nixpkgs {inherit system;};
|
|
# make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake.
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
|
|
environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}";
|
|
# make `nix repl '<nixpkgs>'` use the same nixpkgs as the one used by this flake.
|
|
# discard all the default paths, and only use the one from this flake.
|
|
nix.nixPath = lib.mkForce ["/etc/nix/inputs"];
|
|
})
|
|
|
|
home-manager.darwinModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
|
|
home-manager.extraSpecialArgs = specialArgs;
|
|
home-manager.users."${myvars.username}" = home-module;
|
|
}
|
|
];
|
|
}
|