Skip to content

Commit

Permalink
New mac who dis
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Hoekstra <[email protected]>
  • Loading branch information
shoekstra committed Sep 17, 2023
1 parent c0f7c3e commit 61d422e
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 16 deletions.
8 changes: 8 additions & 0 deletions nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,13 @@
./hosts/sbpltt6cllvdl/default.nix
];
};
darwinConfigurations."sbplt4w6p3hjt" = darwin.lib.darwinSystem {
system = "aarch64-darwin";

modules = [
home-manager.darwinModules.home-manager
./hosts/sbplt4w6p3hjt/default.nix
];
};
};
}
33 changes: 33 additions & 0 deletions nix/hosts/sbplt4w6p3hjt/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ pkgs, ... }:

let
imports = [
./homebrew.nix
];

in {

inherit imports;

# Make sure the nix daemon always runs
services.nix-daemon.enable = true;

# Fonts
fonts.fontDir.enable = true;
fonts.fonts = with pkgs; [
recursive
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];

# If you use zsh you'll need to enable this so nix-darwin creates a zshrc sourcing needed environment changes
programs.zsh.enable = true;

home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."shoekstra" = import ../../users/shoekstra/home.nix;

# This needs to be to set for things to work (see https://github.com/LnL7/nix-darwin/issues/423)
users.users."shoekstra" = {
home = "/Users/shoekstra";
};
}
10 changes: 10 additions & 0 deletions nix/hosts/sbplt4w6p3hjt/homebrew.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
homebrew.enable = true;

homebrew.casks = [
"iterm2"
"spotify"
"telegram"
"whatsapp"
];
}
40 changes: 40 additions & 0 deletions nix/users/shoekstra/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,44 @@ in {

# Let Home Manager install and manage itself.
programs.home-manager.enable = true;

# Packages with modules to configure them.
programs = {
bat = {
enable = true;

config.theme = "OneHalfDark";
};

git = {
enable = true;

userName = "Stephen Hoekstra";
userEmail = "[email protected]";

aliases = {
personal = "config user.email [email protected]";
unstage = "reset HEAD --";
};

extraConfig = {
core.whitespace = "trailing-space,space-before-tab";
credential.helper = "osxkeychain";
};

signing.key = "DBB82B1442BFA582";
};
};

programs.gh-dash.enable = true;
programs.gh.enable = true;
programs.gpg.enable = true;
programs.htop.enable = true;
programs.k9s.enable = true;

# Packages without modules to configure them.
home.packages = with pkgs; [
mc
tree
];
}
2 changes: 1 addition & 1 deletion nix/users/shoekstra/nvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ in {
(python3.withPackages(ps: with ps; [ pynvim ]))

# Packages used by neovim config
hadolint
# hadolint -- has a broken dependency, will look into it another time
nodePackages.markdownlint-cli
shellcheck
tree-sitter
Expand Down
47 changes: 32 additions & 15 deletions nix/users/shoekstra/tmux.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
{ config, pkgs, ... }:
{ pkgs, ... }:

let

lib = import ../../lib;

in {
{
home.packages = with pkgs; [
reattach-to-user-namespace
tmux
];

home.file = {
".tmux.conf".source = pkgs.fetchFromGitHub {
owner = "gpakosz";
repo = ".tmux";
rev = "7706ab724f3811479a358c6f9ea6aeb6decece5f";
sha256 = "sha256-o126SathIT49Mj9EZDhlYF5i3EgRe2HFZkoGXTVQBbw=";
} + "/.tmux.conf";
programs.tmux = {
enable = true;
baseIndex = 1;
historyLimit = 50000;
keyMode = "vi";
mouse = true;
prefix = "C-a";
sensibleOnTop = false;
terminal = "xterm-256color";

extraConfig = ''
# Switch to last window, screen style
bind-key a send-prefix
bind-key C-a last-window
# Apply true color
set-option -ga terminal-overrides ",xterm-256color:Tc"
'';

".tmux.conf.local".source = lib.dotFilePath "tmux/tmux.conf.local";
plugins = with pkgs; [
# Waiting for https://github.com/NixOS/nixpkgs/pull/191517 to be merged
(tmuxPlugins.sensible.overrideAttrs ( _: {
version = "unstable-2022-08-14";
src = fetchFromGitHub {
owner = "tmux-plugins";
repo = "tmux-sensible";
rev = "25cb91f42d020f675bb0a2ce3fbd3a5d96119efa";
sha256 = "sha256-sw9g1Yzmv2fdZFLJSGhx1tatQ+TtjDYNZI5uny0+5Hg=";
};
}))
];
};
}
5 changes: 5 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ for file in /etc/*.backup-before-nix; do
[ -e "${file}" ] && sudo rm -v ${file}
done

if [ -d "~/.config/nix" ]; then
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
fi

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

echo "==> Running first build..."
Expand Down

0 comments on commit 61d422e

Please sign in to comment.