nixos/darwin/common.nix
2023-12-11 18:18:41 -05:00

50 lines
1.3 KiB
Nix

{ pkgs, lib, inputs, outputs, ...}: let
inherit (inputs) nixpkgs;
in {
imports = [
inputs.sops-nix-darwin.darwinModules.sops
inputs.home-manager.darwinModules.home-manager
];
# pin nixpkgs in the system flake registry to the revision used
# to build the config
nix.registry.nixpkgs.flake = nixpkgs;
nixpkgs.config.allowUnfree = true;
nixpkgs.config.overlays = [
(final: prev: lib.optionalAttrs (prev.stdenv.system == "aarch64-darwin") {
# Add access to x86 packages system is running Apple Silicon
pkgs-x86 = import nixpkgs {
system = "x86_64-darwin";
config.allowUnfree = true;
};
})
];
# Keep nix upgraded
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
# Enable flakes, and enrich apple silicon
nix.extraOptions = ''
experimental-features = nix-command flakes repl-flake
''+ lib.optionalString (pkgs.system == "aarch64-darwin") ''
extra-platforms = x86_64-darwin aarch64-darwin
'';
programs.zsh.enable = true;
programs.fish.enable = true;
environment.shells = [
pkgs.fish
pkgs.zsh
pkgs.bashInteractive
];
users.users.root.shell = pkgs.fish;
#system.configurationRevision = self.rev or self.dirtyRev or null;
system.stateVersion = 4;
security.pam.enableSudoTouchIdAuth = true;
home-manager.extraSpecialArgs = { inherit inputs outputs; };
}