diff --git a/darwin/brew_casks.txt b/darwin/brew_casks.txt new file mode 100644 index 0000000..8978970 --- /dev/null +++ b/darwin/brew_casks.txt @@ -0,0 +1,4 @@ +alacritty +font-roboto-mono +openscad +xquartz diff --git a/darwin/brew_packages.txt b/darwin/brew_packages.txt new file mode 100644 index 0000000..42a48c8 --- /dev/null +++ b/darwin/brew_packages.txt @@ -0,0 +1,132 @@ +aom +bash +brotli +ca-certificates +cairo +capstone +cdrtools +clang-format +cmake +coreutils +dtc +fastfetch +fish +fontconfig +freetype +fribidi +fzf +gd +gdk-pixbuf +gettext +giflib +glib +gmp +gnutls +graphite2 +graphviz +gts +harfbuzz +highway +htop +icu4c@77 +imath +jasper +jpeg-turbo +jpeg-xl +jq +json-glib +krb5 +ldns +libavif +libcbor +libdeflate +libevent +libfido2 +libidn2 +libkeccak +liblinear +libnghttp2 +libpng +librsvg +libslirp +libssh +libssh2 +libtasn1 +libtermkey +libtiff +libtool +libtpms +libunistring +libusb +libuv +libvmaf +libvterm +libx11 +libxau +libxcb +libxcrypt +libxdmcp +libxext +libxrender +little-cms2 +llvm +lmdb +lua +luajit +luv +lz4 +lzo +m4 +mpdecimal +msgpack +navi +ncurses +neofetch +neovim +netpbm +nettle +ninja +nmap +ollama +oniguruma +openexr +openjph +openssh +openssl@3 +p11-kit +pango +pcre2 +pipx +pixman +popt +python@3.12 +python@3.13 +qemu +readline +samba +screenresolution +sdl2 +sha3sum +snappy +socat +spicetify-cli +sqlite +swtpm +talloc +tdb +tealdeer +tevent +tree +tree-sitter +unbound +unibilium +usbutils +vde +webp +wget +xorgproto +xz +yabai +z3 +zstd +zsync diff --git a/darwin/config.lua b/darwin/config.lua new file mode 100644 index 0000000..15dd681 --- /dev/null +++ b/darwin/config.lua @@ -0,0 +1,267 @@ +-- Basics +vim.g.mapleader = " " + +-- Yank to system clipboard +vim.keymap.set("n", "y", '"+y', { desc = "Yank to clipboard" }) +vim.keymap.set("v", "y", '"+y', { desc = "Yank to clipboard" }) +vim.keymap.set("n", "Y", '"+Y', { desc = "Yank line to clipboard" }) + +-- Also make delete operations use system clipboard +vim.keymap.set("n", "d", '"+d', { desc = "Delete to clipboard" }) +vim.keymap.set("v", "d", '"+d', { desc = "Delete to clipboard" }) +vim.keymap.set("n", "D", '"+D', { desc = "Delete line to clipboard" }) + +-- Paste from system clipboard +vim.keymap.set("n", "p", '"+p', { desc = "Paste from clipboard" }) +vim.keymap.set("v", "p", '"+p', { desc = "Paste from clipboard" }) + +-- Treesitter +require("nvim-treesitter.configs").setup({ + ensure_installed = { "lua", "nix", "python", "javascript", "rust", "rasi" }, + sync_install = false, + auto_install = true, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + + parser_install_dir = vim.fn.stdpath("data") .. "/treesitter", +}) +vim.opt.runtimepath:append(vim.fn.stdpath("data") .. "/treesitter") + +-- Linting +require("lint").linters_by_ft = {} +vim.api.nvim_create_autocmd({ "BufWritePost" }, { + callback = function() + require("lint").try_lint() + end, +}) + +-- Mason Setup +require("mason").setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, +}) + +require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "nil_ls", + "rust_analyzer", + "pylsp", + }, + automatic_installation = true, +}) + +-- LSP Config +local cmp = require("cmp") +cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + { name = "path" }, + }), +}) + +local lspconfig = require("lspconfig") +local capabilities = require("cmp_nvim_lsp").default_capabilities() +vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) +vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) +vim.keymap.set("n", "rn", vim.lsp.buf.rename, {}) +vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + +-- Setup language servers +lspconfig.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + diagnostics = { globals = { "vim" } }, + workspace = { library = vim.api.nvim_get_runtime_file("", true) }, + telemetry = { enable = false }, + }, + }, +}) + +lspconfig.nil_ls.setup({ capabilities = capabilities }) +lspconfig.rust_analyzer.setup({ capabilities = capabilities }) +lspconfig.pylsp.setup({ capabilities = capabilities }) +lspconfig.stylelint_lsp.setup({ + cmd = { "stylelint-lsp", "--stdio" }, + filetypes = { "css", "scss", "rasi" }, + capabilities = vim.lsp.protocol.make_client_capabilities(), +}) + +-- Conform +require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + nix = { "nixfmt" }, + python = { "black" }, + rust = { "rustfmt" }, + rasi = { "prettierd" }, + }, + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, +}) + +-- Yazi +require("yazi").setup({ + open_for_directories = true, +}) + +vim.keymap.set("n", "fy", function() + require("yazi").yazi(nil, vim.loop.cwd()) +end, { desc = "Open Yazi file manager" }) + +vim.keymap.set("n", "fd", function() + require("yazi").yazi(nil, vim.fn.expand("%:p:h")) +end, { desc = "Open Yazi in current file directory" }) + +-- Telescope +--require("telescope").setup() + +--local telescope = require("telescope.builtin") +--vim.keymap.set("n", "ff", telescope.find_files, { desc = "Telescope find files" }) +--vim.keymap.set("n", "fg", telescope.live_grep, { desc = "Telescope live grep" }) +--vim.keymap.set("n", "fb", telescope.buffers, { desc = "Telescope buffers" }) +--vim.keymap.set("n", "fh", telescope.help_tags, { desc = "Telescope help tags" }) + +-- Styling +require("catppuccin").setup({ + flavour = "mocha", + transparent_background = true, + term_colors = true, + integration = { + treesitter = true, + mason = true, + lsp_trouble = true, + which_key = true, + cmp = true, + gitsigns = true, + telescope = true, + nvimtree = true, + dashboard = true, + notify = true, + indent_blankline = true, + toggleterm = true, -- Important for transparent terminals + }, +}) + +vim.cmd.colorscheme("catppuccin") +vim.opt.number = true +vim.opt.cursorline = true +vim.opt.showmode = false +vim.opt.syntax = "enable" +vim.opt.hlsearch = true +vim.opt.incsearch = true +vim.opt.tabstop = 4 +vim.opt.termguicolors = true + +local colors = require("catppuccin.palettes").get_palette("mocha") +vim.api.nvim_set_hl(0, "LineNr", { fg = colors.text, bg = "NONE" }) +vim.api.nvim_set_hl(0, "CursorLineNr", { fg = colors.pink, bg = "NONE", bold = true }) + +-- ToggleTerm setup +require("toggleterm").setup({ + size = 20, + open_mapping = [[]], + direction = "float", + float_opts = { + border = "single", + width = 200, + height = 40, + }, +}) + +vim.keymap.set("n", "h", function() + require("toggleterm").toggle(1, 10, vim.loop.cwd(), "horizontal") +end, { desc = "Toggle terminal (horizontal)" }) + +vim.keymap.set("n", "v", function() + require("toggleterm").toggle(2, 60, vim.loop.cwd(), "vertical") +end, { desc = "Toggle terminal (vertical)" }) + +vim.keymap.set("n", "ft", function() + require("toggleterm").toggle(3, 20, vim.loop.cwd(), "float") +end, { desc = "Toggle terminal (float)" }) + +vim.keymap.set("t", "", "ToggleTerm", { desc = "Toggle terminal" }) +vim.keymap.set("t", "", "v", { desc = "Exit terminal and enter visual mode" }) + +-- Statusline +require("lualine").setup({ + options = { + theme = "catppuccin", + component_separators = { left = "|", right = "|" }, + section_separators = { left = "", right = "" }, + }, +}) + +-- Dashboard +local alpha = require("alpha") +local dashboard = require("alpha.themes.dashboard") + +dashboard.section.header.val = { + "⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣯⣿⠿⣟⣷⣯⣛⢿⣿⣿⣾⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿", + "⣿⣿⣿⣿⣿⣿⣿⡿⣵⣿⡿⣴⣽⡟⣳⢿⢽⣽⣕⣽⢿⡿⣿⣟⣿⣿⣿⣿⣿⣿⣿", + "⣿⣿⣿⣷⣿⣿⢟⣫⣿⢟⢟⣾⣾⣿⣿⣞⢳⣻⢞⣎⠿⢞⣊⣿⣞⣿⣿⣿⣿⣿⢽", + "⣿⣿⣿⣿⣿⣏⢯⣿⣏⣏⠔⢇⣿⢢⢆⢀⢆⣧⣼⢻⢰⡧⢻⣝⣏⡸⣧⣾⣿⣿⣿", + "⣿⣿⣿⣿⡟⣻⣿⣿⡾⡿⡼⢸⡝⣝⡳⢢⣧⢳⣳⢷⡇⣗⢺⡺⣿⡧⣿⣿⣿⢿⢿", + "⣿⡿⣿⣼⡼⣿⣿⡗⡧⣧⠁⡝⣧⣳⠅⡾⠈⣎⢮⣧⣿⣿⣗⣷⣻⢷⣏⣼⢏⣺⣿", + "⣿⣿⣿⣻⣿⣿⣿⢧⣿⢹⠉⢷⢿⣧⣲⡏⡀⡈⢆⠳⣿⡿⢿⣿⣱⢿⢫⣷⣝⣿⣿", + "⣿⣿⣿⡯⡟⣿⣿⢽⣡⠟⢿⣮⠁⠙⠛⠈⡴⢿⣿⡷⣬⣽⢽⠧⣷⡏⣿⡇⣧⣽⣿", + "⣿⠟⢻⡧⡇⣿⡇⣇⣆⢄⡜⢃⡀⡀⡀⡀⡀⢎⣁⠁⣸⣗⣸⣿⣧⣼⡿⢹⢿⢾⣿", + "⣿⣷⣾⣿⢻⣿⢧⢻⣽⡀⡀⡀⡀⢄⡀⡀⡀⡀⡀⢀⣷⡸⡟⣿⣶⣻⣧⡛⡱⢝⣿", + "⣿⣿⣿⣿⢸⡿⢚⡜⣿⣇⡀⡀⡀⡀⡀⡀⡀⡀⠚⢁⢣⣜⡿⣿⡇⢼⣿⠨⣸⣿⣿", + "⣿⣄⣿⣗⢾⢻⣧⢿⣾⣿⣦⡀⡀⠑⠚⠉⡀⡀⣤⣿⢨⣿⠗⣻⢣⣿⢹⢈⣽⣿⣿", + "⣿⣿⣿⣿⢎⡄⢿⣞⡇⣿⠹⣿⣶⣀⡀⣀⡴⡩⢸⢏⣿⣿⣶⢻⣾⢏⡞⠡⢽⣇⣾", + "⣿⣿⣿⣮⣼⢬⣦⢿⣳⣌⠧⡉⠈⣇⣛⣁⣈⣼⣿⡸⠫⠛⠐⠛⠕⣙⣻⣬⣼⣿⣿", + "⢟⢿⣿⣿⣿⡢⣃⣪⣭⣡⣤⣶⠟⡿⠿⠿⠿⠛⢁⣿⣿⢩⠉⡀⠈⠓⡝⣿⣿⣿⣿", + "⣾⣿⣿⣿⣿⠞⢔⡣⡴⣾⣿⠓⣤⢧⡼⣉⠠⢤⣿⣿⠇⠃⡀⡀⡀⡀⡸⢿⣾⣿⣿", + "⣿⣿⣿⡿⣺⡸⢗⢠⣇⣿⣿⠊⠃⡀⠉⡀⢠⣿⣿⠟⡸⡀⡀⡀⡀⡀⣃⣬⠽⠿⣿", + "⣿⣿⣿⣿⡇⡏⢸⣿⠟⣽⡇⡀⡀⡀⡀⣴⣟⢭⣾⣿⡇⠎⣠⠒⠉⠈⢀⡀⢨⡋⣿", + "⠛⠛⠛⠋⠃⠓⠚⠛⠘⠛⠃⡀⠊⡀⠛⠛⠛⠂⠛⠛⠓⠁⠚⡀⠂⠒⠒⠐⠒⠋⠛", +} + +dashboard.section.buttons.val = { + dashboard.button("e", "[+] New file", ":ene startinsert "), + dashboard.button("f", "[?] Find file", ":Telescope find_files "), + dashboard.button("r", "[~] Recent files", ":Telescope oldfiles "), + dashboard.button("y", "[Y] Yazi", ":Yazi"), + dashboard.button("m", "[M] Mason", ":Mason"), + dashboard.button("q", "[X] Quit", ":qa"), +} + +dashboard.section.footer.val = "Circuits hum in anticipation of your will." + +vim.api.nvim_create_autocmd("VimEnter", { + callback = function() + if vim.fn.argc() == 0 then + require("alpha").start() + end + end, +}) + +alpha.setup(dashboard.config) diff --git a/darwin/configuration.nix b/darwin/configuration.nix new file mode 100644 index 0000000..3b40ebd --- /dev/null +++ b/darwin/configuration.nix @@ -0,0 +1,81 @@ +{ + pkgs, + inputs, + ... +}: + +{ + imports = [ ./yabari.nix ]; + # System configuration for Intel Mac + nixpkgs.hostPlatform = "x86_64-darwin"; # Essential for Intel Macs :cite[1]:cite[2]:cite[5] + + # Enable flakes and nix-command experimental features + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; # Essential for flake support :cite[2]:cite[5]:cite[7] + + # System packages (installed system-wide) + environment.systemPackages = with pkgs; [ ]; + + system.primaryUser = "dergrumpf"; + users.users.dergrumpf = { + name = "dergrumpf"; + home = "/Users/dergrumpf"; # Must match home.homeDirectory in home.nix :cite[10] + shell = pkgs.fish; + }; + + # Shell configuration + programs.zsh.enable = true; # Default shell on macOS :cite[5]:cite[10] + # Alternative: enable fish if preferred + programs.fish.enable = true; + + # System defaults for macOS + system.defaults = { + # Dock settings + dock.autohide = false; # Auto-hide the dock :cite[8]:cite[10] + dock.orientation = "left"; # Position dock on left :cite[8]:cite[10] + dock.show-recents = false; # Don't show recent applications :cite[8]:cite[10] + dock.mru-spaces = false; # Don't rearrange spaces based on most recent use :cite[5] + + # Finder settings + finder.AppleShowAllExtensions = true; # Show all file extensions :cite[5]:cite[8]:cite[10] + finder.FXEnableExtensionChangeWarning = false; # Disable extension change warning :cite[8]:cite[10] + finder.FXPreferredViewStyle = "clmv"; # Use column view :cite[5]:cite[8] + finder.ShowPathbar = true; # Show path bar :cite[8]:cite[10] + finder.ShowStatusBar = true; # Show status bar :cite[8] + + # Screenshot settings + screencapture.location = "~/Pictures/screenshots"; # Save screenshots to specific location :cite[5]:cite[8] + + # Global domain settings + NSGlobalDomain.AppleKeyboardUIMode = 3; # Full keyboard control :cite[8]:cite[10] + NSGlobalDomain."com.apple.keyboard.fnState" = true; # Function keys behave as F1-F12 :cite[10] + }; + + # Touch ID for sudo authentication (if supported by hardware) + security.pam.services.sudo_local.touchIdAuth = true; # Enable Touch ID for sudo :cite[5]:cite[8] + + # Font configuration + fonts.packages = with pkgs; [ + nerd-fonts.fira-code + ]; + + # Nix garbage collection (automatic cleanup) + nix.gc = { + automatic = true; # Enable automatic garbage collection :cite[8] + interval = { + # Run weekly on Sunday at 3:15 AM :cite[8] + Hour = 3; + Minute = 15; + Weekday = 7; + }; + options = "--delete-older-than 7d"; # Delete packages older than 7 days :cite[8] + }; + + # System version (for backwards compatibility) + system.stateVersion = 6; # Important for configuration compatibility :cite[5]:cite[10] + + # Optional: Configuration revision for tracking changes + system.configurationRevision = inputs.self.rev or inputs.self.dirtyRev or null; # Track git revision :cite[5]:cite[7] +} diff --git a/darwin/flake.lock b/darwin/flake.lock new file mode 100644 index 0000000..f600b55 --- /dev/null +++ b/darwin/flake.lock @@ -0,0 +1,388 @@ +{ + "nodes": { + "catppuccin": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1758270360, + "narHash": "sha256-yqh6EEhlpVWRoKl85o1s+QZ72UHWTvornnc3C0Ls484=", + "owner": "catppuccin", + "repo": "nix", + "rev": "2e0aacdd6abbecd1b1c0511a2fcd1460a6bc6645", + "type": "github" + }, + "original": { + "owner": "catppuccin", + "repo": "nix", + "type": "github" + } + }, + "devshell": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741473158, + "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", + "owner": "numtide", + "repo": "devshell", + "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-compat": { + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "revCount": 69, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751413152, + "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758375677, + "narHash": "sha256-BLtD+6qWz7fQjPk2wpwyXQLGI0E30Ikgf2ppn2nVadI=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "edc7468e12be92e926847cb02418e649b02b59dd", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747688870, + "narHash": "sha256-ypL9WAZfmJr5V70jEVzqGjjQzF0uCkz+AFQF7n9NmNc=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "d5f1f641b289553927b3801580598d200a501863", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748294338, + "narHash": "sha256-FVO01jdmUNArzBS7NmaktLdGA5qA3lUMJ4B7a05Iynw=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "cc5f390f7caf265461d4aab37e98d2292ebbdb85", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.0.8", + "repo": "ixx", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758387173, + "narHash": "sha256-E5Ru709RoQEFl+Q0MHRXTIvbY0l6LSR1UHqwTulSeog=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "7be9c1b136ef7083e60eb060be0a66dcb254e3ca", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "nix-darwin_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743127615, + "narHash": "sha256-+sMGqywrSr50BGMLMeY789mSrzjkoxZiu61eWjYS/8o=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "fc843893cecc1838a59713ee3e50e9e7edc6207c", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "nix-darwin-24.11", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1758035966, + "narHash": "sha256-qqIJ3yxPiB0ZQTT9//nFGQYn8X/PBoJbofA7hRKZnmE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8d4ddb19d03c65a36ad8d189d001dc32ffb0306b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1758262103, + "narHash": "sha256-aBGl3XEOsjWw6W3AHiKibN7FeoG73dutQQEqnd/etR8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "12bd230118a1901a4a5d393f9f56b6ad7e571d01", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin_2", + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1751725553, + "narHash": "sha256-bkvw8jXTdRBWRfO50IaxNuUIamnLllxfEFqUG/g3uwo=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "81d65e0cfb00df0269195b59f156c719cc045ab8", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "nixos-24.11", + "repo": "nixvim", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749730855, + "narHash": "sha256-L3x2nSlFkXkM6tQPLJP3oCBMIsRifhIDPMQQdHO5xWo=", + "owner": "NuschtOS", + "repo": "search", + "rev": "8dfe5879dd009ff4742b668d9c699bc4b9761742", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, + "root": { + "inputs": { + "catppuccin": "catppuccin", + "home-manager": "home-manager", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs_2", + "nixvim": "nixvim" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750931469, + "narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/darwin/flake.nix b/darwin/flake.nix new file mode 100644 index 0000000..08ce2e6 --- /dev/null +++ b/darwin/flake.nix @@ -0,0 +1,59 @@ +{ + description = "Cyperpunk nix-darwin system flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + nix-darwin = { + url = "github:nix-darwin/nix-darwin/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Editor + nixvim = { + url = "github:nix-community/nixvim/nixos-24.11"; + # If using a stable channel you can use `url = "github:nix-community/nixvim/nixos-"` + inputs.nixpkgs.follows = "nixpkgs"; + }; + + + catppuccin.url = "github:catppuccin/nix"; + }; + + outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, catppuccin, nixvim, ... }: + let + system = "x86_64-darwin"; + specialArgs = { inherit inputs system; }; + in + { + darwinConfigurations = { + "Phil-Mac" = nix-darwin.lib.darwinSystem { + inherit system specialArgs; + + modules = [ + # Main Config + ./configuration.nix + + # home manager integration + home-manager.darwinModules.home-manager { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.dergrumpf = import ./home.nix; + backupFileExtension = "backup"; + extraSpecialArgs = specialArgs; + sharedModules = [ + inputs.nixvim.homeManagerModules.nixvim + ]; + }; + } + ]; + }; + }; + }; +} diff --git a/darwin/home.nix b/darwin/home.nix new file mode 100644 index 0000000..550f6bf --- /dev/null +++ b/darwin/home.nix @@ -0,0 +1,196 @@ +{ + config, + pkgs, + lib, + darwinConfig, + ... +}: + +{ + imports = [ ]; + + home.username = "dergrumpf"; + home.homeDirectory = "/Users/dergrumpf"; + + home.stateVersion = "23.11"; + + programs.home-manager.enable = true; + + home.packages = with pkgs; [ + # Utilities + coreutils + direnv + fd + git + ripgrep + fzf + zoxide + starship + trash-cli + + # Miscellaneous + fastfetch + btop + wget + curl + + nixfmt-rfc-style + stylua + black + nodePackages.prettier + rustfmt + nodejs + prettierd + stylelint-lsp + + # Mason Binarys + lua-language-server + nil + rust-analyzer + python3Packages.python-lsp-server + + curl + cargo + yazi + ]; + + home.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "code"; + PAGER = "less"; + CLICOLOR = "1"; + LSCOLORS = "ExFxBxDxCxegedabagacad"; + TERM = "xterm-kitty"; + }; + + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + #extraPackages = with pkgs; [ ]; + + plugins = with pkgs.vimPlugins; [ + nvim-treesitter + nvim-lint + catppuccin-nvim + mason-nvim + mason-lspconfig-nvim + nvim-lspconfig + nvim-cmp + cmp-nvim-lsp + cmp-buffer + cmp-path + cmp-cmdline + luasnip + lualine-nvim + yazi-nvim + alpha-nvim + cheatsheet-nvim + toggleterm-nvim + + # Add conform.nvim as a custom plugin + (pkgs.vimUtils.buildVimPlugin { + name = "conform-nvim"; + src = pkgs.fetchFromGitHub { + owner = "stevearc"; + repo = "conform.nvim"; + rev = "stable"; + sha256 = "sha256-pUF9F5QoDzCZuVRcJEF91M8Qjkh/xosMkf9tRavkmJs="; + }; + }) + + ]; + + extraLuaConfig = builtins.readFile (./. + "/config.lua"); + }; + + programs.fish = { + enable = true; + interactiveShellInit = '' + function fish_greeting + fastfetch + end + ''; + plugins = [ + { + name = "forgit"; + src = pkgs.fishPlugins.forgit.src; + } + ]; + shellAliases = { + ll = "ls -l"; + la = "ls -la"; + gs = "git status"; + gp = "git push"; + }; + }; + + programs.kitty = { + enable = true; + themeFile = "Catppuccin-Mocha"; + font.name = "FiraCode Nerd Font Mono"; + settings = { + confirm_os_window_close = 0; + dynamic_background_opacity = true; + enable_audio_bell = false; + mouse_hide_wait = "-1.0"; + window_padding_width = 10; + background_opacity = "0.9"; + # Ensure proper symbol rendering with Nerd Fonts + symbol_map = "U+23FB-U+23FE U+2B58 U+E200-U+E2A9 U+E0A0-U+E0A3 U+E0B0-U+E0BF U+E0C0-U+E0C8 U+E0CC-U+E0CF U+E0D0-U+E0D2 U+E0D4 U+E700-U+E7C5 U+F000-U+F2E0 U+2665 U+26A1 U+F400-U+F4A8 U+F67C U+E000-U+E00A U+F300-U+F313 U+E5FA-U+E62B Symbols Nerd Font"; + }; + extraConfig = '' + shell /run/current-system/sw/bin/fish + ''; + }; + + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + + programs.git = { + enable = true; + userName = "DerGrumpf"; + userEmail = "p.keier@beyerstedt-it.de"; + aliases = { + co = "checkout"; + ci = "commit"; + st = "status"; + br = "branch"; + }; + extraConfig = { + init.defaultBranch = "main"; + pull.rebase = true; + }; + }; + + programs.ssh = { + enable = true; + enableDefaultConfig = false; + matchBlocks = { + "example.com" = { + user = "dergrumpf"; + identityFile = "~/.ssh/id_ed25519"; + }; + }; + }; + + programs.starship = { + enable = true; + enableFishIntegration = true; + settings = { + add_newline = true; + format = "$directory$git_branch$git_status$cmd_duration$line_break$character"; + }; + }; + + services = { + gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + enableSshSupport = true; + }; + }; +} diff --git a/darwin/macbook2019.nix b/darwin/macbook2019.nix new file mode 100644 index 0000000..34e304d --- /dev/null +++ b/darwin/macbook2019.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, inputs, username, ... }: +{ + networking.hostName = "macbook2019"; + services.nix-daemon.enable = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nixpkgs.hostPlatform = "x86_64-darwin"; # Intel Mac + + # Required for backward compatibility + system.stateVersion = "25.04"; + + # User configuration + users.users.${username} = { + name = username; + home = "/Users/${username}"; + }; + + # Enable zsh (common on macOS) + programs.zsh.enable = true; +} diff --git a/darwin/nixos.nix b/darwin/nixos.nix new file mode 100644 index 0000000..01bf6a9 --- /dev/null +++ b/darwin/nixos.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + users.users.dergrumpf = { + # authorizedKeys + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCaLHfxVylghDMYR8t4QMUpeRRqXasNABQKBEy9MmhbUXCcWiPbPMSZH8FMHON34rm2OrXP1kY/8jQxqBJDA+SqpFR2AZ4Khk9iVMaq5GHxxpn2amZUjoBa+fB29WaiE1npV5JVJV3O0ylw6GtiCnpneE6fGx2MO1vOY/7zKrUX/OK7WfwkDpeEzZgV/j/md917HrzUVeZwdeTq3WCRO8Gew6R8Xs6FRjSiGuH0dq14D4Ow5Zf1cI1jx+JfD/5vGasw8HXPu1NdxsOE+6D7/22IKqGr+S74/lAoyyD5qqk0s05lw8UY/PXBLJaNLZu9Fwx0BqTHpJEvftpmvd9wUxgR3msx9VXtKNSrqivIbDgeU+3oGzzkrGZODl7FCp4XKGmbrX85Z6lKwEGgv5jez4MLZcmT86bxB7m1wIbqSbVtfhS+GI7yPTA/kLzzFa14Im/+LTj95pb8qs2ALMwTMP1j2f9A6D3RriOFihL+68qn+YbK58KuV1R0f+CQRmlfVbk= phil@web.cyperpunk.de" + ]; + shell = pkgs.fish; + #extraGroups = [ "video" ]; + }; +} diff --git a/darwin/yabari.nix b/darwin/yabari.nix new file mode 100644 index 0000000..e1f5005 --- /dev/null +++ b/darwin/yabari.nix @@ -0,0 +1,165 @@ +{ ... }: +{ + services.yabai = { + enable = true; + enableScriptingAddition = true; + config = { + focus_follows_mouse = "autoraise"; + mouse_follows_focus = "on"; + window_placement = "second_child"; + window_opacity = "off"; + window_opacity_duration = "0.0"; + active_window_opacity = "1.0"; + normal_window_opacity = "1.0"; + split_ratio = "0.50"; + auto_balance = "off"; + mouse_modifier = "fn"; + mouse_action1 = "move"; + mouse_action2 = "resize"; + layout = "bsp"; + top_padding = 5; + bottom_padding = 5; + left_padding = 5; + right_padding = 5; + window_gap = 5; + }; + + extraConfig = '' + yabai -m space 1 --label main + yabai -m space 2 --label browser + yabai -m space 3 --label terminal + ''; + }; + + services.skhd = { + enable = true; + skhdConfig = '' + # Focus workspace 1-9 with alt + number + alt - 1 : yabai -m space --focus main + alt - 2 : yabai -m space --focus browser + alt - 3 : yabai -m space --focus terminal + alt - 4 : yabai -m space --focus 4 + alt - 5 : yabai -m space --focus 5 + alt - 6 : yabai -m space --focus 6 + alt - 7 : yabai -m space --focus 7 + alt - 8 : yabai -m space --focus 8 + alt - 9 : yabai -m space --focus 9 + + # Move focused window to workspace 1-9 with alt + shift + number + alt + shift - 1 : yabai -m window --space 1 + alt + shift - 2 : yabai -m window --space 2 + alt + shift - 3 : yabai -m window --space 3 + alt + shift - 4 : yabai -m window --space 4 + alt + shift - 5 : yabai -m window --space 5 + alt + shift - 6 : yabai -m window --space 6 + alt + shift - 7 : yabai -m window --space 7 + alt + shift - 8 : yabai -m window --space 8 + alt + shift - 9 : yabai -m window --space 9 + + # Focus windows alt + arrow keys + alt - left : yabai -m window --focus west + alt - right : yabai -m window --focus east + + # Close focused window with alt + c + alt - c : yabai -m window --close + + # App Shortcuts + ctrl - q : open -a kitty --args --directory="~" + ''; + }; + + services.sketchybar = { + enable = true; + config = '' + # Bar configuration (batched together for efficiency) + sketchybar --bar color=0x1e1e2e \ + border_color=0xffff9e2e \ + position=top \ + height=25 \ + notch_display_height=0 \ + margin=0 \ + y_offset=0 \ + corner_radius=0 \ + border_width=2 \ + blur_radius=0 \ + padding_left=0 \ + padding_right=2 \ + notch_width=200 \ + notch_offset=0 \ + display=all \ + hidden=off \ + topmost=off \ + sticky=on \ + font_smoothing=off \ + shadow=off + + # Default item properties + sketchybar --default updates=when_shown \ + icon.font="Hack Nerd Font:Bold:14.0" \ + icon.color=0xffcdd6f4 \ + label.font="Hack Nerd Font:Regular:12.0" \ + label.color=0xffcdd6f4 + + # Left items - Date and time + sketchybar --add item date left \ + --set date icon= \ + label="$(date '+%a %d %b')" \ + script='while true; do sketchybar --set date label="$(date "+%a %d %b")"; sleep 300; done' \ + update_freq=300 + + sketchybar --add item time left \ + --set time icon= \ + label="$(date '+%H:%M')" \ + script='while true; do sketchybar --set time label="$(date "+%H:%M")"; sleep 60; done' \ + update_freq=60 + + # Center items - Active window title + sketchybar --add item title center \ + --set title label="Desktop" \ + script='sketchybar --set title label="$INFO"' + + # Right items - System info + sketchybar --add item cpu right \ + --set cpu icon= \ + label="?" \ + script='~/.config/sketchybar/plugins/cpu.sh' \ + update_freq=5 + + sketchybar --add item ram right \ + --set ram icon= \ + label="?" \ + script='~/.config/sketchybar/plugins/ram.sh' \ + update_freq=5 + + sketchybar --add item battery right \ + --set battery icon= \ + label="?" \ + script='~/.config/sketchybar/plugins/battery.sh' \ + update_freq=10 + + sketchybar --add item volume right \ + --set volume icon= \ + label="?" \ + script='~/.config/sketchybar/plugins/volume.sh' \ + update_freq=1 + + sketchybar --add item wifi right \ + --set wifi icon= \ + label="?" \ + script='~/.config/sketchybar/plugins/wifi.sh' \ + update_freq=10 + + # Spacing items + sketchybar --add item spacer_left left \ + --set spacer_left width=10 + + sketchybar --add item spacer_right right \ + --set spacer_right width=10 + + # Subscribe to events + sketchybar --subscribe title front_app_switched \ + volume volume_change \ + battery power_source_change system_woke + ''; + }; +} diff --git a/users/phil/darwin.nix b/users/phil/darwin.nix new file mode 100644 index 0000000..dbc6c53 --- /dev/null +++ b/users/phil/darwin.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, inputs, username, ... }: +{ + # macOS-specific user configuration + # You can import shared home configurations here + imports = [ + ../../home/programs/productivity/okular.nix + ]; + + # macOS-specific home-manager settings + home.stateVersion = "24.05"; # Match your existing version +}