feat(darwin): enable home-manager support

Add `home-manager` config for `apavel`
Add some `configuration.nix` options for `apavel-a01`:
    - `FiraCode` nerdfont
    - Basic keyboard config
    - TouchID for `sudo`
This commit is contained in:
reo101 2022-11-25 14:51:29 +02:00
parent db887a466f
commit 96305f635e
3 changed files with 92 additions and 4 deletions

View file

@ -129,15 +129,28 @@
}; };
darwinConfigurations = darwinConfigurations =
let mkHost = system: hostname: nix-darwin.lib.darwinSystem { let mkHost = system: hostname: users: nix-darwin.lib.darwinSystem {
inherit system; inherit system;
modules = [ modules = [
./nix-darwin/${hostname}/configuration.nix ./nix-darwin/${hostname}/configuration.nix
home-manager.darwinModules.home-manager
{
home-manager = {
useGlobalPkgs = false;
useUserPackages = true;
users = nixpkgs.lib.attrsets.genAttrs
users
(user: import ./nix-darwin/${hostname}/home/${user}.nix);
extraSpecialArgs = { inherit inputs; };
};
}
] ++ (builtins.attrValues nixDarwinModules); ] ++ (builtins.attrValues nixDarwinModules);
inputs = { inherit inputs outputs nix-darwin nixpkgs; }; inputs = { inherit inputs outputs nix-darwin nixpkgs; };
}; };
in rec { in
apavel-a01 = mkHost "x86_64-darwin" "apavel-a01"; rec {
apavel-a01 = mkHost "x86_64-darwin" "apavel-a01" [ "apavel" ];
}; };
homeConfigurations = { homeConfigurations = {

View file

@ -13,6 +13,19 @@
# Create /etc/zshrc that loads the nix-darwin environment. # Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true; # default shell on catalina programs.zsh.enable = true; # default shell on catalina
# Fonts
fonts.fontDir.enable = true;
fonts.fonts = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" ]; })
];
# Keyboard
system.keyboard.enableKeyMapping = true;
system.keyboard.remapCapsLockToEscape = true;
# Add ability to used TouchID for sudo authentication
security.pam.enableSudoTouchIdAuth = true;
# Used for backwards compatibility, please read the changelog before changing. # Used for backwards compatibility, please read the changelog before changing.
# > darwin-rebuild changelog # > darwin-rebuild changelog
system.stateVersion = 4; system.stateVersion = 4;

View file

@ -0,0 +1,62 @@
{ inputs, lib, config, pkgs, ... }:
{
home = {
# username = "apavel";
# homeDirectory = "/Users/apavel";
stateVersion = "22.05";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.packages = with pkgs; [
# Dhall
dhall
dhall-lsp-server
# Nix
rnix-lsp
nil
# Zig
zigpkgs.master
inputs.zls-overlay.packages.x86_64-darwin.default
];
nixpkgs = {
overlays = [
inputs.zig-overlay.overlays.default
];
config.allowUnfree = true;
};
programs.git = {
enable = true;
userName = "apavel";
userEmail = "apavel@vmware.com";
signing = {
signByDefault = true;
key = "0x52F3E1D376F692C0";
};
};
# services.gpg-agent = {
# enable = true;
# defaultCacheTtl = 1800;
# enableSshSupport = true;
# };
# home.file.".stack/config.yaml".text = lib.generators.toYAML {} {
# templates = {
# scm-init = "git";
# params = with config.programs.git; {
# author-name = userName;
# author-email = userEmail;
# github-username = userName;
# };
# };
# nix.enable = true;
# };
}