Switch to home manager and move off of ohmyzsh

This commit is contained in:
2024-12-03 20:55:46 -08:00
parent e73044a1ca
commit afcb55d5c4
14 changed files with 277 additions and 152 deletions

33
nix/flake.lock generated
View File

@@ -35,6 +35,26 @@
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733175814,
"narHash": "sha256-zFOtOaqjzZfPMsm1mwu98syv3y+jziAq5DfWygaMtLg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "bf23fe41082aa0289c209169302afd3397092f22",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
@@ -42,11 +62,11 @@
]
},
"locked": {
"lastModified": 1732603785,
"narHash": "sha256-AEjWTJwOmSnVYsSJCojKgoguGfFfwel6z/6ud6UFMU8=",
"lastModified": 1733047432,
"narHash": "sha256-fQUKxgxAEHlL5bevRkdsQB7sSpAMhlvxf7Zw0KK8QIg=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "6ab87b7c84d4ee873e937108c4ff80c015a40c7a",
"rev": "e30a3622b606dffc622305b4bbe1cfe37e78fa40",
"type": "github"
},
"original": {
@@ -125,11 +145,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1732238832,
"narHash": "sha256-sQxuJm8rHY20xq6Ah+GwIUkF95tWjGRd1X8xF+Pkk38=",
"lastModified": 1733024928,
"narHash": "sha256-n/DOfpKH1vkukuBnach91QBQId2dr5tkE7/7UrkV2zw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8edf06bea5bcbee082df1b7369ff973b91618b8d",
"rev": "2c27ab2e60502d1ebb7cf38909de38663f762a79",
"type": "github"
},
"original": {
@@ -141,6 +161,7 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nix-homebrew": "nix-homebrew",
"nixpkgs": "nixpkgs_3"

View File

@@ -6,9 +6,11 @@
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew }:
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, home-manager }:
let
configuration = { pkgs, config, ... }: {
@@ -20,8 +22,14 @@
[
pkgs.fastfetch
pkgs.coreutils
pkgs.nmap
pkgs.openjdk17
pkgs.openjdk21
pkgs.tree
pkgs.zstd
# zsh plugins
pkgs.zsh-autosuggestions
pkgs.zsh-syntax-highlighting
];
homebrew = {
@@ -49,6 +57,7 @@
"scroll-reverser"
"sf-symbols"
"steam"
"utm"
"visual-studio-code"
];
brews = [
@@ -69,7 +78,7 @@
"TheUnarchiver" = 425424353;
"Unread" = 1363637349;
"WiFiMan" = 1385561119;
"Wipr" = 1320666476;
"Wipr2" = 1662217862;
"WireGuard" = 1451685025;
"Xcode" = 497799835;
};
@@ -85,6 +94,8 @@
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
# Defaults
security.pam.enableSudoTouchIdAuth = true;
system.defaults = {
dock.autohide = true;
trackpad.Clicking = true;
@@ -100,6 +111,12 @@
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
programs.zsh.enable = true;
# Home Manager
users.users.smparkin.home = "/Users/smparkin";
nix.configureBuildUsers = true;
nix.useDaemon = true;
};
in
{
@@ -114,13 +131,39 @@
enable = true;
enableRosetta = true;
user = "smparkin";
autoMigrate = true;
};
}
home-manager.darwinModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.smparkin = import ./home.nix;
};
}
];
};
# Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."macbook".pkgs;
darwinConfigurations."workbook" = nix-darwin.lib.darwinSystem {
modules = [
configuration
nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
enable = true;
enableRosetta = true;
user = "parkist";
};
}
home-manager.darwinModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.parkist = import ./work.nix;
};
}
];
};
};
}

33
nix/home.nix Normal file
View File

@@ -0,0 +1,33 @@
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "smparkin";
home.homeDirectory = "/Users/smparkin";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "24.11";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# Home dir
home.file = {
".zshrc".source = ../zsh/zshrc;
".zsh.d/aliases".source = ../zsh/aliases;
".zsh.d/functions".source = ../zsh/functions;
".zsh.d/theme".source = ../zsh/theme;
".gitconfig".source = ../git/gitconfig;
".gitignore_global".source = ../git/gitignore_global;
".tmux.conf".source = ../tmux/tmux.conf;
".vimrc".source = ../vim/vimrc;
};
}