Skip to content

Commit

Permalink
hosts: use hm for R2026 and bwpm-FP2CYXKY2V
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerschtli committed Jan 23, 2024
1 parent 6b44f1c commit cc9df55
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This is my humble flakes-only collection of all and everything needed to set up
- `neon` (private laptop)
- `xenon` (Raspberry Pi 3B+)
- [home-manager][home-manager]-managed
- `bwpm-FP2CYXKY2V`
- `gamer` on WSL2 with Ubuntu 20.04 (windows dual boot for games and stuff)
- `R2026`
- [nix-on-droid][nix-on-droid]-managed
Expand Down
23 changes: 23 additions & 0 deletions files/scripts/darwin-defaults.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail

defaults write NSGlobalDomain AppleInterfaceStyle Dark
defaults write NSGlobalDomain KeyRepeat -int 3
defaults write NSGlobalDomain "com.apple.mouse.tapBehavior" -int 1
defaults write NSGlobalDomain "com.apple.swipescrolldirection" -bool false # disable natural scrolling
defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false

defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock tilesize -int 48
defaults write com.apple.dock "mru-spaces" -bool "false"
killall Dock

defaults write com.apple.spaces "spans-displays" -bool "false"
killall SystemUIServer

defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.finder FXPreferredViewStyle "Nlsv" # list view
defaults write com.apple.finder QuitMenuItem -bool true
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true
killall Finder
26 changes: 26 additions & 0 deletions files/scripts/darwin-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail

# manually
# - install chrome, intellij, iterm2, docker, vscode, karabiner elements, homebrew
# - run ./darwin-defaults.sh
# - run commands below
# - iterm2 set UbuntuMono font, size 13, h 85, v 115, tango dark
# - disable keyboard shortcuts for "Input Sources" in system settings
# - enable keyboard shortcuts for Mission Control to switch to desktops
# - Trackpad: Enable Tap to Click
# - karabiner mapping:
# - left_control -> left_command
# - left_option -> left_control
# - left_command -> left_option
# - for internal keyboard:
# - fn -> left_command
# - left_control -> fn

brew tap homebrew/cask-fonts
brew install --cask homebrew/cask-fonts/font-ubuntu-mono-nerd-font
brew install koekeishiya/formulae/yabai
yabai --start-service
brew install koekeishiya/formulae/skhd
skhd --start-service
brew install --cask spaceid
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
{
homeConfigurations = listToAttrs [
(mkHome "x86_64-linux" "tobias@gamer")
(mkHome "aarch64-darwin" "tobiashapp@bwpm-FP2CYXKY2V")
(mkHome "aarch64-darwin" "tobiashapp@R2026")
];

nixOnDroidConfigurations = listToAttrs [
Expand Down
15 changes: 11 additions & 4 deletions home/base/non-nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let
mkAfter
mkEnableOption
mkIf
mkMerge
mkOption
types
;
Expand Down Expand Up @@ -66,11 +67,17 @@ in
;
};

programs.zsh.envExtra = mkAfter ''
hash -f
'';
programs.zsh.envExtra = mkMerge [
(mkAfter ''
hash -f
'')

targets.genericLinux.enable = true;
(mkIf config.custom.base.general.darwin ''
eval "$(/opt/homebrew/bin/brew shellenv)"
'')
];

targets.genericLinux.enable = !config.custom.base.general.darwin;

};

Expand Down
2 changes: 1 addition & 1 deletion home/programs/git/git-alias-bcf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ fi

ARGS="${*}"

git bc "feature/TRAP-${ARGS// /-}"
git bc "feature/CTMSDKS-${ARGS// /-}"
4 changes: 2 additions & 2 deletions home/programs/git/prepare-commit-msg.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FILE="${1}"

REPLACE=
if [[ "$(git branch-name)" =~ ^feature/(TRAP-[0-9]*).*$ ]]; then
REPLACE="${BASH_REMATCH[1]}: "
if [[ "$(git branch-name)" =~ ^feature/(CTMSDKS-[0-9]*).*$ ]]; then
REPLACE="[${BASH_REMATCH[1]}] "
fi

sed -i -e "s#PREFIX#${REPLACE}#" "${FILE}"
19 changes: 13 additions & 6 deletions hosts/R2026/home-tobiashapp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,21 @@
mailAddress = "tobias.happ@randstaddigital.com";
};
};

wm.yabai.enable = true;
};

home.packages = with pkgs; [
awscli2
coreutils
nixpkgs-fmt
nodejs
];
home = {
homeDirectory = "/Users/tobiashapp";
username = "tobiashapp";

packages = with pkgs; [
awscli2
coreutils
nixpkgs-fmt
nodejs
];
};

programs.zsh.initExtra = lib.mkAfter ''
complete -C '${pkgs.awscli2}/bin/aws_completer' aws
Expand Down
55 changes: 55 additions & 0 deletions hosts/bwpm-FP2CYXKY2V/home-tobiashapp.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{ config, lib, pkgs, ... }:

{
custom = {
base = {
general.darwin = true;

desktop = {
enable = true;
laptop = true;
};
};

development = {
jbang = {
enable = true;
trustedSources = [ "https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/" ];
};

nix.home-manager.enable = true;
};

misc = {
sdks = {
enable = true;
links = {
inherit (pkgs) jdk17 jdk21;
};
};

work = {
enable = true;
directory = "randstad/db";
mailAddress = "tobias.happ@deutschebahn.com";
};
};

wm.yabai.enable = true;
};

home = {
homeDirectory = "/Users/tobiashapp";
username = "tobiashapp";

packages = with pkgs; [
coreutils
nixpkgs-fmt
nodejs
];
};

programs.zsh.initExtra = lib.mkAfter ''
source <(kubectl completion zsh)
'';
}

0 comments on commit cc9df55

Please sign in to comment.