Compare commits

...

45 Commits

Author SHA1 Message Date
71cf51f301 add docker shortcuts 2025-12-05 20:49:11 +01:00
08c751ceb3 add mkcert 2025-12-05 20:48:56 +01:00
b27684f9cb update flake 2025-12-05 20:48:48 +01:00
e8469c723b update vscode config 2025-12-05 20:48:39 +01:00
b14b31c7b8 add host 2025-12-05 20:48:31 +01:00
197fa0461e update plist 2025-12-05 20:48:04 +01:00
d1c7c336a2 update 2025-11-14 14:25:57 +01:00
5c3c59d6da update plist 2025-11-14 14:25:48 +01:00
3845ae7bde update readme to use determinate systems 2025-11-10 23:43:28 +01:00
79d88d9461 dont manage nix 2025-11-10 23:42:38 +01:00
08b84fe5db update plist 2025-11-10 22:51:54 +01:00
036684c6c7 update aldente config 2025-11-10 22:51:38 +01:00
a4d5297c00 update flake and add buildx 2025-11-10 22:51:26 +01:00
409a48426c remove docker desktop 2025-11-06 00:25:50 +01:00
8d19b5b056 raycast config 2025-11-05 23:59:55 +01:00
90a52b2c13 vscode 2025-11-04 00:58:22 +01:00
01393919ec state 2025-11-04 00:43:11 +01:00
0047118a70 extensions 2025-11-04 00:08:53 +01:00
762715c2b5 add vscode config 2025-11-03 23:51:48 +01:00
43c0dc2035 remove ordio 2025-11-02 15:52:51 +01:00
b7271cf816 latest raycast config 2025-11-02 15:10:40 +01:00
d57ad9b3e9 add some tools 2025-10-28 11:24:20 +01:00
1824493c88 update configs 2025-10-27 23:05:37 +01:00
489971d880 update nix 2025-10-27 22:45:08 +01:00
b8b7145e47 update flake 2025-10-27 18:29:17 +01:00
d9f1588086 programms 2025-10-27 18:28:57 +01:00
950edff326 add clean command 2025-10-27 18:28:48 +01:00
ae6e533365 add 1k5 2025-10-27 18:28:41 +01:00
4faff3fe84 update flake 2025-10-15 21:59:10 +02:00
3680f878e2 use common home 2025-10-09 10:26:34 +02:00
2c6299e326 use correct url 2025-10-08 23:14:03 +02:00
56fd365da5 split into common 2025-10-08 23:08:51 +02:00
cb247c2967 discard previous enter key 2025-10-08 22:47:23 +02:00
9e5965499b upadte readme 2025-10-08 22:40:17 +02:00
1a6bc7b719 add install script 2025-10-08 22:36:37 +02:00
c8569a1224 add cli to main nix repo 2025-10-08 22:28:06 +02:00
eacfda0fd6 update flake 2025-10-08 14:18:44 +02:00
df6e6f391c update flake 2025-10-07 20:20:24 +02:00
9af79678d1 update flake 2025-09-25 14:02:28 +04:00
2be6430934 add crossover 2025-09-25 14:02:17 +04:00
bc7395d45a fix theme 2025-09-25 14:02:06 +04:00
dbdb337037 add cyberduck 2025-09-16 22:45:47 +02:00
386b7997e1 Merge pull request #6 from ordionary/main
claude code & lazydocker config
2025-09-16 22:45:17 +02:00
nicco
093e231e7e add claude code and lazydocker config 2025-09-16 17:39:48 +02:00
nicco
538fbd9adb add lazydocker config 2025-09-16 11:53:11 +02:00
39 changed files with 499 additions and 178 deletions

View File

@@ -1,17 +1,26 @@
# Dotfiles with Nix on macOS
<!--toc:start-->
- [Dotfiles with Nix on macOS](#dotfiles-with-nix-on-macos)
- [Installation](#installation)
- [Documentation](#documentation)
- [Crypt](#crypt)
- [CLI](#cli)
- [TODO](#todo)
<!--toc:end-->
## Installation
```bash
# Install nix [without the --determinate flag]
# ⚠️ When asked if install the determinate version say no
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Install nix
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --determinate
# Install brew [for casks]
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Get repo
git clone https://github.com/cupcakearmy/nix-macos ~/.config/nix-macos
git clone https://github.com/cupcakearmy/nix-macos ~/.config/dotfiles
# Unlock (Given that the base64 key is in your clipboard)
nix shell nixpkgs#git nixpkgs#git-crypt nixpkgs#coreutils
@@ -20,7 +29,7 @@ git-crypt unlock .key
# Installation
# Available hosts can be found in the ./hosts directory
sudo nix run nix-darwin -- switch --flake ~/.config/nix-macos#<host>
sudo nix run nix-darwin -- switch --flake ~/.config/dotfiles#<host>
# After installation simply use the provided alias to rebuild
vai
@@ -43,6 +52,19 @@ cat .key.b64 | base64 --decode > .key
git-crypt unlock .key
```
## CLI
The repo also includes a setup that I use on servers which is a toned down version. It lives under `./cli`.
```bash
# Install nix & the CLI
curl -sSL https://raw.githubusercontent.com/cupcakearmy/nix/refs/heads/main/cli/install.sh | bash
```
```
```
## TODO
Stuff that I would like to automate, but have not found a way/time

View File

@@ -15,7 +15,6 @@
"lihaoyun6/tap/quickrecorder"
# Dev
"docker-desktop"
"sloth"
"vscodium"
"visual-studio-code"
@@ -36,4 +35,5 @@
"mediahuman-audio-converter"
"imageoptim"
"appcleaner"
"drawio"
]

48
cli/flake.lock generated Normal file
View File

@@ -0,0 +1,48 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1759853171,
"narHash": "sha256-uqbhyXtqMbYIiMqVqUhNdSuh9AEEkiasoK3mIPIVRhk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "1a09eb84fa9e33748432a5253102d01251f72d6d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1759831965,
"narHash": "sha256-vgPm2xjOmKdZ0xKA6yLXPJpjOtQPHfaZDRtH+47XEBo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c9b6fb798541223bbb396d287d16f43520250518",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

42
cli/flake.nix Normal file
View File

@@ -0,0 +1,42 @@
{
description = "Server Shell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
nixpkgs,
home-manager,
...
}:
let
profiles = import ./profiles.nix;
in
{
homeConfigurations = nixpkgs.lib.genAttrs (builtins.map (p: p.name) profiles) (
profile:
let
p = (nixpkgs.lib.findFirst (p: p.name == profile) null profiles);
system = p.architecture;
pkgs = nixpkgs.legacyPackages.${system};
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
extraSpecialArgs = {
username = p.username;
homeDirectory = p.homeDirectory;
name = p.name;
};
}
);
};
}

24
cli/home.nix Normal file
View File

@@ -0,0 +1,24 @@
{
pkgs,
username,
name,
homeDirectory,
lib,
...
}:
let
common = (import ../common/home.nix) { inherit pkgs; };
overwrite = {
home.username = username;
home.homeDirectory = homeDirectory;
home = {
shellAliases = {
hm = "nix run home-manager/master -- switch --flake github:cupcakearmy/nix?dir=cli#${name} -b backup";
};
# Lists are not recursively updated, need to do by hand
packages = common.home.packages ++ [ ];
};
};
merged = lib.recursiveUpdate common overwrite;
in
merged

87
cli/install.sh Executable file
View File

@@ -0,0 +1,87 @@
#!/usr/bin/env bash
set -e
echo "=== Nix Home Manager Setup ==="
echo
# Check if Nix is installed
if ! command -v nix &>/dev/null; then
echo "Nix is not installed. Installing Nix..."
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --determinate
# Source nix profile
if [ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fi
echo "Nix installed successfully!"
echo
else
echo "Nix is already installed."
echo
fi
# Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64)
ARCH_NAME="x86"
;;
aarch64 | arm64)
ARCH_NAME="arm"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
# Detect OS
OS=$(uname -s)
case "$OS" in
Linux)
OS_NAME="linux"
;;
Darwin)
OS_NAME="darwin"
;;
*)
echo "Unsupported OS: $OS"
exit 1
;;
esac
echo "Detected: $ARCH_NAME / $OS_NAME"
echo
# Clear any remaining input and prompt for user
read -t 0.1 -n 10000 discard 2>/dev/null || true
echo "Select user:"
echo "1) root"
read -p "Enter choice [1]: " USER_CHOICE
USER_CHOICE=${USER_CHOICE:-1}
case "$USER_CHOICE" in
1)
USER_NAME="root"
;;
*)
echo "Invalid choice. Defaulting to root."
USER_NAME="root"
;;
esac
# Build flake configuration name
FLAKE_CONFIG="${USER_NAME}_${ARCH_NAME}_${OS_NAME}"
echo
echo "Configuration: $FLAKE_CONFIG"
echo "Running Home Manager..."
echo
# Run home-manager
nix run home-manager/master -- switch --flake "github:cupcakearmy/nix?dir=cli#${FLAKE_CONFIG}" -b backup
echo
echo "=== Setup complete! ==="

46
cli/pkgs.nix Normal file
View File

@@ -0,0 +1,46 @@
{ pkgs }:
with pkgs;
[
# Base
tmux
git
git-lfs
git-crypt
gnutar
gnupg
htop
btop
rclone
rename
tmux
tree
wget
rsync
yq
delta
# Rust utils
bat
eza
fd
ripgrep
ripgrep-all
zoxide
uutils-coreutils-noprefix
dust
yazi
starship
# Dev
lazydocker
k9s
kubectl
# Editor
neovim
fzf
lazygit
# Fonts
nerd-fonts.jetbrains-mono
]

26
cli/profiles.nix Normal file
View File

@@ -0,0 +1,26 @@
[
{
name = "root_x86_linux";
username = "root";
architecture = "x86_64-linux";
homeDirectory = "/root";
}
{
name = "root_x86_macos";
username = "root";
architecture = "x86_64-darwin";
homeDirectory = "/root";
}
{
name = "root_arm_linux";
username = "root";
architecture = "aarch64-linux";
homeDirectory = "/root";
}
{
name = "root_arm_macos";
username = "root";
architecture = "aarch64-darwin";
homeDirectory = "/root";
}
]

127
common/home.nix Normal file
View File

@@ -0,0 +1,127 @@
{
pkgs,
...
}:
{
home.stateVersion = "25.11";
home.packages = with pkgs; [
# Base
tmux
git
git-lfs
git-crypt
gnutar
gnupg
htop
btop
rclone
rename
tree
wget
rsync
yq
delta
kubectl
croc
asciinema_3
grex
# Rust utils
bat
eza
fd
ripgrep
ripgrep-all
zoxide
uutils-coreutils-noprefix
dust
yazi
starship
# TUI
lazydocker
lazygit
k9s
# Editor
neovim
fzf
# Fonts
nerd-fonts.jetbrains-mono
];
fonts.fontconfig.enable = true;
home = {
sessionVariables = {
EDITOR = "nvim";
};
shellAliases = {
# Rust re-maps
l = "eza -a1lh";
ls = "eza";
cat = "bat";
cd = "z";
# QOL
dc = "docker compose";
dcl = "dc logs -f";
dclt = "dcl --tail 100";
dcln = "dcl --since 1m";
rsync = "rsync -az --info=progress2";
t = "tmux new-session -A -s main";
e = "nvim";
g = "lazygit";
d = "lazydocker";
k = "kubectl";
};
};
programs = {
home-manager.enable = true;
direnv.enable = true;
zoxide.enable = true;
fish = {
enable = true;
interactiveShellInit = ''
if type -q starship
starship init fish | source
end
if type -q fnm
fnm env --use-on-cd | source
end
if type -q nvs
nvs env --source | source
end
'';
};
bash = {
enable = true;
};
tmux = {
enable = true;
clock24 = true;
mouse = true;
extraConfig = ''
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# switch panes using jkhl
bind h select-pane -L
bind l select-pane -R
bind j select-pane -U
bind k select-pane -D
'';
shell = "${pkgs.fish}/bin/fish";
terminal = "tmux-256color";
};
};
}

View File

@@ -6,6 +6,7 @@
...
}:
{
nix.enable = false;
nix.settings = {
experimental-features = "nix-command flakes";
substituters = [ "https://devenv.cachix.org" ];

View File

@@ -1,4 +1,4 @@
font-family = "JetBrainsMono Nerd Font"
quit-after-last-window-closed=true
theme = "rose-pine"
theme = "dark:Rose Pine,light:Rose Pine Dawn"
window-save-state = "always"

View File

@@ -0,0 +1,2 @@
gui:
returnImmediately: true

18
flake.lock generated
View File

@@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1756579987,
"narHash": "sha256-duCce8zGsaMsrqqOmLOsuaV1PVIw/vXWnKuLKZClsGg=",
"lastModified": 1764952935,
"narHash": "sha256-cRPB2zESVMjIGxJ49qj4t4qnT0ae44E+fS/mkfOS/BY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "99a69bdf8a3c6bf038c4121e9c4b6e99706a187a",
"rev": "519828bf1c97f8bc2ed2d3b79214067047d3c67d",
"type": "github"
},
"original": {
@@ -27,11 +27,11 @@
]
},
"locked": {
"lastModified": 1755825449,
"narHash": "sha256-XkiN4NM9Xdy59h69Pc+Vg4PxkSm9EWl6u7k6D5FZ5cM=",
"lastModified": 1764161084,
"narHash": "sha256-HN84sByg9FhJnojkGGDSrcjcbeioFWoNXfuyYfJ1kBE=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "8df64f819698c1fee0c2969696f54a843b2231e8",
"rev": "e95de00a471d07435e0527ff4db092c84998698e",
"type": "github"
},
"original": {
@@ -42,11 +42,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1756536218,
"narHash": "sha256-ynQxPVN2FIPheUgTFhv01gYLbaiSOS7NgWJPm9LF9D0=",
"lastModified": 1764915887,
"narHash": "sha256-CeBCJ9BMsuzVgn8GVfuSRZ6xeau7szzG0Xn6O/OxP9M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a918bb3594dd243c2f8534b3be01b3cb4ed35fd1",
"rev": "42e29df35be6ef54091d3a3b4e97056ce0a98ce8",
"type": "github"
},
"original": {

View File

@@ -5,102 +5,47 @@
config,
...
}:
{
# https://nix-community.github.io/home-manager
home.stateVersion = "25.05";
programs.home-manager.enable = true;
let
common = (import ../common/home.nix) { inherit pkgs; };
overwrite = {
home.username = host.username;
home.homeDirectory = "/Users/${host.username}";
home.username = host.username;
home.homeDirectory = "/Users/${host.username}";
home.packages =
common.home.packages
++ (import ./pkgs.nix { inherit pkgs; })
++ ((lib.attrByPath [ "extras" "pkgs" ] (pkgs: [ ]) host) pkgs);
home.packages =
(import ./pkgs.nix { inherit pkgs; })
++ ((lib.attrByPath [ "extras" "pkgs" ] (pkgs: [ ]) host) pkgs);
fonts.fontconfig.enable = true;
fonts.fontconfig.enable = true;
home = {
home = {
sessionVariables = {
EDITOR = "nvim";
};
file = {
".config/ghostty/config".source = ../files/ghostty/config;
".gitconfig".source = ../files/git/gitconfig;
".gitignore_global".source = ../files/git/gitignore_global;
".gitconfig.local".source = ../secrets/git/config.${host.hostName};
".config/nvim".source = ../files/nvim;
"Library/Application Support/lazydocker/config.yml".source = ../files/lazydocker/config.yml;
file = {
".config/ghostty/config".source = ../files/ghostty/config;
".gitconfig".source = ../files/git/gitconfig;
".gitignore_global".source = ../files/git/gitignore_global;
".gitconfig.local".source = ../secrets/git/config.${host.hostName};
".config/nvim".source = ../files/nvim;
# Secrets
".ssh/config".text = builtins.replaceStrings [ "@SSH_KEY@" ] [ host.sshKey ] (
builtins.readFile ../secrets/ssh/config.template
);
};
# Secrets
".ssh/config".text = builtins.replaceStrings [ "@SSH_KEY@" ] [ host.sshKey ] (
builtins.readFile ../secrets/ssh/config.template
);
};
shellAliases = {
p = "pnpm";
px = "pnpm -s dlx";
n = "fnm use --install-if-missing";
c = "pwd | pbcopy";
shellAliases = {
# Rust re-maps
l = "eza -a1lh";
ls = "eza";
cat = "bat";
cd = "z";
# QOL
dc = "docker compose";
rsync = "rsync -az --info=progress2";
t = "tmux new-session -A -s main";
e = "nvim";
g = "lazygit";
d = "lazydocker";
p = "pnpm";
px = "pnpm -s dlx";
n = "fnm use --install-if-missing";
c = "pwd | pbcopy";
k = "kubectl";
vai = "sudo darwin-rebuild switch --flake ~/.config/nix-macos#${host.hostName}";
vai = "sudo darwin-rebuild switch --flake ~/.config/dotfiles#${host.hostName}";
clean = "nix-collect-garbage -d";
};
};
};
programs = {
direnv.enable = true;
zoxide.enable = true;
fish = {
enable = true;
interactiveShellInit = ''
if type -q starship
starship init fish | source
end
if type -q fnm
fnm env --use-on-cd | source
end
if type -q nvs
nvs env --source | source
end
'';
};
bash = {
enable = true;
};
tmux = {
enable = true;
clock24 = true;
mouse = true;
extraConfig = ''
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# switch panes using jkhl
bind h select-pane -L
bind l select-pane -R
bind j select-pane -U
bind k select-pane -D
'';
shell = "${pkgs.fish}/bin/fish";
terminal = "tmux-256color";
};
};
}
merged = lib.recursiveUpdate common overwrite;
in
merged

View File

@@ -2,55 +2,20 @@
with pkgs;
[
# Base
tmux
git
git-lfs
git-crypt
gh
bfg-repo-cleaner
gnutar
gnupg
htop
btop
rclone
rename
tmux
tree
wget
woff2
rsync
yq
delta
# Rust utils
bat
eza
fd
ripgrep
ripgrep-all
zoxide
uutils-coreutils-noprefix
dust
yazi
starship
# Dev
devenv
nixpacks
ollama
colima
lazydocker
exercism
posting
terraform
k9s
kubectl
claude-code
opencode
# Editor
nvs
neovim
fzf
lazygit
lua
luajitPackages.luarocks
ast-grep
@@ -70,6 +35,5 @@ with pkgs;
go
# Fonts
nerd-fonts.jetbrains-mono
karla
]

15
hosts/1k5.nix Normal file
View File

@@ -0,0 +1,15 @@
{
username = "nicco";
hostName = "1k5";
platform = "aarch64-darwin";
sshKey = "1k5";
extras = {
casks = [
"notion"
];
pkgs =
pkgs: with pkgs; [
];
};
}

View File

@@ -1,4 +1,4 @@
[
(import ./mac14.nix)
(import ./ordio.nix)
(import ./1k5.nix)
]

View File

@@ -13,13 +13,18 @@
"daisydisk"
"blender"
"bambu-studio"
"cyberduck"
"kicad"
];
pkgs =
pkgs: with pkgs; [
docker-client
colima
docker-buildx
biome
infisical
ffmpeg
pulumi
mkcert
];
};
}

View File

@@ -1,33 +0,0 @@
{
username = "nicco";
hostName = "ordio";
platform = "aarch64-darwin";
sshKey = "ordio";
extras = {
casks = [
"tableplus"
"http-toolkit"
"phpstorm"
"notion"
];
pkgs =
pkgs: with pkgs; [
mkcert
dnsmasq
awscli2
mysql84
cocoapods
xcodes
# For projects
pixman
pkg-config
pango
libpng
giflib
librsvg
python313Packages.setuptools
];
};
}

Binary file not shown.

BIN
secrets/configs/raycast.key Normal file

Binary file not shown.

BIN
secrets/git/config.1k5 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.