Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions nix-darwin/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions nix-darwin/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};

nix-homebrew = {
url = "github:zhaofengli/nix-homebrew";
inputs.nixpkgs.follows = "nixpkgs";
};

hosts = {
url = "github:StevenBlack/hosts";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down Expand Up @@ -58,6 +63,7 @@
darwin,
catppuccin,
nixvim,
nix-homebrew,
...
}:
let
Expand Down
1 change: 0 additions & 1 deletion nix-darwin/home-modules/programs/nnn.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
home = {
packages = with pkgs; [
dragon-drop
sxiv
];
sessionVariables = {
# NNN_PLUG = "f:finder;o:fzopen;p:preview-tui;t:preview-tabbed"; # tabbed is x only
Expand Down
11 changes: 8 additions & 3 deletions nix-darwin/home-modules/programs/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
programs.zsh = {
enable = true;
initContent = ''
export ENTERPRISE_REPO_PATH=~/knak
if [[ -f $ENTERPRISE_REPO_PATH/scripts/mfa-token-loader.sh ]]; then source $ENTERPRISE_REPO_PATH/scripts/mfa-token-loader.sh; fi
[[ -f $ENTERPRISE_REPO_PATH/scripts/aliases ]] && source $ENTERPRISE_REPO_PATH/scripts/aliases
export ENTERPRISE_REPO_PATH=~/knak
if [[ -f $ENTERPRISE_REPO_PATH/scripts/mfa-token-loader.sh ]]; then source $ENTERPRISE_REPO_PATH/scripts/mfa-token-loader.sh; fi
[[ -f $ENTERPRISE_REPO_PATH/scripts/aliases ]] && source $ENTERPRISE_REPO_PATH/scripts/aliases

# added because of homebrew
export NVM_DIR="$HOME/.nvm"
[ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" # This loads nvm
[ -s "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
'';
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
Expand Down
10 changes: 9 additions & 1 deletion nix-darwin/users/henri.vandersleyen/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# https://daiderd.com/nix-darwin/manual/index.html
{
imports = [
inputs.nix-homebrew.darwinModules.nix-homebrew
# ./modules/services/appleTouchId.nix
];

Expand Down Expand Up @@ -166,6 +167,12 @@

# Homebrew needs to be installed on its own!
system.primaryUser = meta.username;
nix-homebrew = {
enable = true;
enableRosetta = true; # Only for Apple Silicon (M1/M2)
user = meta.username;
autoMigrate = true;
};
homebrew = {
enable = true;
casks = [
Expand All @@ -174,7 +181,7 @@
"postman"
"arc"
"spotify"
"docker"
"docker-desktop"
"fellow"
"font-jetbrains-mono"
];
Expand All @@ -183,6 +190,7 @@
"nvm"
"dive"
"aws-sam-cli"
"awscli"
];
};
}
8 changes: 4 additions & 4 deletions nix-darwin/users/henri.vandersleyen/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@

# programs
program = {
awscli.enable = true;
arc-browser.enable = false; # INFO unmaintained (use brew)
awscli.enable = false; # brew
arc-browser.enable = false; # beew
codium.enable = true;
fish.enable = true;
fish.enable = false;
zsh.enable = true;
nh.flakeLocation = "/Users/${meta.username}/Documents/dotFiles/nix-darwin";
keychain = {
enable = true;
# keys = [ "/home/${meta.username}/.ssh/knak" ];
keys = [ "/home/${meta.username}/.ssh/knak" ];
};
git = {
# userEmail = config.sops.secrets."knak/email".path;
Expand Down
78 changes: 78 additions & 0 deletions test.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
(require 'eieio)
;; Elisp programs are made of symbolic expressions ("sexps"):
;; SPC m e b (evaluate buffer)
(setq max-front-squat 315)
(setq max-deadlift 315)
(setq max-ovh-press 155)
;; "%s" string
;; "%d" digit
;; essentially console.log
;; (message "%d" max-front-squat)
;; (message "%d" (/ max-ovh-press .7))
;; (message "%d" (+ 2 2 ))

;; I can only train 3-4 times a week
;; I want progressive overloads for the heavy lifts. which allows for spare work (if I feel good)
;; kb exervises clean/jerk, snatch, loaded carry.
;;(setq table '((set exercise weight)))

(defclass workout ()
((exercise :initarg :exercise
:initform ""
:type string
:custom string
:documentation "The big lift name.")
(weight :initarg :weight
:initform 0
:type integer
:custom integer
:documentation "The weight of the lift.")))

(cl-defmethod data ((wkout workout))
(message "exercise: %s weight: %d"
(slot-value wkout 'exercise)
(slot-value wkout 'weight)))

;; let*: Variables are bound in sequence, so later ones can use earlier ones
(cl-defmethod month ((wkout workout) &optional (sets 1))
"Generate org table rows for N sets of a workout."
(let* ((exercise (slot-value wkout 'exercise)) ;; defines a list of vars
(weight (round (* (slot-value wkout 'weight) 0.7)))
(rows (mapcar (lambda (i) (list i exercise weight))
(number-sequence 1 sets))))
rows)) ;; rows contains the returned data

(cl-defmethod to-org ((tables list))
"Render multiple workout tables into a temporary Org-mode buffer."
(let ((buf (get-buffer-create "*Workout Tables*")))
(with-current-buffer buf
(erase-buffer)
(org-mode)
(dolist (table tables)
(insert "\n") ;; Add a blank line between tables
;; Optionally: Add a heading
(let ((exercise-name (nth 1 (car table)))) ;; Get exercise name from row 1
(insert (format "* %s\n" exercise-name)))
;; Insert the table rows
(dolist (row table)
(insert (mapconcat (lambda (cell)
(format "| %s " cell))
row
"")
"|\n"))
(insert "\n")) ;; Another newline for spacing
(goto-char (point-min))
(org-table-map-tables 'org-table-align))
(switch-to-buffer buf)))

;; ---
(setq squats (workout :exercise "Squat" :weight max-front-squat))
(setq deadlift (workout :exercise "Deadlift" :weight max-deadlift))

(data squats)
;; Call month to add to table
;;(month squats)

;; Check contents of table
(to-org (list (month squats 7)
(month deadlift 5)))