Create roles/common.nix containing shared configuration between NixOS and Darwin: timezone, base packages (git, glances, pciutils, tree, usbutils, vim), nix settings (experimental-features, max-jobs, trusted-users), gc config, and allowUnfree setting. Both roles/default.nix and roles/darwin.nix now import common.nix and only contain platform-specific configuration.
36 lines
638 B
Nix
36 lines
638 B
Nix
# Common configuration shared between NixOS and Darwin
|
|
{ lib, pkgs, ... }:
|
|
|
|
{
|
|
config = {
|
|
time.timeZone = "America/Los_Angeles";
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
git
|
|
glances
|
|
pciutils
|
|
tree
|
|
usbutils
|
|
vim
|
|
];
|
|
|
|
nix = {
|
|
package = pkgs.nix;
|
|
settings = {
|
|
experimental-features = [ "nix-command" "flakes" ];
|
|
max-jobs = "auto";
|
|
trusted-users = [ "johno" ];
|
|
substituters = [
|
|
];
|
|
};
|
|
|
|
gc = {
|
|
automatic = true;
|
|
options = "--delete-older-than 10d";
|
|
};
|
|
};
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
};
|
|
}
|