add personal machine, a whole lotta config
This commit is contained in:
parent
55e8aa870b
commit
022902fc6d
8 changed files with 294 additions and 165 deletions
28
flake.nix
28
flake.nix
|
@ -13,14 +13,13 @@
|
||||||
|
|
||||||
outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, nixvim }:
|
outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, nixvim }:
|
||||||
{
|
{
|
||||||
# Build darwin flake using:
|
|
||||||
# $ darwin-rebuild build --flake .#tid27880sperrau
|
|
||||||
darwinConfigurations."tid27880sperrau" = nix-darwin.lib.darwinSystem {
|
darwinConfigurations."tid27880sperrau" = nix-darwin.lib.darwinSystem {
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
system.configurationRevision = self.rev or self.dirtyRev or null;
|
system.configurationRevision = self.rev or self.dirtyRev or null;
|
||||||
}
|
}
|
||||||
./nix-darwin
|
./nix-darwin
|
||||||
|
./nix-darwin/hosts/tid27880sperrau
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
{
|
{
|
||||||
users.users.sperrault.home = "/Users/sperrault";
|
users.users.sperrault.home = "/Users/sperrault";
|
||||||
|
@ -31,7 +30,30 @@
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit nixvim;
|
inherit nixvim;
|
||||||
};
|
};
|
||||||
users.sperrault = import ./home-manager;
|
users.sperrault = import ./home-manager/users/sperrault.nix;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
darwinConfigurations."Sloanes-MacBook-Air" = nix-darwin.lib.darwinSystem {
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
system.configurationRevision = self.rev or self.dirtyRev or null;
|
||||||
|
}
|
||||||
|
./nix-darwin
|
||||||
|
./nix-darwin/hosts/Sloanes-MacBook-Air
|
||||||
|
home-manager.darwinModules.home-manager
|
||||||
|
{
|
||||||
|
users.users.sloane.home = "/Users/sloane";
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
backupFileExtension = "before-home-manager";
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit nixvim;
|
||||||
|
};
|
||||||
|
users.sloane = import ./home-manager/users/sloane.nix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
nixvim.homeManagerModules.nixvim
|
nixvim.homeManagerModules.nixvim
|
||||||
|
./nixvim
|
||||||
];
|
];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
username = "sperrault";
|
|
||||||
homeDirectory = "/Users/sperrault";
|
|
||||||
stateVersion = "24.11";
|
stateVersion = "24.11";
|
||||||
|
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
|
@ -16,13 +15,30 @@
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
watchman
|
watchman
|
||||||
difftastic
|
difftastic
|
||||||
|
maple-mono-NF
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.file.".config/ghostty/config" = {
|
||||||
|
enable = true;
|
||||||
|
text = ''
|
||||||
|
font-family = "Maple Mono NF"
|
||||||
|
font-size = 16
|
||||||
|
theme = "catppuccin-mocha"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
fish_vi_key_bindings
|
fish_vi_key_bindings
|
||||||
|
|
||||||
|
# start or attach to default tmux session
|
||||||
|
if not set -q TMUX
|
||||||
|
set -g TMUX tmux new-session -d -s default
|
||||||
|
eval $TMUX
|
||||||
|
tmux attach-session -d -t default
|
||||||
|
end
|
||||||
'';
|
'';
|
||||||
shellAbbrs = {
|
shellAbbrs = {
|
||||||
j = "jj";
|
j = "jj";
|
||||||
|
@ -41,161 +57,25 @@
|
||||||
enableFishIntegration = true;
|
enableFishIntegration = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nixvim = {
|
programs.tmux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
keyMode = "vi";
|
||||||
globals = {
|
mouse = true;
|
||||||
mapleader = " ";
|
prefix = "C-a";
|
||||||
};
|
sensibleOnTop = true;
|
||||||
|
plugins = with pkgs.tmuxPlugins; [
|
||||||
globalOpts = {
|
sensible
|
||||||
number = true;
|
prefix-highlight
|
||||||
relativenumber = true;
|
vim-tmux-navigator
|
||||||
shiftwidth = 2;
|
catppuccin
|
||||||
expandtab = true;
|
|
||||||
tabstop = 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
colorschemes.catppuccin.enable = true;
|
|
||||||
|
|
||||||
keymaps = [
|
|
||||||
{
|
|
||||||
key = ";";
|
|
||||||
action = ":";
|
|
||||||
mode = ["n" "v"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>y";
|
|
||||||
action = ''"+y'';
|
|
||||||
mode = ["n" "v"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>Y";
|
|
||||||
action = ''"+Y'';
|
|
||||||
mode = ["n" "v"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>p";
|
|
||||||
action = ''"+p'';
|
|
||||||
mode = ["n" "v"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>P";
|
|
||||||
action = ''"+P'';
|
|
||||||
mode = ["n" "v"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>w";
|
|
||||||
action = "<cmd>w<cr>";
|
|
||||||
mode = ["n"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>q";
|
|
||||||
action = "<cmd>q<cr>";
|
|
||||||
mode = ["n"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<esc>";
|
|
||||||
action = "<cmd>nohlsearch<cr>";
|
|
||||||
mode = ["n"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = ''<leader>"'';
|
|
||||||
action = "<cmd>split<cr>";
|
|
||||||
mode = ["n"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>%";
|
|
||||||
action = "<cmd>vsplit<cr>";
|
|
||||||
mode = ["n"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader><tab>";
|
|
||||||
action = "<cmd>NERDTreeToggle<cr>";
|
|
||||||
mode = ["n"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>fl";
|
|
||||||
action = "<cmd>NERDTreeFind<cr>";
|
|
||||||
mode = ["n"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader><space>";
|
|
||||||
action = "<cmd>Telescope find_files theme=dropdown<cr>";
|
|
||||||
mode = ["n"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<leader>/";
|
|
||||||
action = "<cmd>Telescope live_grep<cr>";
|
|
||||||
mode = ["n"];
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
extraConfig = ''
|
||||||
|
set -g @catppuccin_flavor 'frappe'
|
||||||
|
|
||||||
extraPlugins = with pkgs.vimPlugins; [
|
bind c new-window -c "#{pane_current_path}"
|
||||||
vim-abolish
|
bind '"' split-window -c "#{pane_current_path}"
|
||||||
nerdtree
|
bind % split-window -h -c "#{pane_current_path}"
|
||||||
vim-rhubarb
|
'';
|
||||||
];
|
|
||||||
|
|
||||||
plugins.commentary.enable = true;
|
|
||||||
plugins.repeat.enable = true;
|
|
||||||
plugins.fugitive.enable = true;
|
|
||||||
|
|
||||||
plugins.nvim-autopairs.enable = true;
|
|
||||||
plugins.nvim-surround.enable = true;
|
|
||||||
|
|
||||||
plugins.web-devicons.enable = true;
|
|
||||||
|
|
||||||
plugins.treesitter = {
|
|
||||||
enable = true;
|
|
||||||
settings.indent.enable = true;
|
|
||||||
settings.highlight.enable = true;
|
|
||||||
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
|
||||||
bash
|
|
||||||
json
|
|
||||||
lua
|
|
||||||
markdown
|
|
||||||
nix
|
|
||||||
toml
|
|
||||||
vim
|
|
||||||
yaml
|
|
||||||
elixir
|
|
||||||
javascript
|
|
||||||
typescript
|
|
||||||
css
|
|
||||||
html
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
plugins.lsp = {
|
|
||||||
enable = true;
|
|
||||||
servers = {
|
|
||||||
elixirls.enable = true;
|
|
||||||
fish_lsp.enable = true;
|
|
||||||
html.enable = true;
|
|
||||||
nixd.enable = true;
|
|
||||||
tailwindcss.enable = true;
|
|
||||||
terraform_lsp.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
plugins.telescope.enable = true;
|
|
||||||
|
|
||||||
plugins.cmp = {
|
|
||||||
enable = true;
|
|
||||||
autoEnableSources = true;
|
|
||||||
settings.sources = [
|
|
||||||
{ name = "nvim_lsp"; }
|
|
||||||
{ name = "luasnip"; }
|
|
||||||
{ name = "path"; }
|
|
||||||
{ name = "buffer"; }
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.zellij = {
|
|
||||||
enable = true;
|
|
||||||
enableFishIntegration = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
|
|
157
home-manager/nixvim/default.nix
Normal file
157
home-manager/nixvim/default.nix
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
mapleader = " ";
|
||||||
|
};
|
||||||
|
|
||||||
|
globalOpts = {
|
||||||
|
number = true;
|
||||||
|
relativenumber = true;
|
||||||
|
shiftwidth = 2;
|
||||||
|
expandtab = true;
|
||||||
|
tabstop = 2;
|
||||||
|
};
|
||||||
|
|
||||||
|
colorschemes.catppuccin.enable = true;
|
||||||
|
|
||||||
|
keymaps = [
|
||||||
|
{
|
||||||
|
key = ";";
|
||||||
|
action = ":";
|
||||||
|
mode = ["n" "v"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>y";
|
||||||
|
action = ''"+y'';
|
||||||
|
mode = ["n" "v"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>Y";
|
||||||
|
action = ''"+Y'';
|
||||||
|
mode = ["n" "v"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>p";
|
||||||
|
action = ''"+p'';
|
||||||
|
mode = ["n" "v"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>P";
|
||||||
|
action = ''"+P'';
|
||||||
|
mode = ["n" "v"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>w";
|
||||||
|
action = "<cmd>w<cr>";
|
||||||
|
mode = ["n"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>q";
|
||||||
|
action = "<cmd>q<cr>";
|
||||||
|
mode = ["n"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<esc>";
|
||||||
|
action = "<cmd>nohlsearch<cr>";
|
||||||
|
mode = ["n"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = ''<leader>"'';
|
||||||
|
action = "<cmd>split<cr>";
|
||||||
|
mode = ["n"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>%";
|
||||||
|
action = "<cmd>vsplit<cr>";
|
||||||
|
mode = ["n"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader><tab>";
|
||||||
|
action = "<cmd>NERDTreeToggle<cr>";
|
||||||
|
mode = ["n"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>fl";
|
||||||
|
action = "<cmd>NERDTreeFind<cr>";
|
||||||
|
mode = ["n"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader><space>";
|
||||||
|
action = "<cmd>Telescope find_files theme=dropdown<cr>";
|
||||||
|
mode = ["n"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>/";
|
||||||
|
action = "<cmd>Telescope live_grep<cr>";
|
||||||
|
mode = ["n"];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
|
vim-abolish
|
||||||
|
nerdtree
|
||||||
|
vim-rhubarb
|
||||||
|
];
|
||||||
|
|
||||||
|
plugins.commentary.enable = true;
|
||||||
|
plugins.repeat.enable = true;
|
||||||
|
plugins.fugitive.enable = true;
|
||||||
|
|
||||||
|
plugins.nvim-autopairs.enable = true;
|
||||||
|
plugins.nvim-surround.enable = true;
|
||||||
|
|
||||||
|
plugins.web-devicons.enable = true;
|
||||||
|
|
||||||
|
plugins.treesitter = {
|
||||||
|
enable = true;
|
||||||
|
settings.indent.enable = true;
|
||||||
|
settings.highlight.enable = true;
|
||||||
|
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||||
|
bash
|
||||||
|
json
|
||||||
|
lua
|
||||||
|
markdown
|
||||||
|
nix
|
||||||
|
toml
|
||||||
|
vim
|
||||||
|
yaml
|
||||||
|
elixir
|
||||||
|
javascript
|
||||||
|
typescript
|
||||||
|
css
|
||||||
|
html
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.lsp = {
|
||||||
|
enable = true;
|
||||||
|
servers = {
|
||||||
|
elixirls.enable = true;
|
||||||
|
fish_lsp.enable = true;
|
||||||
|
html.enable = true;
|
||||||
|
nixd.enable = true;
|
||||||
|
tailwindcss.enable = true;
|
||||||
|
terraform_lsp.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.telescope.enable = true;
|
||||||
|
|
||||||
|
plugins.cmp = {
|
||||||
|
enable = true;
|
||||||
|
autoEnableSources = true;
|
||||||
|
settings.sources = [
|
||||||
|
{ name = "nvim_lsp"; }
|
||||||
|
{ name = "luasnip"; }
|
||||||
|
{ name = "path"; }
|
||||||
|
{ name = "buffer"; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.tmux-navigator.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
10
home-manager/users/sloane.nix
Normal file
10
home-manager/users/sloane.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../default.nix
|
||||||
|
];
|
||||||
|
home = {
|
||||||
|
username = "sloane";
|
||||||
|
homeDirectory = "/Users/sloane";
|
||||||
|
};
|
||||||
|
}
|
8
home-manager/users/sperrault.nix
Normal file
8
home-manager/users/sperrault.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [ ../default.nix ];
|
||||||
|
home = {
|
||||||
|
username = "sperrault";
|
||||||
|
homeDirectory = "/Users/sperrault";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,17 +1,10 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
# List packages installed in system profile. To search by name, run:
|
|
||||||
# $ nix-env -qaP | grep wget
|
|
||||||
environment.systemPackages = [];
|
environment.systemPackages = [];
|
||||||
|
|
||||||
# Necessary for using flakes on this system.
|
# Necessary for using flakes on this system.
|
||||||
nix.settings.experimental-features = "nix-command flakes";
|
nix.settings.experimental-features = "nix-command flakes";
|
||||||
|
|
||||||
# Enable alternative shell support in nix-darwin.
|
|
||||||
# programs.fish.enable = true;
|
|
||||||
|
|
||||||
# Set Git commit hash for darwin-version.
|
|
||||||
|
|
||||||
# Used for backwards compatibility, please read the changelog before changing.
|
# Used for backwards compatibility, please read the changelog before changing.
|
||||||
# $ darwin-rebuild changelog
|
# $ darwin-rebuild changelog
|
||||||
system.stateVersion = 6;
|
system.stateVersion = 6;
|
||||||
|
@ -19,6 +12,53 @@
|
||||||
# The platform the configuration will be used on.
|
# The platform the configuration will be used on.
|
||||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||||
|
|
||||||
|
security.pam.enableSudoTouchIdAuth = true;
|
||||||
|
|
||||||
|
system.defaults = {
|
||||||
|
dock = {
|
||||||
|
autohide = true;
|
||||||
|
autohide-delay = 0.05;
|
||||||
|
orientation = "bottom";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
environment.shells = [ pkgs.fish ];
|
environment.shells = [ pkgs.fish ];
|
||||||
programs.fish.enable = true;
|
|
||||||
|
programs.fish = {
|
||||||
|
enable = true;
|
||||||
|
shellInit = ''
|
||||||
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
homebrew = {
|
||||||
|
enable = true;
|
||||||
|
global = {
|
||||||
|
autoUpdate = false;
|
||||||
|
};
|
||||||
|
onActivation = {
|
||||||
|
autoUpdate = false;
|
||||||
|
cleanup = "uninstall";
|
||||||
|
};
|
||||||
|
|
||||||
|
brews = [
|
||||||
|
"mas"
|
||||||
|
];
|
||||||
|
|
||||||
|
casks = [
|
||||||
|
"1password"
|
||||||
|
"alfred"
|
||||||
|
"fantastical"
|
||||||
|
"firefox"
|
||||||
|
"ghostty"
|
||||||
|
"karabiner-elements"
|
||||||
|
"keepingyouawake"
|
||||||
|
"tailscale"
|
||||||
|
];
|
||||||
|
|
||||||
|
masApps = {
|
||||||
|
Things = 904280696;
|
||||||
|
"Hand Mirror" = 1502839586;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
8
nix-darwin/hosts/Sloanes-MacBook-Air/default.nix
Normal file
8
nix-darwin/hosts/Sloanes-MacBook-Air/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
homebrew = {
|
||||||
|
casks = [
|
||||||
|
"discord"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
4
nix-darwin/hosts/tid27880sperrau/default.nix
Normal file
4
nix-darwin/hosts/tid27880sperrau/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue