Skip to content

Commit

Permalink
Feat/nix darwin (#103)
Browse files Browse the repository at this point in the history
* Intiial conmmit of Nix config

* Let's see if this works

* Let's hope this works

* Fixing home.nix I think

* That was embarassing

* Need to name it correctly

* Is this right?

* We need that

* That was annoying

* Huh

* Let's try this

* Ugh

* Makes sense

* Desperate

* Ok, I think this will "work"

* This makes sense

* This process is getting annoying

* Hopefully this works

* Let's not let shas be our issue

* Ugh

* Need to update some stuff

* Let's try this

* Trying something else

* Duh

* Adding a useless comment

* Let's try this

* Ok

* Let's try this

* Kinda silly

* Let's try this

* Huh?

* Did I figure it out?

* Can this please work?

* Ahhh

* Let's see how Vim config gives us issues

* First try with RKE2

* Also importing the rke2 primary config, I think I understand what flakes are used for lol

* Embarassing

* Let's start basic

* Let's make sure this works

* Try enabling cni

* Let's try cisHardening

* I guess hardening is not happening here

* Now we try to build a cluster

* Ok, now we'll have to commit a SHA

* Let's try this then

* Try this

* Just trying somethign

* Just making stuff up now

* Feel like I did this, but we'll see

* Let's take a swing

* Duh

* Not a very happy camper rn

* Wait a second...

* Fair enough, makes sense we don't need this

* Huh?

* Changing back, and some spacing

* Am I not that smart?

* Let's just try it

* Big swing

* Let's try this

* Let's do this

* Does Colmena work this way?

* Maybe it works like this?

* Let's try this

* We need to add home.nix

* Fixing home.nix

* Let's try this

* Let's actually get home.nix working

* Putting a pin in Nix for now, let's get Minecraft up and running

* Let's commit this

* Let's get this committed, so we can start out better deployment

* Let's commit the working home.nix, and then pull it in

* Need to get the latest commit of stuff up

* Nix is a disgusting mess, and I seriously question its value

* I hate this

* This better work

* Very confused

* Let's try this

* I hate Nix right now. It will be worth it

* Real frustrated

* Right, I gotta do it from Git

* I really ought to do this all local for now

* Ok, let's move extraSpecialArgs

* Let's give this a go now

* Ok, let's give this a go

* I think we've got home-manager modularized

* Of course I didn't get the shell set up properly

* We need to install atils in home-manager

* Let's try this

* Try it this way

* Let's take a swing

* Let's try this out

* Let's see if we get lucky and this just works

* Don't be silly

* Ya just never know

* This is it. Time to start testing the full setup
  • Loading branch information
AidanHilt authored Oct 27, 2024
1 parent 4c1dcd3 commit 89e15f7
Show file tree
Hide file tree
Showing 33 changed files with 3,140 additions and 83 deletions.
34 changes: 33 additions & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,38 @@
"line_number": 23
}
],
"nix/configurations/server-rke-primary.nix": [
{
"type": "Hex High Entropy String",
"filename": "nix/configurations/server-rke-primary.nix",
"hashed_secret": "e1a194b06741cb17163aa1e2221aaf6ec4ab3829",
"is_verified": false,
"line_number": 6
},
{
"type": "Hex High Entropy String",
"filename": "nix/configurations/server-rke-primary.nix",
"hashed_secret": "26207679111b581cffb50905067b2fc861596504",
"is_verified": false,
"line_number": 11
}
],
"nix/configurations/server-rke-secondary.nix": [
{
"type": "Hex High Entropy String",
"filename": "nix/configurations/server-rke-secondary.nix",
"hashed_secret": "e1a194b06741cb17163aa1e2221aaf6ec4ab3829",
"is_verified": false,
"line_number": 6
},
{
"type": "Hex High Entropy String",
"filename": "nix/configurations/server-rke-secondary.nix",
"hashed_secret": "6872c16190bd6f51092d9c5f04e3067cdb1eab1e",
"is_verified": false,
"line_number": 11
}
],
"server-setup/roles/common/task/pihole.yml": [
{
"type": "Secret Keyword",
Expand All @@ -276,5 +308,5 @@
}
]
},
"generated_at": "2024-06-29T18:52:48Z"
"generated_at": "2024-08-19T02:55:23Z"
}
2 changes: 1 addition & 1 deletion atils/atils/atils_kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def main(args: list[str]):
args_dict: dict[str, str] = vars(arguments)

if arguments.subparser_name == "rke-setup":
if vars(arguments).get("replace_kubeconfig"):
if vars(arguments).get("replace_kubeconfig_only"):
merge_and_replace_kubeconfig(arguments.cluster_name)
else:
setup_rke_cluster(
Expand Down
6 changes: 4 additions & 2 deletions atils/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ jinja2 = "^3.1.2"
termcolor = "^2.3.0"
watchfiles = "^0.21.0"
asyncio = "^3.4.3"
setuptools = "^69.0.3"
setuptools = "^72.0.0"
colored = "^2.2.4"
rich = "^13.7.1"

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
pytest = "7.2.0"
check-jsonschema = "^0.28.0"
types-setuptools = "^69.1.0.20240302"
types-requests = "^2.0.0"
ruff = "^0.5.1"


[tool.poetry.scripts]
Expand Down
86 changes: 8 additions & 78 deletions mac-setup/dotfiles/zsh/.zshrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"

source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $(brew --prefix)/share/zsh-history-substring-search/zsh-history-substring-search.zsh

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

Expand All @@ -16,95 +17,27 @@ export ZSH="$HOME/.oh-my-zsh"
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time

# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.

plugins=(git sudo copyfile copybuffer ansible copybuffer git-auto-fetch history kubectl per-directory-history poetry systemadmin kube-ps1)
PROMPT='$(kube_ps1)'$PROMPT

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# alias k=kubectl

alias kns=kubens
alias kctx=kubectx

alias ls=eza


# Created by `pipx` on 2023-06-20 04:14:17
export PATH="$PATH:/Users/ahilt/.local/bin"

Expand All @@ -114,9 +47,6 @@ export PATH="/Users/ahilt/.rd/bin:$PATH"
# setopt no_share_history
# unsetopt share_history

source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $(brew --prefix)/share/zsh-history-substring-search/zsh-history-substring-search.zsh

export NVM_DIR="$HOME/.nvm"
[ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh"
Expand Down
2 changes: 1 addition & 1 deletion mac-setup/homebrew/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ brew 'syncthing'
cask 'visual-studio-code'
cask 'orbstack'
cask 'postman'
cask 'utm'

brew 'act'
brew 'python3'
Expand All @@ -42,7 +43,6 @@ brew 'k9s'
brew 'kubectx'
brew 'helm'
brew 'rke'
brew 'yq'
brew 'vault'
brew 'pipx'
brew 'kind'
Expand Down
8 changes: 8 additions & 0 deletions mac-setup/scripts/install-nix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/zsh

# Install nix itself
sh <(curl -L https://nixos.org/nix/install)

# Install nix-darwin
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
./result/bin/darwin-installer
Loading

0 comments on commit 89e15f7

Please sign in to comment.