From 212098b6e7180cfeaa9fd1566b958992deac163e Mon Sep 17 00:00:00 2001 From: Natalie Date: Wed, 21 May 2025 13:05:29 -0700 Subject: [PATCH 01/12] got folding range to work --- users/natalie/vim.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/users/natalie/vim.nix b/users/natalie/vim.nix index a1bad7b..cd55dbd 100644 --- a/users/natalie/vim.nix +++ b/users/natalie/vim.nix @@ -14,9 +14,24 @@ foldcolumn = "1"; foldlevelstart = 99; foldenable = true; + foldmethod = "expr"; + #Default to treesitter folding + foldexpr = "v:lua.vim.treesitter.foldexpr()"; }; autocmds = [ + { + event = ["LspAttach"]; + callback = pkgs.lib.generators.mkLuaInline '' + function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client:supports_method('textDocument/foldingRange') then + local win = vim.api.nvim_get_current_win() + vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()' + end + end + ''; + } ]; theme = { name = "catppuccin"; From 0ea9675fc43f29a0de56780a321d73dec66c8466 Mon Sep 17 00:00:00 2001 From: Natalie Date: Wed, 21 May 2025 13:56:17 -0700 Subject: [PATCH 02/12] add helpview.nvim --- users/natalie/vim/default.nix | 3 ++- users/natalie/vim/lean.nix | 10 ++++++++++ users/natalie/vim/ui.nix | 16 ++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 users/natalie/vim/lean.nix create mode 100644 users/natalie/vim/ui.nix diff --git a/users/natalie/vim/default.nix b/users/natalie/vim/default.nix index a4f01cf..4634262 100644 --- a/users/natalie/vim/default.nix +++ b/users/natalie/vim/default.nix @@ -3,6 +3,7 @@ ./keybinds.nix ./languages.nix ./latex.nix + ./lean.nix + ./ui.nix ]; - } diff --git a/users/natalie/vim/lean.nix b/users/natalie/vim/lean.nix new file mode 100644 index 0000000..8503935 --- /dev/null +++ b/users/natalie/vim/lean.nix @@ -0,0 +1,10 @@ +{pkgs, ...}: { + vim = { + lazy.plugins."lean.nvim" = { + enabled = true; + package = pkgs.vimPlugins.lean-nvim; + lazy = true; + ft = "lean"; + }; + }; +} diff --git a/users/natalie/vim/ui.nix b/users/natalie/vim/ui.nix new file mode 100644 index 0000000..531a3cd --- /dev/null +++ b/users/natalie/vim/ui.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + vim = { + ui = { + borders = { + enable = true; + }; + }; + + # Better help docs + lazy.plugins."helpview-nvim" = { + enabled = true; + package = pkgs.vimPlugins.helpview-nvim; + lazy = false; + }; + }; +} From b6f59a300d5533e9700c5b997b30d5e3d5a594aa Mon Sep 17 00:00:00 2001 From: Natalie Date: Wed, 21 May 2025 15:25:56 -0700 Subject: [PATCH 03/12] add diagnostics --- flake.lock | 138 +++++++++++++++------ flake.nix | 8 +- lib/mkSystem.nix | 140 ++++++++++------------ users/natalie/vim/default.nix | 2 +- users/natalie/vim/languages.nix | 48 ++++---- users/natalie/vim/{ui.nix => visuals.nix} | 7 +- 6 files changed, 205 insertions(+), 138 deletions(-) rename users/natalie/vim/{ui.nix => visuals.nix} (64%) diff --git a/flake.lock b/flake.lock index 1bdbf8d..356fe13 100644 --- a/flake.lock +++ b/flake.lock @@ -239,11 +239,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -257,11 +257,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -290,7 +290,25 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_6" + "systems": "systems_4" + }, + "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" + } + }, + "flake-utils_5": { + "inputs": { + "systems": "systems_7" }, "locked": { "lastModified": 1705309234, @@ -306,9 +324,9 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_6": { "inputs": { - "systems": "systems_7" + "systems": "systems_8" }, "locked": { "lastModified": 1710146030, @@ -324,9 +342,9 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_7": { "inputs": { - "systems": "systems_8" + "systems": "systems_9" }, "locked": { "lastModified": 1705309234, @@ -342,6 +360,21 @@ "type": "github" } }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, "fromYaml": { "flake": false, "locked": { @@ -514,6 +547,41 @@ "url": "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in" } }, + "lix": { + "flake": false, + "locked": { + "lastModified": 1746827285, + "narHash": "sha256-hsFe4Tsqqg4l+FfQWphDtjC79WzNCZbEFhHI8j2KJzw=", + "rev": "47aad376c87e2e65967f17099277428e4b3f8e5a", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/47aad376c87e2e65967f17099277428e4b3f8e5a.tar.gz?rev=47aad376c87e2e65967f17099277428e4b3f8e5a" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/lix/archive/2.93.0.tar.gz" + } + }, + "lix-module": { + "inputs": { + "flake-utils": "flake-utils", + "flakey-profile": "flakey-profile", + "lix": "lix", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746838955, + "narHash": "sha256-11R4K3iAx4tLXjUs+hQ5K90JwDABD/XHhsM9nkeS5N8=", + "rev": "cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz" + } + }, "mnw": { "locked": { "lastModified": 1747499976, @@ -531,7 +599,7 @@ }, "moonlight": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ] @@ -618,7 +686,7 @@ }, "nix-options-search": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "gitignore": "gitignore", "nixpkgs": "nixpkgs" }, @@ -706,21 +774,6 @@ "type": "github" } }, - "nixpkgs-stable_2": { - "locked": { - "lastModified": 1720535198, - "narHash": "sha256-zwVvxrdIzralnSbcpghA92tWu2DV2lwv89xZc8MTrbg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "205fd4226592cc83fd4c0885a3e4c9c400efabb5", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-23.11", - "type": "indirect" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1747744144, @@ -797,13 +850,13 @@ "nvf": { "inputs": { "flake-parts": "flake-parts", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "mnw": "mnw", "nil": "nil", "nixpkgs": [ "nixpkgs" ], - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1747525582, @@ -836,13 +889,13 @@ "apple-fonts": "apple-fonts", "darwin": "darwin", "home-manager": "home-manager", + "lix-module": "lix-module", "moonlight": "moonlight", "nh": "nh", "nix-index-database": "nix-index-database", "nix-options-search": "nix-options-search", "nixos-cosmic": "nixos-cosmic", "nixpkgs": "nixpkgs_2", - "nixpkgs-stable": "nixpkgs-stable_2", "nvf": "nvf", "rust-overlay": "rust-overlay_3", "stylix": "stylix", @@ -1013,7 +1066,7 @@ "nixpkgs" ], "nur": "nur", - "systems": "systems_5", + "systems": "systems_6", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -1154,6 +1207,21 @@ "type": "github" } }, + "systems_9": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tinted-foot": { "flake": false, "locked": { @@ -1260,7 +1328,7 @@ "zig": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": "nixpkgs_3" }, "locked": { @@ -1280,7 +1348,7 @@ "zig-overlay": { "inputs": { "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_7", "nixpkgs": [ "zls", "nixpkgs" @@ -1302,7 +1370,7 @@ }, "zls": { "inputs": { - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "gitignore": "gitignore_3", "langref": "langref", "nixpkgs": "nixpkgs_4", diff --git a/flake.nix b/flake.nix index 8877e2f..7e5975a 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,11 @@ description = "multi device configuration flake"; inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; - nixpkgs-stable.url = "nixpkgs/nixos-23.11"; + + lix-module = { + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager.url = "github:nix-community/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; @@ -43,6 +47,7 @@ { self, nixpkgs, + lix-module, nixos-cosmic, darwin, ... @@ -92,6 +97,7 @@ inherit overlays nixpkgs + lix-module inputs mkNeovim ; diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index 40387ac..ab0ef67 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -2,32 +2,24 @@ # particular architecture. { nixpkgs, + lix-module, overlays, inputs, mkNeovim, -}: name: { +}: +name: +{ user, # ./users/{name} host, # ./users/{name}/{host} system, # arch-os - extraModules ? [], -}: let + extraModules ? [ ], +}: +let darwin = nixpkgs.lib.strings.hasSuffix "-darwin" system; - getInputModule = a: b: - inputs.${ - a - }.${ - if darwin - then "darwinModules" - else "nixosModules" - }.${ - b - }; + getInputModule = a: b: inputs.${a}.${if darwin then "darwinModules" else "nixosModules"}.${b}; # NixOS vs nix-darwin functions - systemFunc = - if darwin - then inputs.darwin.lib.darwinSystem - else nixpkgs.lib.nixosSystem; + systemFunc = if darwin then inputs.darwin.lib.darwinSystem else nixpkgs.lib.nixosSystem; userDir = ../users + "/${user}"; userConfig = import (userDir + "/user.nix"); @@ -38,10 +30,7 @@ hostHomePath = hostDir + "/home.nix"; userHomePath = userDir + "/home.nix"; - pathOrNull = a: - if builtins.pathExists a - then a - else null; + pathOrNull = a: if builtins.pathExists a then a else null; # Arguments passed to all module files args = { @@ -68,18 +57,14 @@ term, # preferred $TERM editor, # preferred $EDITOR browser ? null, # preferred $BROWSER - } @ user: - user + }@user: + user ) - userConfig; + userConfig; }; systemSettings = rec { inherit darwin; - homeDir = "/${ - if darwin - then "Users" - else "home" - }/${userConfig.username}"; + homeDir = "/${if darwin then "Users" else "home"}/${userConfig.username}"; }; mainHomeImports = builtins.filter (f: f != null) [ @@ -92,60 +77,59 @@ } ]; in - systemFunc { - inherit system; +systemFunc { + inherit system; - modules = - builtins.filter (f: f != null) [ - # Apply our overlays. Overlays are keyed by system type so we have - # to go through and apply our system type. We do this first so - # the overlays are available globally. - {nixpkgs.overlays = overlays;} + modules = + builtins.filter (f: f != null) [ + # Apply our overlays. Overlays are keyed by system type so we have + # to go through and apply our system type. We do this first so + # the overlays are available globally. + { nixpkgs.overlays = overlays; } - # Modules shared between nix-darwin and NixOS - ../modules/shared - # Modules for the specific OS - ( - if darwin - then ../modules/macos - else ../modules/nixos - ) + # Use lix (alternative nix implementation) + # https://lix.systems/add-to-config/#flake-based-configurations + lix-module.nixosModules.default + # (getInputModule "lix-module" "default") - # The user-wide configuration.nix - (pathOrNull userConfigPath) - # The host-wide configuration.nix - (pathOrNull hostConfigPath) + # Modules shared between nix-darwin and NixOS + ../modules/shared + # Modules for the specific OS + (if darwin then ../modules/macos else ../modules/nixos) - # Set up nix-index and enable comma for easy one-shot command use - # https://github.com/nix-community/comma - (getInputModule "nix-index-database" "nix-index") - {programs.nix-index-database.comma.enable = true;} + # The user-wide configuration.nix + (pathOrNull userConfigPath) + # The host-wide configuration.nix + (pathOrNull hostConfigPath) - # Themes for all programs - (getInputModule "stylix" "stylix") + # Set up nix-index and enable comma for easy one-shot command use + # https://github.com/nix-community/comma + (getInputModule "nix-index-database" "nix-index") + { programs.nix-index-database.comma.enable = true; } - # Home manager - (getInputModule "home-manager" "home-manager") - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "hm-backup"; - # Arguments passed to all module files - extraSpecialArgs = - args - // { - inherit mainHomeImports; - }; - # can't find how to make this an array without the param - users.${userConfig.username} = ../modules/home; + # Themes for all programs + (getInputModule "stylix" "stylix") + + # Home manager + (getInputModule "home-manager" "home-manager") + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "hm-backup"; + # Arguments passed to all module files + extraSpecialArgs = args // { + inherit mainHomeImports; }; - users.users.${userConfig.username}.home = systemSettings.homeDir; - } + # can't find how to make this an array without the param + users.${userConfig.username} = ../modules/home; + }; + users.users.${userConfig.username}.home = systemSettings.homeDir; + } - # Arguments passed to all module files - {config._module.args = args;} - ] - # Add extra modules specified from config - ++ extraModules; - } + # Arguments passed to all module files + { config._module.args = args; } + ] + # Add extra modules specified from config + ++ extraModules; +} diff --git a/users/natalie/vim/default.nix b/users/natalie/vim/default.nix index 4634262..7568a91 100644 --- a/users/natalie/vim/default.nix +++ b/users/natalie/vim/default.nix @@ -4,6 +4,6 @@ ./languages.nix ./latex.nix ./lean.nix - ./ui.nix + ./visuals.nix ]; } diff --git a/users/natalie/vim/languages.nix b/users/natalie/vim/languages.nix index b15b78d..f35d571 100644 --- a/users/natalie/vim/languages.nix +++ b/users/natalie/vim/languages.nix @@ -4,24 +4,16 @@ host, pkgs, ... -}: let - darwin = - if host.darwin - then "darwin" - else "nixos"; - flakePath = "/${ - if host.darwin - then "Users" - else "home" - }/${user.username}/.dotfiles"; +}: +let + darwin = if host.darwin then "darwin" else "nixos"; + flakePath = "/${if host.darwin then "Users" else "home"}/${user.username}/.dotfiles"; # BIG HACK DO NOT DO PLS - hostname = - if host.darwin - then "Natalies-MacBook-Air" - else "nixos"; -in { + hostname = if host.darwin then "Natalies-MacBook-Air" else "nixos"; +in +{ vim = { extraPackages = with pkgs; [ python312Packages.pylatexenc @@ -94,18 +86,30 @@ in { enable = true; setupOpts = { formatters_by_ft = { - fish = ["fish_indent"]; - tex = ["latexindent"]; + fish = [ "fish_indent" ]; + tex = [ "latexindent" ]; }; }; }; - diagnostics.nvim-lint = { + diagnostics = { enable = true; - linters_by_ft = { - nix = ["statix"]; - tex = ["chktex"]; - haskell = ["hlint"]; + config = { + virtual_text = { + format = pkgs.lib.generators.mkLuaInline '' + function(diagnostic) + return string.format("%s (%s)", diagnostic.message, diagnostic.source) + end + ''; + }; + }; + nvim-lint = { + enable = true; + linters_by_ft = { + nix = [ "statix" ]; + tex = [ "chktex" ]; + haskell = [ "hlint" ]; + }; }; }; treesitter = { diff --git a/users/natalie/vim/ui.nix b/users/natalie/vim/visuals.nix similarity index 64% rename from users/natalie/vim/ui.nix rename to users/natalie/vim/visuals.nix index 531a3cd..a4f0ac6 100644 --- a/users/natalie/vim/ui.nix +++ b/users/natalie/vim/visuals.nix @@ -1,5 +1,10 @@ {pkgs, ...}: { vim = { + visuals = { + indent-blankline = { + enable = true; + }; + }; ui = { borders = { enable = true; @@ -7,7 +12,7 @@ }; # Better help docs - lazy.plugins."helpview-nvim" = { + lazy.plugins."helpview.nvim" = { enabled = true; package = pkgs.vimPlugins.helpview-nvim; lazy = false; From 27be81d9141e439bc75c782fb7f414e8d520f92f Mon Sep 17 00:00:00 2001 From: Natalie Date: Wed, 21 May 2025 15:35:29 -0700 Subject: [PATCH 04/12] override more defaults --- users/natalie/vim.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/users/natalie/vim.nix b/users/natalie/vim.nix index cd55dbd..563c715 100644 --- a/users/natalie/vim.nix +++ b/users/natalie/vim.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ imports = [ ./vim/default.nix ]; @@ -20,8 +21,9 @@ }; autocmds = [ + #Autocommand to fall back to treesitter folding if LSP doesnt support it { - event = ["LspAttach"]; + event = [ "LspAttach" ]; callback = pkgs.lib.generators.mkLuaInline '' function(args) local client = vim.lsp.get_client_by_id(args.data.client_id) @@ -33,6 +35,20 @@ ''; } ]; + + tabline = { + nvimBufferline.enable = true; + }; + + binds = { + hardtime-nvim = { + enable = true; + setupOpts = { + restriction_mode = "block"; + }; + }; + }; + theme = { name = "catppuccin"; style = "mocha"; From b3d5a281416e3e90bccea2e2dbaf204aacb3a21c Mon Sep 17 00:00:00 2001 From: Natalie Date: Tue, 27 May 2025 19:56:17 -0700 Subject: [PATCH 05/12] removed stylix, updated nvf --- flake.lock | 134 ++++++-------------------------- flake.nix | 12 +-- lib/mkSystem.nix | 4 +- modules/neovim/default.nix | 12 ++- users/natalie/laptop/home.nix | 5 ++ users/natalie/packages.nix | 20 ++--- users/natalie/user.nix | 2 +- users/natalie/vim.nix | 16 +++- users/natalie/vim/languages.nix | 6 ++ users/natalie/vim/latex.nix | 74 ++++++++++++++++-- 10 files changed, 139 insertions(+), 146 deletions(-) diff --git a/flake.lock b/flake.lock index 356fe13..26d8ffe 100644 --- a/flake.lock +++ b/flake.lock @@ -239,11 +239,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -257,11 +257,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -290,25 +290,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_4" - }, - "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" - } - }, - "flake-utils_5": { - "inputs": { - "systems": "systems_7" + "systems": "systems_6" }, "locked": { "lastModified": 1705309234, @@ -324,9 +306,9 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_5": { "inputs": { - "systems": "systems_8" + "systems": "systems_7" }, "locked": { "lastModified": 1710146030, @@ -342,9 +324,9 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_6": { "inputs": { - "systems": "systems_9" + "systems": "systems_8" }, "locked": { "lastModified": 1705309234, @@ -360,21 +342,6 @@ "type": "github" } }, - "flakey-profile": { - "locked": { - "lastModified": 1712898590, - "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", - "owner": "lf-", - "repo": "flakey-profile", - "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", - "type": "github" - }, - "original": { - "owner": "lf-", - "repo": "flakey-profile", - "type": "github" - } - }, "fromYaml": { "flake": false, "locked": { @@ -547,48 +514,13 @@ "url": "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in" } }, - "lix": { - "flake": false, - "locked": { - "lastModified": 1746827285, - "narHash": "sha256-hsFe4Tsqqg4l+FfQWphDtjC79WzNCZbEFhHI8j2KJzw=", - "rev": "47aad376c87e2e65967f17099277428e4b3f8e5a", - "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/47aad376c87e2e65967f17099277428e4b3f8e5a.tar.gz?rev=47aad376c87e2e65967f17099277428e4b3f8e5a" - }, - "original": { - "type": "tarball", - "url": "https://git.lix.systems/lix-project/lix/archive/2.93.0.tar.gz" - } - }, - "lix-module": { - "inputs": { - "flake-utils": "flake-utils", - "flakey-profile": "flakey-profile", - "lix": "lix", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1746838955, - "narHash": "sha256-11R4K3iAx4tLXjUs+hQ5K90JwDABD/XHhsM9nkeS5N8=", - "rev": "cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc", - "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz" - } - }, "mnw": { "locked": { - "lastModified": 1747499976, - "narHash": "sha256-YTiSI4WLbk0CleXeBheYmKZV6iqKyBpyoh1e+vcQzu4=", + "lastModified": 1748278309, + "narHash": "sha256-JCeiMrUhFku44kfKsgiD9Ibzho4MblBD2WmOQYsQyTY=", "owner": "Gerg-L", "repo": "mnw", - "rev": "72433a144c4ac16931e9148f78db4a0e4c147441", + "rev": "486a17ba1279ab2357cae8ff66b309db622f8831", "type": "github" }, "original": { @@ -599,7 +531,7 @@ }, "moonlight": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" ] @@ -686,7 +618,7 @@ }, "nix-options-search": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_2", "gitignore": "gitignore", "nixpkgs": "nixpkgs" }, @@ -850,20 +782,20 @@ "nvf": { "inputs": { "flake-parts": "flake-parts", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_3", "mnw": "mnw", "nil": "nil", "nixpkgs": [ "nixpkgs" ], - "systems": "systems_5" + "systems": "systems_4" }, "locked": { - "lastModified": 1747525582, - "narHash": "sha256-oEZ6DV4bPcNZIuwW5Kcd+/zT3PMkXse2kX/3jHoomGk=", + "lastModified": 1748318168, + "narHash": "sha256-pUDVxHarStrDYxd2tztz4SjNflzFxuMMEC3SK9WLUK8=", "owner": "notashelf", "repo": "nvf", - "rev": "d3a0e7029ac57eef1120225973247851c5b967b5", + "rev": "74ba4d955976af1422ea1f095968e547db70aa04", "type": "github" }, "original": { @@ -889,7 +821,6 @@ "apple-fonts": "apple-fonts", "darwin": "darwin", "home-manager": "home-manager", - "lix-module": "lix-module", "moonlight": "moonlight", "nh": "nh", "nix-index-database": "nix-index-database", @@ -1066,7 +997,7 @@ "nixpkgs" ], "nur": "nur", - "systems": "systems_6", + "systems": "systems_5", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -1207,21 +1138,6 @@ "type": "github" } }, - "systems_9": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tinted-foot": { "flake": false, "locked": { @@ -1328,7 +1244,7 @@ "zig": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_4", "nixpkgs": "nixpkgs_3" }, "locked": { @@ -1348,7 +1264,7 @@ "zig-overlay": { "inputs": { "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_7", + "flake-utils": "flake-utils_6", "nixpkgs": [ "zls", "nixpkgs" @@ -1370,7 +1286,7 @@ }, "zls": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_5", "gitignore": "gitignore_3", "langref": "langref", "nixpkgs": "nixpkgs_4", diff --git a/flake.nix b/flake.nix index 7e5975a..2cab174 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,10 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; - lix-module = { - url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + # lix-module = { + # url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; + # inputs.nixpkgs.follows = "nixpkgs"; + # }; home-manager.url = "github:nix-community/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; @@ -47,7 +47,7 @@ { self, nixpkgs, - lix-module, + # lix-module, nixos-cosmic, darwin, ... @@ -97,7 +97,7 @@ inherit overlays nixpkgs - lix-module + # lix-module inputs mkNeovim ; diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index ab0ef67..2849527 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -2,7 +2,7 @@ # particular architecture. { nixpkgs, - lix-module, + # lix-module, overlays, inputs, mkNeovim, @@ -89,7 +89,7 @@ systemFunc { # Use lix (alternative nix implementation) # https://lix.systems/add-to-config/#flake-based-configurations - lix-module.nixosModules.default + # lix-module.nixosModules.default # (getInputModule "lix-module" "default") # Modules shared between nix-darwin and NixOS diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 355a395..9ae17b0 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -3,7 +3,8 @@ lib, host, ... -}: { +}: +{ # based on default options from upstream: # https://github.com/NotAShelf/nvf/blob/main/configuration.nix # @@ -108,7 +109,7 @@ explorer.replace_netrw = true; dashboard = { sections = [ - {section = "header";} + { section = "header"; } { icon = " "; title = "Keymaps"; @@ -132,12 +133,15 @@ } ]; }; - image.enable = true; + image = { + enable = true; + math.enabled = false; + }; notifier.timeout = 3000; picker = { enable = true; sources = { - explorer = {}; + explorer = { }; }; }; }; diff --git a/users/natalie/laptop/home.nix b/users/natalie/laptop/home.nix index 4c981e9..698a10d 100644 --- a/users/natalie/laptop/home.nix +++ b/users/natalie/laptop/home.nix @@ -15,5 +15,10 @@ sessionPath = [ "$HOME/.emacs.d/bin" ]; + + packages = with pkgs; [ + #PDF viewer for VimTeX + skimpdf + ]; }; } diff --git a/users/natalie/packages.nix b/users/natalie/packages.nix index 7195aa8..c555a66 100644 --- a/users/natalie/packages.nix +++ b/users/natalie/packages.nix @@ -1,6 +1,7 @@ # Packages installed with home-manager -{pkgs, ...}: -with pkgs; [ +{ pkgs, ... }: +with pkgs; +[ #general development just pkg-config @@ -35,7 +36,7 @@ with pkgs; [ nh #terminal stuff - (btop.override {cudaSupport = true;}) + (btop.override { cudaSupport = true; }) tmux zellij lazygit @@ -62,15 +63,9 @@ with pkgs; [ #media spotify - zathura #language servers typst-live - lua-language-server - nil - nixd - texlab - texlivePackages.chktex #formatters/linters stylua @@ -79,14 +74,10 @@ with pkgs; [ #neovim deps # TODO: from clo, maybe u can remove all of these? i don't wanna break tho - lua51Packages.lua - lua51Packages.luarocks-nix - codespell tree-sitter - + zathura #python pyright - basedpyright ruff python312Packages.python python312Packages.pynvim @@ -107,7 +98,6 @@ with pkgs; [ #math texlive.combined.scheme-full - zathura #fun things cowsay diff --git a/users/natalie/user.nix b/users/natalie/user.nix index 9c90a82..3eeea53 100644 --- a/users/natalie/user.nix +++ b/users/natalie/user.nix @@ -3,7 +3,7 @@ rec { name = "Natalie"; # name/identifier email = "nmarks413@gmail.com"; # email (used for certain configurations) dotfilesDir = "~/.dotfiles"; # absolute path of the local repo - theme = "catppuccin-mocha"; # name of theme that stylix will use + theme = null; # name of theme that stylix will use browser = "firefox"; # Default browser; must select one from ./user/app/browser/ term = "ghostty"; # Default terminal command; font = "iosevka"; # Selected font diff --git a/users/natalie/vim.nix b/users/natalie/vim.nix index 563c715..c1427ee 100644 --- a/users/natalie/vim.nix +++ b/users/natalie/vim.nix @@ -39,12 +39,24 @@ tabline = { nvimBufferline.enable = true; }; - + # nvf versions is VERY outdated + # pluginOverrides = { + # hardtime-nvim = pkgs.fetchFromGitHub { + # owner = "m4xshen"; + # repo = "hardtime.nvim"; + # rev = "v1.0.1"; + # hash = "sha256-5tqiSuGvBJcr8l6anEBojXEaaxFS1P5T1ROr46ylVhk="; + # }; + # }; + startPlugins = [ + "nui-nvim" + ]; binds = { hardtime-nvim = { enable = true; setupOpts = { - restriction_mode = "block"; + disable_mouse = false; + restriction_mode = "warn"; }; }; }; diff --git a/users/natalie/vim/languages.nix b/users/natalie/vim/languages.nix index f35d571..077a138 100644 --- a/users/natalie/vim/languages.nix +++ b/users/natalie/vim/languages.nix @@ -110,6 +110,12 @@ in tex = [ "chktex" ]; haskell = [ "hlint" ]; }; + + linters = { + chktex = { + ignore_exitcode = true; + }; + }; }; }; treesitter = { diff --git a/users/natalie/vim/latex.nix b/users/natalie/vim/latex.nix index b38cace..b58c340 100644 --- a/users/natalie/vim/latex.nix +++ b/users/natalie/vim/latex.nix @@ -1,22 +1,29 @@ -{pkgs, ...}: { +{ pkgs, host, ... }: +{ vim = { + lazy.plugins.cmp-vimtex = { + enabled = true; + package = pkgs.vimPlugins.cmp-vimtex; + lazy = false; + + }; lazy.plugins.vimtex = { enabled = true; package = pkgs.vimPlugins.vimtex; - lazy = true; - ft = "tex"; + lazy = false; }; globals = { tex_flavor = "latex"; maplocalleader = "\\"; vimtex_compiler_method = "latexmk"; - vimtex_view_method = "zathura"; + vimtex_view_method = if host.darwin then "skim" else "zathura"; + vimtex_view_automatic = 1; vimtex_compiler_latexmk = { callback = 1; continuous = 1; executable = "latexmk"; - hooks = []; + hooks = [ ]; options = [ "-verbose" "-file-line-error" @@ -37,12 +44,65 @@ ]; }; + autocomplete.blink-cmp = { + sourcePlugins = { + "blink.compat" = { + enable = true; + package = "blink-compat"; + module = "blink.compat.source"; + }; + }; + setupOpts = { + sources = { + default = [ "vimtex" ]; + providers = { + vimtex = { + name = "vimtex"; + module = "blink.compat.source"; + score_offset = 100; + }; + }; + }; + }; + }; + + augroups = [ + { + name = "VimTeX Events"; + } + ]; + autocmds = [ + { + pattern = [ "VimtexEventViewReverse" ]; + event = [ "User" ]; + desc = "Return to nvim after reverse search"; + command = "call b:vimtex.viewer.xdo_focus_vim()"; + group = "VimTeX Events"; + } + { + pattern = [ "VimtexEventQuit" ]; + event = [ "User" ]; + desc = "Close pdf after exiting nvim"; + command = "VimtexClean"; + group = "VimTeX Events"; + } + + { + pattern = [ "VimtexEventInitPost" ]; + event = [ "User" ]; + desc = "Start compiling when opening nvim to a tex file"; + command = "VimtexCompile"; + group = "VimTeX Events"; + } + + ]; + lsp = { servers = { texlab = { enable = true; - cmd = ["${pkgs.texlab}/bin/texlab"]; - filetypes = ["tex"]; + cmd = [ "${pkgs.texlab}/bin/texlab" ]; + filetypes = [ "tex" ]; }; }; }; From b9e231d72f6a18b719440657b0048dcd9699c442 Mon Sep 17 00:00:00 2001 From: Natalie Date: Tue, 27 May 2025 22:30:34 -0700 Subject: [PATCH 06/12] remove stylix, add lix --- flake.lock | 487 ++++-------------------- flake.nix | 15 +- lib/mkSystem.nix | 7 +- modules/shared/user-system-settings.nix | 23 -- 4 files changed, 92 insertions(+), 440 deletions(-) diff --git a/flake.lock b/flake.lock index 26d8ffe..fc8a286 100644 --- a/flake.lock +++ b/flake.lock @@ -28,73 +28,6 @@ "type": "github" } }, - "base16": { - "inputs": { - "fromYaml": "fromYaml" - }, - "locked": { - "lastModified": 1746562888, - "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=", - "owner": "SenchoPens", - "repo": "base16.nix", - "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "base16.nix", - "type": "github" - } - }, - "base16-fish": { - "flake": false, - "locked": { - "lastModified": 1622559957, - "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", - "owner": "tomyun", - "repo": "base16-fish", - "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", - "type": "github" - }, - "original": { - "owner": "tomyun", - "repo": "base16-fish", - "type": "github" - } - }, - "base16-helix": { - "flake": false, - "locked": { - "lastModified": 1736852337, - "narHash": "sha256-esD42YdgLlEh7koBrSqcT7p2fsMctPAcGl/+2sYJa2o=", - "owner": "tinted-theming", - "repo": "base16-helix", - "rev": "03860521c40b0b9c04818f2218d9cc9efc21e7a5", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-helix", - "type": "github" - } - }, - "base16-vim": { - "flake": false, - "locked": { - "lastModified": 1732806396, - "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", - "owner": "tinted-theming", - "repo": "base16-vim", - "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-vim", - "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", - "type": "github" - } - }, "darwin": { "inputs": { "nixpkgs": [ @@ -116,22 +49,6 @@ "type": "github" } }, - "firefox-gnome-theme": { - "flake": false, - "locked": { - "lastModified": 1744642301, - "narHash": "sha256-5A6LL7T0lttn1vrKsNOKUk9V0ittdW0VEqh6AtefxJ4=", - "owner": "rafaelmardojai", - "repo": "firefox-gnome-theme", - "rev": "59e3de00f01e5adb851d824cf7911bd90c31083a", - "type": "github" - }, - "original": { - "owner": "rafaelmardojai", - "repo": "firefox-gnome-theme", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -149,21 +66,6 @@ } }, "flake-compat_2": { - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { "flake": false, "locked": { "lastModified": 1696426674, @@ -179,7 +81,7 @@ "type": "github" } }, - "flake-compat_4": { + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1696426674, @@ -213,37 +115,16 @@ "type": "github" } }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": [ - "stylix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -257,11 +138,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -289,6 +170,24 @@ } }, "flake-utils_4": { + "inputs": { + "systems": "systems_4" + }, + "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" + } + }, + "flake-utils_5": { "inputs": { "systems": "systems_6" }, @@ -306,7 +205,7 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_6": { "inputs": { "systems": "systems_7" }, @@ -324,7 +223,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_7": { "inputs": { "systems": "systems_8" }, @@ -342,45 +241,18 @@ "type": "github" } }, - "fromYaml": { - "flake": false, + "flakey-profile": { "locked": { - "lastModified": 1731966426, - "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", - "owner": "SenchoPens", - "repo": "fromYaml", - "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", "type": "github" }, "original": { - "owner": "SenchoPens", - "repo": "fromYaml", - "type": "github" - } - }, - "git-hooks": { - "inputs": { - "flake-compat": [ - "stylix", - "flake-compat" - ], - "gitignore": "gitignore_2", - "nixpkgs": [ - "stylix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1742649964, - "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", + "owner": "lf-", + "repo": "flakey-profile", "type": "github" } }, @@ -401,28 +273,6 @@ } }, "gitignore_2": { - "inputs": { - "nixpkgs": [ - "stylix", - "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" - } - }, - "gitignore_3": { "inputs": { "nixpkgs": [ "zls", @@ -443,23 +293,6 @@ "type": "github" } }, - "gnome-shell": { - "flake": false, - "locked": { - "lastModified": 1744584021, - "narHash": "sha256-0RJ4mJzf+klKF4Fuoc8VN8dpQQtZnKksFmR2jhWE1Ew=", - "owner": "GNOME", - "repo": "gnome-shell", - "rev": "52c517c8f6c199a1d6f5118fae500ef69ea845ae", - "type": "github" - }, - "original": { - "owner": "GNOME", - "ref": "48.1", - "repo": "gnome-shell", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -481,27 +314,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "stylix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1747763032, - "narHash": "sha256-9j3oCbemeH7bTVXJ3pDWxOptbxDx2SdK1jY2AHpjQiw=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "29dda415f5b2178278283856c6f9f7b48a2a4353", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "langref": { "flake": false, "locked": { @@ -514,6 +326,41 @@ "url": "https://raw.githubusercontent.com/ziglang/zig/0fb2015fd3422fc1df364995f9782dfe7255eccd/doc/langref.html.in" } }, + "lix": { + "flake": false, + "locked": { + "lastModified": 1746827285, + "narHash": "sha256-hsFe4Tsqqg4l+FfQWphDtjC79WzNCZbEFhHI8j2KJzw=", + "rev": "47aad376c87e2e65967f17099277428e4b3f8e5a", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/47aad376c87e2e65967f17099277428e4b3f8e5a.tar.gz?rev=47aad376c87e2e65967f17099277428e4b3f8e5a" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/lix/archive/2.93.0.tar.gz" + } + }, + "lix-module": { + "inputs": { + "flake-utils": "flake-utils", + "flakey-profile": "flakey-profile", + "lix": "lix", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746838955, + "narHash": "sha256-11R4K3iAx4tLXjUs+hQ5K90JwDABD/XHhsM9nkeS5N8=", + "rev": "cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz" + } + }, "mnw": { "locked": { "lastModified": 1748278309, @@ -531,7 +378,7 @@ }, "moonlight": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ] @@ -557,11 +404,11 @@ ] }, "locked": { - "lastModified": 1747847914, - "narHash": "sha256-Ut9RZVAaKUD4A3RrXP5RhNVZ+LVy5mL4mMmiTDWaQE8=", + "lastModified": 1748096601, + "narHash": "sha256-ji/9z1pRbosyKVVAIGBazyz6PjWV8bc2Ux2RdQrVDWY=", "owner": "viperML", "repo": "nh", - "rev": "45048d3e9f183f3f09fddf667841b7327c04ad8f", + "rev": "1ea27e73a3dcbc9950258e9054377ee677d12b9e", "type": "github" }, "original": { @@ -618,7 +465,7 @@ }, "nix-options-search": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "gitignore": "gitignore", "nixpkgs": "nixpkgs" }, @@ -753,42 +600,16 @@ "type": "github" } }, - "nur": { - "inputs": { - "flake-parts": [ - "stylix", - "flake-parts" - ], - "nixpkgs": [ - "stylix", - "nixpkgs" - ], - "treefmt-nix": "treefmt-nix" - }, - "locked": { - "lastModified": 1746056780, - "narHash": "sha256-/emueQGaoT4vu0QjU9LDOG5roxRSfdY0K2KkxuzazcM=", - "owner": "nix-community", - "repo": "NUR", - "rev": "d476cd0972dd6242d76374fcc277e6735715c167", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "NUR", - "type": "github" - } - }, "nvf": { "inputs": { "flake-parts": "flake-parts", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "mnw": "mnw", "nil": "nil", "nixpkgs": [ "nixpkgs" ], - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1748318168, @@ -821,6 +642,7 @@ "apple-fonts": "apple-fonts", "darwin": "darwin", "home-manager": "home-manager", + "lix-module": "lix-module", "moonlight": "moonlight", "nh": "nh", "nix-index-database": "nix-index-database", @@ -829,7 +651,6 @@ "nixpkgs": "nixpkgs_2", "nvf": "nvf", "rust-overlay": "rust-overlay_3", - "stylix": "stylix", "zig": "zig", "zls": "zls" } @@ -981,43 +802,6 @@ "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" } }, - "stylix": { - "inputs": { - "base16": "base16", - "base16-fish": "base16-fish", - "base16-helix": "base16-helix", - "base16-vim": "base16-vim", - "firefox-gnome-theme": "firefox-gnome-theme", - "flake-compat": "flake-compat_2", - "flake-parts": "flake-parts_2", - "git-hooks": "git-hooks", - "gnome-shell": "gnome-shell", - "home-manager": "home-manager_2", - "nixpkgs": [ - "nixpkgs" - ], - "nur": "nur", - "systems": "systems_5", - "tinted-foot": "tinted-foot", - "tinted-kitty": "tinted-kitty", - "tinted-schemes": "tinted-schemes", - "tinted-tmux": "tinted-tmux", - "tinted-zed": "tinted-zed" - }, - "locked": { - "lastModified": 1747847674, - "narHash": "sha256-XYVaUKQrda7WOSonewDtpvm8tENIcwWrErobUYMTMoc=", - "owner": "danth", - "repo": "stylix", - "rev": "4ce349da56e075f7e3456b48731cbbf5ae8b1eb8", - "type": "github" - }, - "original": { - "owner": "danth", - "repo": "stylix", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -1138,113 +922,10 @@ "type": "github" } }, - "tinted-foot": { - "flake": false, - "locked": { - "lastModified": 1726913040, - "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", - "owner": "tinted-theming", - "repo": "tinted-foot", - "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "tinted-foot", - "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", - "type": "github" - } - }, - "tinted-kitty": { - "flake": false, - "locked": { - "lastModified": 1735730497, - "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", - "owner": "tinted-theming", - "repo": "tinted-kitty", - "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "tinted-kitty", - "type": "github" - } - }, - "tinted-schemes": { - "flake": false, - "locked": { - "lastModified": 1744974599, - "narHash": "sha256-Fg+rdGs5FAgfkYNCs74lnl8vkQmiZVdBsziyPhVqrlY=", - "owner": "tinted-theming", - "repo": "schemes", - "rev": "28c26a621123ad4ebd5bbfb34ab39421c0144bdd", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "schemes", - "type": "github" - } - }, - "tinted-tmux": { - "flake": false, - "locked": { - "lastModified": 1745111349, - "narHash": "sha256-udV+nHdpqgkJI9D0mtvvAzbqubt9jdifS/KhTTbJ45w=", - "owner": "tinted-theming", - "repo": "tinted-tmux", - "rev": "e009f18a01182b63559fb28f1c786eb027c3dee9", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "tinted-tmux", - "type": "github" - } - }, - "tinted-zed": { - "flake": false, - "locked": { - "lastModified": 1725758778, - "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=", - "owner": "tinted-theming", - "repo": "base16-zed", - "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-zed", - "type": "github" - } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "stylix", - "nur", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733222881, - "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "49717b5af6f80172275d47a418c9719a31a78b53", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, "zig": { "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_5", "nixpkgs": "nixpkgs_3" }, "locked": { @@ -1263,8 +944,8 @@ }, "zig-overlay": { "inputs": { - "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_6", + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_7", "nixpkgs": [ "zls", "nixpkgs" @@ -1286,8 +967,8 @@ }, "zls": { "inputs": { - "flake-utils": "flake-utils_5", - "gitignore": "gitignore_3", + "flake-utils": "flake-utils_6", + "gitignore": "gitignore_2", "langref": "langref", "nixpkgs": "nixpkgs_4", "zig-overlay": "zig-overlay" diff --git a/flake.nix b/flake.nix index 2cab174..b1d8603 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,10 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; - # lix-module = { - # url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; - # inputs.nixpkgs.follows = "nixpkgs"; - # }; + lix-module = { + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager.url = "github:nix-community/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; @@ -26,9 +26,6 @@ zig.url = "github:mitchellh/zig-overlay"; zls.url = "github:zigtools/zls?rev=a26718049a8657d4da04c331aeced1697bc7652b"; - stylix.url = "github:danth/stylix"; - stylix.inputs.nixpkgs.follows = "nixpkgs"; - moonlight.url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly. moonlight.inputs.nixpkgs.follows = "nixpkgs"; @@ -47,7 +44,7 @@ { self, nixpkgs, - # lix-module, + lix-module, nixos-cosmic, darwin, ... @@ -97,7 +94,7 @@ inherit overlays nixpkgs - # lix-module + lix-module inputs mkNeovim ; diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index 2849527..2ca2a4f 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -2,7 +2,7 @@ # particular architecture. { nixpkgs, - # lix-module, + lix-module, overlays, inputs, mkNeovim, @@ -89,7 +89,7 @@ systemFunc { # Use lix (alternative nix implementation) # https://lix.systems/add-to-config/#flake-based-configurations - # lix-module.nixosModules.default + lix-module.nixosModules.default # (getInputModule "lix-module" "default") # Modules shared between nix-darwin and NixOS @@ -107,9 +107,6 @@ systemFunc { (getInputModule "nix-index-database" "nix-index") { programs.nix-index-database.comma.enable = true; } - # Themes for all programs - (getInputModule "stylix" "stylix") - # Home manager (getInputModule "home-manager" "home-manager") { diff --git a/modules/shared/user-system-settings.nix b/modules/shared/user-system-settings.nix index 842f046..bbd03c9 100644 --- a/modules/shared/user-system-settings.nix +++ b/modules/shared/user-system-settings.nix @@ -19,27 +19,4 @@ BROWSER = user.browser; }; - stylix = lib.mkIf (user ? "theme" && user.theme != null) { - enable = false; - base16Scheme = "${pkgs.base16-schemes}/share/themes/${user.theme}.yaml"; - - fonts = lib.optionalAttrs (user ? "font") { - serif = { - package = pkgs.nerd-fonts.${user.font}; - name = "${user.font} Nerd Font"; - }; - sansSerif = { - package = pkgs.nerd-fonts.${user.font}; - name = "${user.font} Nerd Font"; - }; - monospace = { - package = pkgs.nerd-fonts.${user.font}; - name = "${user.font} Nerd Font"; - }; - emoji = { - package = pkgs.twemoji-color-font; - name = "Twemoji Color"; - }; - }; - }; } From 800f63b000bebf518dad1b6e6e85e99640e95ec6 Mon Sep 17 00:00:00 2001 From: Natalie Marks Date: Wed, 28 May 2025 08:31:42 -0700 Subject: [PATCH 07/12] made config work on nixos --- flake.lock | 89 +-- flake.nix | 222 +++--- modules/home/default.nix | 16 +- modules/home/macos/sketchybar.nix | 936 ++++++++++++------------ modules/nixos/services.nix | 8 +- modules/shared/nix.nix | 2 - users/natalie/desktop/configuration.nix | 22 +- 7 files changed, 605 insertions(+), 690 deletions(-) diff --git a/flake.lock b/flake.lock index fc8a286..0f4e29a 100644 --- a/flake.lock +++ b/flake.lock @@ -50,22 +50,6 @@ } }, "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1746162366, - "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=", - "owner": "nix-community", - "repo": "flake-compat", - "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -81,7 +65,7 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -427,7 +411,7 @@ "nvf", "nixpkgs" ], - "rust-overlay": "rust-overlay_2" + "rust-overlay": "rust-overlay" }, "locked": { "lastModified": 1741118843, @@ -483,29 +467,6 @@ "type": "github" } }, - "nixos-cosmic": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable", - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1747826251, - "narHash": "sha256-Fe4AXmnnAKnh/wIe1ao4Pv/8m6WGA1ujwp6VApgos30=", - "owner": "lilyinstarlight", - "repo": "nixos-cosmic", - "rev": "9a67b4a289cd8994080398d40b57cfde8e8cfb0a", - "type": "github" - }, - "original": { - "owner": "lilyinstarlight", - "repo": "nixos-cosmic", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1736012469, @@ -537,22 +498,6 @@ "type": "github" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1747676747, - "narHash": "sha256-LXkWBVqilgx7Pohwqu/ABxDVw+Cmi5/Mj2S2mpUH0Fw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "72841a4a8761d1aed92ef6169a636872c986c76d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1747744144, @@ -647,36 +592,14 @@ "nh": "nh", "nix-index-database": "nix-index-database", "nix-options-search": "nix-options-search", - "nixos-cosmic": "nixos-cosmic", "nixpkgs": "nixpkgs_2", "nvf": "nvf", - "rust-overlay": "rust-overlay_3", + "rust-overlay": "rust-overlay_2", "zig": "zig", "zls": "zls" } }, "rust-overlay": { - "inputs": { - "nixpkgs": [ - "nixos-cosmic", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1747795013, - "narHash": "sha256-c7i0xJ+xFhgjO9SWHYu5dF/7lq63RPDvwKAdjc6VCE4=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "6b1cf12374361859242a562e1933a7930649131a", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_2": { "inputs": { "nixpkgs": [ "nvf", @@ -698,7 +621,7 @@ "type": "github" } }, - "rust-overlay_3": { + "rust-overlay_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -924,7 +847,7 @@ }, "zig": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat", "flake-utils": "flake-utils_5", "nixpkgs": "nixpkgs_3" }, @@ -944,7 +867,7 @@ }, "zig-overlay": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_2", "flake-utils": "flake-utils_7", "nixpkgs": [ "zls", diff --git a/flake.nix b/flake.nix index b1d8603..c07de41 100644 --- a/flake.nix +++ b/flake.nix @@ -29,9 +29,6 @@ moonlight.url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly. moonlight.inputs.nixpkgs.follows = "nixpkgs"; - nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic"; - nixos-cosmic.inputs.nixpkgs.follows = "nixpkgs"; - nh.url = "github:viperML/nh"; nh.inputs.nixpkgs.follows = "nixpkgs"; @@ -40,80 +37,76 @@ nix-index-database.url = "github:nix-community/nix-index-database"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = - { - self, - nixpkgs, - lix-module, - nixos-cosmic, - darwin, - ... - }@inputs: - let - lib = nixpkgs.lib; - # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere. - overlays = [ - inputs.zig.overlays.default - inputs.rust-overlay.overlays.default - inputs.nh.overlays.default + outputs = { + self, + nixpkgs, + lix-module, + darwin, + ... + } @ inputs: let + lib = nixpkgs.lib; + # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere. + overlays = [ + inputs.zig.overlays.default + inputs.rust-overlay.overlays.default + inputs.nh.overlays.default - # https://github.com/LnL7/nix-darwin/issues/1041 - (_: prev: { - karabiner-elements = prev.karabiner-elements.overrideAttrs (old: { - version = "14.13.0"; + # https://github.com/LnL7/nix-darwin/issues/1041 + (_: prev: { + karabiner-elements = prev.karabiner-elements.overrideAttrs (old: { + version = "14.13.0"; - src = prev.fetchurl { - inherit (old.src) url; - hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw="; - }; - }); + src = prev.fetchurl { + inherit (old.src) url; + hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw="; + }; + }); + }) + ]; + + # Users of this flake currently use x86_64 Linux and Apple Silicon + systems = [ + "x86_64-linux" + "aarch64-darwin" + ]; + forAllSystems = f: + builtins.listToAttrs ( + builtins.map (system: { + name = system; + value = f ( + inputs + // { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + } + ); }) - ]; + systems + ); - # Users of this flake currently use x86_64 Linux and Apple Silicon - systems = [ - "x86_64-linux" - "aarch64-darwin" - ]; - forAllSystems = - f: - builtins.listToAttrs ( - builtins.map (system: { - name = system; - value = f ( - inputs - // { - inherit system; - pkgs = nixpkgs.legacyPackages.${system}; - } - ); - }) systems - ); - - mkSystem = import ./lib/mkSystem.nix { - inherit - overlays - nixpkgs - lix-module - inputs - mkNeovim - ; - }; - mkNeovim = import ./lib/mkNeovim.nix { - inherit - self - overlays - nixpkgs - inputs - ; - }; - in - rec { - inherit self; - # "nix fmt" - formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree); - packages = forAllSystems ( - { system, ... }: + mkSystem = import ./lib/mkSystem.nix { + inherit + overlays + nixpkgs + lix-module + inputs + mkNeovim + ; + }; + mkNeovim = import ./lib/mkNeovim.nix { + inherit + self + overlays + nixpkgs + inputs + ; + }; + in rec { + inherit self; + # "nix fmt" + formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree); + packages = forAllSystems ( + {system, ...}: { nvim-chloe = mkNeovim "chloe" system; nvim-natalie = mkNeovim "natalie" system; @@ -122,49 +115,46 @@ # "nix run .#darwin-rebuild" darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild; } - ); + ); - # natalie's desktop computer - nixosConfigurations.nixos = mkSystem "nixos" { - user = "natalie"; - host = "desktop"; - system = "x86_64-linux"; - extraModules = [ - nixos-cosmic.nixosModules.default - ]; - }; - # natalie's laptop - darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" { - user = "natalie"; - host = "laptop"; - system = "aarch64-darwin"; - }; - - # chloe's mac studio "sandwich" - darwinConfigurations.sandwich = mkSystem "sandwich" { - user = "chloe"; - host = "sandwich"; - system = "aarch64-darwin"; - }; - # chloe's macbook air "paperback" - darwinConfigurations.paperback = mkSystem "paperback" { - user = "chloe"; - host = "paperback"; - system = "aarch64-darwin"; - }; - - # generate checks for "nix flake check --all-systems --no-build" - checks.aarch64-darwin = builtins.listToAttrs ( - builtins.map ( - name: - let - d = darwinConfigurations.${name}.system; - in - { - name = "darwinConfiguration-" + d.name; - value = d; - } - ) (builtins.attrNames darwinConfigurations) - ); + # natalie's desktop computer + nixosConfigurations.nixos = mkSystem "nixos" { + user = "natalie"; + host = "desktop"; + system = "x86_64-linux"; + extraModules = [ + ]; }; + # natalie's laptop + darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" { + user = "natalie"; + host = "laptop"; + system = "aarch64-darwin"; + }; + + # chloe's mac studio "sandwich" + darwinConfigurations.sandwich = mkSystem "sandwich" { + user = "chloe"; + host = "sandwich"; + system = "aarch64-darwin"; + }; + # chloe's macbook air "paperback" + darwinConfigurations.paperback = mkSystem "paperback" { + user = "chloe"; + host = "paperback"; + system = "aarch64-darwin"; + }; + + # generate checks for "nix flake check --all-systems --no-build" + checks.aarch64-darwin = builtins.listToAttrs ( + builtins.map ( + name: let + d = darwinConfigurations.${name}.system; + in { + name = "darwinConfiguration-" + d.name; + value = d; + } + ) (builtins.attrNames darwinConfigurations) + ); + }; } diff --git a/modules/home/default.nix b/modules/home/default.nix index 98635b4..addf68f 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -8,14 +8,14 @@ host, mainHomeImports, ... -}: -let +}: let cfg = config.programs; -in -{ - imports = mainHomeImports ++ [ - ./macos/sketchybar.nix - ]; +in { + imports = + mainHomeImports + ++ [ + ./macos/sketchybar.nix + ]; programs = { home-manager.enable = true; nix-index.enable = true; @@ -80,7 +80,7 @@ in } ]; shellAliases = - { } + {} // lib.optionalAttrs (!host.darwin) { reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now"; }; diff --git a/modules/home/macos/sketchybar.nix b/modules/home/macos/sketchybar.nix index e80cbab..38695d3 100644 --- a/modules/home/macos/sketchybar.nix +++ b/modules/home/macos/sketchybar.nix @@ -2,534 +2,538 @@ pkgs, lib, config, + host, ... }: { home.file = - lib.attrsets.mapAttrs (file: value: ( - lib.attrsets.overrideExisting value {enable = config.shared.darwin.tiling.enable;} - )) { - sketchybarrc = { - executable = true; - target = ".config/sketchybar/sketchybarrc"; - text = '' - #!/usr/bin/env sh + {} + // lib.optionalAttrs host.darwin ( + lib.attrsets.mapAttrs (file: value: ( + lib.attrsets.overrideExisting value {enable = config.shared.darwin.tiling.enable;} + )) { + sketchybarrc = { + executable = true; + target = ".config/sketchybar/sketchybarrc"; + text = '' + #!/usr/bin/env sh - source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors + source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors - ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured - PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored + ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured + PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored - FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants - PADDINGS=3 # All paddings use this value (icon, label, background) + FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants + PADDINGS=3 # All paddings use this value (icon, label, background) - # Setting up the general bar appearance and default values - ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \ - blur_radius=30 \ - position=top \ - sticky=on \ - padding_left=10 \ - padding_right=10 + # Setting up the general bar appearance and default values + ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \ + blur_radius=30 \ + position=top \ + sticky=on \ + padding_left=10 \ + padding_right=10 - ${pkgs.sketchybar}/bin/sketchybar --default icon.font="SF Pro:Semibold:12.0" \ - icon.color=$ITEM_COLOR \ - label.font="SF Pro:Semibold:12.0" \ - label.color=$ITEM_COLOR \ - background.color=$ACCENT_COLOR \ - background.corner_radius=10 \ - background.height=20 \ - padding_left=4 \ - padding_right=4 \ - icon.padding_left=6 \ - icon.padding_right=3 \ - label.padding_left=3 \ - label.padding_right=6 + ${pkgs.sketchybar}/bin/sketchybar --default icon.font="SF Pro:Semibold:12.0" \ + icon.color=$ITEM_COLOR \ + label.font="SF Pro:Semibold:12.0" \ + label.color=$ITEM_COLOR \ + background.color=$ACCENT_COLOR \ + background.corner_radius=10 \ + background.height=20 \ + padding_left=4 \ + padding_right=4 \ + icon.padding_left=6 \ + icon.padding_right=3 \ + label.padding_left=3 \ + label.padding_right=6 - # Left - # source "$ITEM_DIR/apple.sh" - source "$ITEM_DIR/spaces.sh" - source "$ITEM_DIR/front_app.sh" + # Left + # source "$ITEM_DIR/apple.sh" + source "$ITEM_DIR/spaces.sh" + source "$ITEM_DIR/front_app.sh" - # Center - # source "$ITEM_DIR/spotify.sh" - source "$ITEM_DIR/calendar.sh" + # Center + # source "$ITEM_DIR/spotify.sh" + source "$ITEM_DIR/calendar.sh" - # Right - source $ITEM_DIR/calendar.sh - source $ITEM_DIR/wifi.sh - source $ITEM_DIR/battery.sh - source $ITEM_DIR/volume.sh + # Right + source $ITEM_DIR/calendar.sh + source $ITEM_DIR/wifi.sh + source $ITEM_DIR/battery.sh + source $ITEM_DIR/volume.sh - # Forcing all item scripts to run (never do this outside of sketchybarrc) - ${pkgs.sketchybar}/bin/sketchybar --update + # Forcing all item scripts to run (never do this outside of sketchybarrc) + ${pkgs.sketchybar}/bin/sketchybar --update - echo "sketchybar configuation loaded.." - ''; - }; - icons = { - executable = true; - target = ".config/sketchybar/plugins/icons.sh"; - text = '' - #!/usr/bin/env sh + echo "sketchybar configuation loaded.." + ''; + }; + icons = { + executable = true; + target = ".config/sketchybar/plugins/icons.sh"; + text = '' + #!/usr/bin/env sh - # Source the icon map with all the application icons - source ${pkgs.sketchybar-app-font}/bin/icon_map.sh + # Source the icon map with all the application icons + source ${pkgs.sketchybar-app-font}/bin/icon_map.sh - # Create a cache directory if it doesn't exist - CACHE_DIR="$HOME/.cache/sketchybar" - mkdir -p "$CACHE_DIR" + # Create a cache directory if it doesn't exist + CACHE_DIR="$HOME/.cache/sketchybar" + mkdir -p "$CACHE_DIR" - # Cache file for icon mappings - ICON_CACHE="$CACHE_DIR/icon_cache.txt" + # Cache file for icon mappings + ICON_CACHE="$CACHE_DIR/icon_cache.txt" - # Create the cache file if it doesn't exist - if [ ! -f "$ICON_CACHE" ]; then - touch "$ICON_CACHE" - fi - - # Check if the app is already in cache - APP_NAME=$(if [ "$1" = "Zen" ]; then echo "Zen Browser"; else echo "$1"; fi) - - CACHED_ICON=$(grep "^$APP_NAME|" "$ICON_CACHE" | cut -d '|' -f2) - - if [ -n "$CACHED_ICON" ]; then - # Cache hit, return the icon - echo "$CACHED_ICON" - exit 0 - fi - - # Get icon from the mapping function - __icon_map "$APP_NAME" - - if [ -n "$icon_result" ]; then - echo "$APP_NAME|$icon_result" >>"$ICON_CACHE" - fi - - echo "$icon_result" - ''; - }; - colors = { - executable = true; - target = ".config/sketchybar/colors.sh"; - text = '' - - export TRANSPARENT=0x00ffffff - - # -- Gray Scheme -- - export ITEM_COLOR=0xff000000 - export ACCENT_COLOR=0xffc3c6cb - - # -- White Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xffffffff - - # -- Teal Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xff2cf9ed - - # -- Purple Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xffeb46f9 - - # -- Red Scheme --- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xffff2453 - - # -- Blue Scheme --- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xff15bdf9 - - # -- Green Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xff1dfca1 - - # -- Orange Scheme -- - # export ITEM_COLOR=0xffffffff - # export ACCENT_COLOR=0xfff97716 - - # -- Yellow Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xfff7fc17 - ''; - }; - items_wifi = { - executable = true; - target = ".config/sketchybar/items/wifi.sh"; - text = '' - #!/usr/bin/env/ sh - - sketchybar --add item wifi right \ - --set wifi \ - icon="􀙥" \ - label="Updating..." \ - script="$PLUGIN_DIR/wifi.sh" \ - --subscribe wifi wifi_change - ''; - }; - items_battery = { - executable = true; - target = ".config/sketchybar/items/battery.sh"; - text = '' - #!/usr/bin/env/ sh - sketchybar --add item battery right \ - --set battery update_freq=180 \ - script="$PLUGIN_DIR/battery.sh" \ - --subscribe battery system_woke power_source_change - ''; - }; - items_calendar = { - executable = true; - target = ".config/sketchybar/items/calendar.sh"; - text = '' - #!/usr/bin/env sh - sketchybar --add item calendar right \ - --set calendar icon=􀧞 \ - update_freq=15 \ - script="$PLUGIN_DIR/calendar.sh" - ''; - }; - items_front_app = { - executable = true; - target = ".config/sketchybar/items/front_app.sh"; - text = '' - #!/usr/bin/env sh - - sketchybar --add item front_app left \ - --set front_app background.color=$ACCENT_COLOR \ - icon.color=$ITEM_COLOR \ - label.color=$ITEM_COLOR \ - icon.font="sketchybar-app-font:Regular:12.0" \ - label.font="SF Pro:Semibold:12.0" \ - script="$PLUGIN_DIR/front_app.sh" \ - --subscribe front_app front_app_switched - ''; - }; - items_spaces = { - executable = true; - target = ".config/sketchybar/items/spaces.sh"; - text = '' - sketchybar --add event aerospace_workspace_change - - sketchybar --add item aerospace_dummy left \ - --set aerospace_dummy display=0 \ - script="$PLUGIN_DIR/spaces.sh" \ - --subscribe aerospace_dummy aerospace_workspace_change - - for m in $(aerospace list-monitors | awk '{print $1}'); do - for sid in $(aerospace list-workspaces --monitor $m); do - sketchybar --add space space.$sid left \ - --set space.$sid space=$sid \ - icon=$sid \ - background.color=$TRANSPARENT \ - label.color=$ACCENT_COLOR \ - icon.color=$ACCENT_COLOR \ - display=$m \ - label.font="sketchybar-app-font:Regular:12.0" \ - icon.font="SF Pro:Semibold:12.0" \ - label.padding_right=10 \ - label.y_offset=-1 \ - click_script="$PLUGIN_DIR/space_click.sh $sid" - - apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | - awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}') - - icon_strip="" - if [ "''${apps}" != "" ]; then - while read -r app; do - icon_strip+=" $($PLUGIN_DIR/icons.sh "$app")" - done <<<"''${apps}" - else - icon_strip=" —" - fi - - sketchybar --set space.$sid label="$icon_strip" - - done - - for empty_space in $(aerospace list-workspaces --monitor $m --empty); do - sketchybar --set space.$empty_space display=0 - done - for focus in $(aerospace list-workspaces --focused); do - sketchybar --set space.$focus background.drawing=on \ - background.color=$ACCENT_COLOR \ - label.color=$ITEM_COLOR \ - icon.color=$ITEM_COLOR - done - done - ''; - }; - - items_volume = { - executable = true; - target = ".config/sketchybar/items/volume.sh"; - text = '' - #/usr/bin/env sh - - sketchybar --add item volume right \ - --set volume script="$PLUGIN_DIR/volume.sh" \ - --subscribe volume volume_change - ''; - }; - plugins_wifi = { - executable = true; - target = ".config/sketchybar/plugins/wifi.sh"; - text = '' - #/usr/bin/env sh - - SSID=$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }') - - if [ "$SSID" = "" ]; then - sketchybar --set $NAME icon="􀙈" label="Disconnected" - else - sketchybar --set $NAME icon="􀙇" label="$SSID" - fi - - ''; - }; - plugins_calendar = { - executable = true; - target = ".config/sketchybar/plugins/calendar.sh"; - - text = '' - #/usr/bin/env sh - - sketchybar --set $NAME label="$(date +'%a %d %b %I:%M %p')" - ''; - }; - plugins_spaces = { - executable = true; - target = ".config/sketchybar/plugins/spaces.sh"; - text = '' - #!/usr/bin/env sh - - source "$CONFIG_DIR/colors.sh" - - update_workspace_appearance() { - local sid=$1 - local is_focused=$2 - - if [ "$is_focused" = "true" ]; then - sketchybar --set space.$sid background.drawing=on \ - background.color=$ACCENT_COLOR \ - label.color=$ITEM_COLOR \ - icon.color=$ITEM_COLOR - else - sketchybar --set space.$sid background.drawing=off \ - label.color=$ACCENT_COLOR \ - icon.color=$ACCENT_COLOR - fi - } - - update_icons() { - m=$1 - sid=$2 - - apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" \ - | awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}' \ - | sort) - - icon_strip="" - if [ "''${apps}" != "" ]; then - while read -r app; do - icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")" - done <<<"''${apps}" - else - icon_strip=" —" + # Create the cache file if it doesn't exist + if [ ! -f "$ICON_CACHE" ]; then + touch "$ICON_CACHE" fi - sketchybar --animate sin 10 --set space.$sid label="$icon_strip" - } + # Check if the app is already in cache + APP_NAME=$(if [ "$1" = "Zen" ]; then echo "Zen Browser"; else echo "$1"; fi) - update_workspace_appearance "$PREV_WORKSPACE" "false" - update_workspace_appearance "$FOCUSED_WORKSPACE" "true" + CACHED_ICON=$(grep "^$APP_NAME|" "$ICON_CACHE" | cut -d '|' -f2) - for m in $(aerospace list-monitors | awk '{print $1}'); do - for sid in $(aerospace list-workspaces --monitor $m --visible); do - sketchybar --set space.$sid display=$m + if [ -n "$CACHED_ICON" ]; then + # Cache hit, return the icon + echo "$CACHED_ICON" + exit 0 + fi - update_icons "$m" "$sid" + # Get icon from the mapping function + __icon_map "$APP_NAME" - update_icons "$m" "$PREV_WORKSPACE" + if [ -n "$icon_result" ]; then + echo "$APP_NAME|$icon_result" >>"$ICON_CACHE" + fi - apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | wc -l) - if [ "''${apps}" -eq 0 ]; then - sketchybar --set space.$sid display=0 - fi - done - done - ''; - }; + echo "$icon_result" + ''; + }; + colors = { + executable = true; + target = ".config/sketchybar/colors.sh"; + text = '' - plugins_space_click = { - executable = true; - target = ".config/sketchybar/plugins/space_click.sh"; - text = '' - #/usr/bin/env/ sh + export TRANSPARENT=0x00ffffff - apps=$(aerospace list-windows --workspace $1 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') - focused=$(aerospace list-workspaces --focused) + # -- Gray Scheme -- + export ITEM_COLOR=0xff000000 + export ACCENT_COLOR=0xffc3c6cb - if [ "''${apps}" = "" ] && [ "''${focused}" != "$1" ]; then - sketchybar --set space.$1 display=0 - else - aerospace workspace $1 - fi - ''; - }; - plugins_volume = { - executable = true; - target = ".config/sketchybar/plugins/volume.sh"; - text = '' - #!/usr/bin/env sh + # -- White Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xffffffff - # The volume_change event supplies a $INFO variable in which the current volume - # percentage is passed to the script. + # -- Teal Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xff2cf9ed - if [ "$SENDER" = "volume_change" ]; then + # -- Purple Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xffeb46f9 - VOLUME=$INFO + # -- Red Scheme --- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xffff2453 - case $VOLUME in - [6-9][0-9] | 100) - ICON="􀊩" - ;; - [3-5][0-9]) - ICON="􀊥" - ;; - [1-9] | [1-2][0-9]) - ICON="􀊡" - ;; - *) ICON="􀊣" ;; - esac + # -- Blue Scheme --- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xff15bdf9 - sketchybar --set $NAME icon="$ICON" label="$VOLUME%" - fi - ''; - }; - plugins_front_app = { - executable = true; - target = ".config/sketchybar/plugins/front_app.sh"; - text = '' - # Some events send additional information specific to the event in the $INFO - # variable. E.g. the front_app_switched event sends the name of the newly - # focused application in the $INFO variable: - # https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting + # -- Green Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xff1dfca1 + + # -- Orange Scheme -- + # export ITEM_COLOR=0xffffffff + # export ACCENT_COLOR=0xfff97716 + + # -- Yellow Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xfff7fc17 + ''; + }; + items_wifi = { + executable = true; + target = ".config/sketchybar/items/wifi.sh"; + text = '' + #!/usr/bin/env/ sh + + sketchybar --add item wifi right \ + --set wifi \ + icon="􀙥" \ + label="Updating..." \ + script="$PLUGIN_DIR/wifi.sh" \ + --subscribe wifi wifi_change + ''; + }; + items_battery = { + executable = true; + target = ".config/sketchybar/items/battery.sh"; + text = '' + #!/usr/bin/env/ sh + sketchybar --add item battery right \ + --set battery update_freq=180 \ + script="$PLUGIN_DIR/battery.sh" \ + --subscribe battery system_woke power_source_change + ''; + }; + items_calendar = { + executable = true; + target = ".config/sketchybar/items/calendar.sh"; + text = '' + #!/usr/bin/env sh + sketchybar --add item calendar right \ + --set calendar icon=􀧞 \ + update_freq=15 \ + script="$PLUGIN_DIR/calendar.sh" + ''; + }; + items_front_app = { + executable = true; + target = ".config/sketchybar/items/front_app.sh"; + text = '' + #!/usr/bin/env sh + + sketchybar --add item front_app left \ + --set front_app background.color=$ACCENT_COLOR \ + icon.color=$ITEM_COLOR \ + label.color=$ITEM_COLOR \ + icon.font="sketchybar-app-font:Regular:12.0" \ + label.font="SF Pro:Semibold:12.0" \ + script="$PLUGIN_DIR/front_app.sh" \ + --subscribe front_app front_app_switched + ''; + }; + items_spaces = { + executable = true; + target = ".config/sketchybar/items/spaces.sh"; + text = '' + sketchybar --add event aerospace_workspace_change + + sketchybar --add item aerospace_dummy left \ + --set aerospace_dummy display=0 \ + script="$PLUGIN_DIR/spaces.sh" \ + --subscribe aerospace_dummy aerospace_workspace_change - app_switched() { for m in $(aerospace list-monitors | awk '{print $1}'); do - for sid in $(aerospace list-workspaces --monitor $m --visible); do + for sid in $(aerospace list-workspaces --monitor $m); do + sketchybar --add space space.$sid left \ + --set space.$sid space=$sid \ + icon=$sid \ + background.color=$TRANSPARENT \ + label.color=$ACCENT_COLOR \ + icon.color=$ACCENT_COLOR \ + display=$m \ + label.font="sketchybar-app-font:Regular:12.0" \ + icon.font="SF Pro:Semibold:12.0" \ + label.padding_right=10 \ + label.y_offset=-1 \ + click_script="$PLUGIN_DIR/space_click.sh $sid" - apps=$( (echo "$INFO"; aerospace list-windows --monitor "$m" --workspace "$sid" \ - | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') \ - | awk '!seen[$0]++' | sort) + apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | + awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}') icon_strip="" if [ "''${apps}" != "" ]; then while read -r app; do - icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")" + icon_strip+=" $($PLUGIN_DIR/icons.sh "$app")" done <<<"''${apps}" else icon_strip=" —" fi - sketchybar --animate sin 10 --set space.$sid label="$icon_strip" + sketchybar --set space.$sid label="$icon_strip" + + done + + for empty_space in $(aerospace list-workspaces --monitor $m --empty); do + sketchybar --set space.$empty_space display=0 + done + for focus in $(aerospace list-workspaces --focused); do + sketchybar --set space.$focus background.drawing=on \ + background.color=$ACCENT_COLOR \ + label.color=$ITEM_COLOR \ + icon.color=$ITEM_COLOR done done - } + ''; + }; - if [ "$SENDER" = "front_app_switched" ]; then + items_volume = { + executable = true; + target = ".config/sketchybar/items/volume.sh"; + text = '' + #/usr/bin/env sh - sketchybar --set $NAME label="$INFO" icon="$($CONFIG_DIR/plugins/icons.sh "$INFO")" + sketchybar --add item volume right \ + --set volume script="$PLUGIN_DIR/volume.sh" \ + --subscribe volume volume_change + ''; + }; + plugins_wifi = { + executable = true; + target = ".config/sketchybar/plugins/wifi.sh"; + text = '' + #/usr/bin/env sh - app_switched - fi - ''; - }; - plugins_battery = { - executable = true; - target = ".config/sketchybar/plugins/battery.sh"; - text = '' - #!/usr/bin/env sh - source "$CONFIG_DIR/colors.sh" + SSID=$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }') - PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1) - CHARGING=$(pmset -g batt | grep 'AC Power') + if [ "$SSID" = "" ]; then + sketchybar --set $NAME icon="􀙈" label="Disconnected" + else + sketchybar --set $NAME icon="􀙇" label="$SSID" + fi - if [ $PERCENTAGE = "" ]; then - exit 0 - fi + ''; + }; + plugins_calendar = { + executable = true; + target = ".config/sketchybar/plugins/calendar.sh"; - case ''${PERCENTAGE} in - 9[0-9] | 100) - ICON="􀛨" - COLOR=$ITEM_COLOR - ;; - [6-8][0-9]) - ICON="􀺸" - COLOR=$ITEM_COLOR - ;; - [3-5][0-9]) - ICON="􀺶" - COLOR="0xFFd97706" - ;; - [1-2][0-9]) - ICON="􀛩" - COLOR="0xFFf97316" - ;; - *) - ICON="􀛪" - COLOR="0xFFef4444" - ;; - esac + text = '' + #/usr/bin/env sh - if [[ $CHARGING != "" ]]; then - ICON="􀢋" - COLOR=$ITEM_COLOR - fi + sketchybar --set $NAME label="$(date +'%a %d %b %I:%M %p')" + ''; + }; + plugins_spaces = { + executable = true; + target = ".config/sketchybar/plugins/spaces.sh"; + text = '' + #!/usr/bin/env sh - # The item invoking this script (name $NAME) will get its icon and label - # updated with the current battery status - sketchybar --set $NAME icon="$ICON" label="''${PERCENTAGE}%" icon.color="$COLOR" - ''; - }; - plugins_aerospace = { - executable = true; - target = ".config/sketchybar/plugins/aerospace.sh"; - text = '' - #!/usr/bin/env bash - source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors + source "$CONFIG_DIR/colors.sh" - highlight_focused_workspace() { - if [[ "$1" = "$FOCUSED_WORKSPACE" ]] - then - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=on label.width=0 + update_workspace_appearance() { + local sid=$1 + local is_focused=$2 + + if [ "$is_focused" = "true" ]; then + sketchybar --set space.$sid background.drawing=on \ + background.color=$ACCENT_COLOR \ + label.color=$ITEM_COLOR \ + icon.color=$ITEM_COLOR + else + sketchybar --set space.$sid background.drawing=off \ + label.color=$ACCENT_COLOR \ + icon.color=$ACCENT_COLOR + fi + } + + update_icons() { + m=$1 + sid=$2 + + apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" \ + | awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}' \ + | sort) + + icon_strip="" + if [ "''${apps}" != "" ]; then + while read -r app; do + icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")" + done <<<"''${apps}" + else + icon_strip=" —" + fi + + sketchybar --animate sin 10 --set space.$sid label="$icon_strip" + } + + update_workspace_appearance "$PREV_WORKSPACE" "false" + update_workspace_appearance "$FOCUSED_WORKSPACE" "true" + + for m in $(aerospace list-monitors | awk '{print $1}'); do + for sid in $(aerospace list-workspaces --monitor $m --visible); do + sketchybar --set space.$sid display=$m + + update_icons "$m" "$sid" + + update_icons "$m" "$PREV_WORKSPACE" + + apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | wc -l) + if [ "''${apps}" -eq 0 ]; then + sketchybar --set space.$sid display=0 + fi + done + done + ''; + }; + + plugins_space_click = { + executable = true; + target = ".config/sketchybar/plugins/space_click.sh"; + text = '' + #/usr/bin/env/ sh + + apps=$(aerospace list-windows --workspace $1 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') + focused=$(aerospace list-workspaces --focused) + + if [ "''${apps}" = "" ] && [ "''${focused}" != "$1" ]; then + sketchybar --set space.$1 display=0 else - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic + aerospace workspace $1 fi - } + ''; + }; + plugins_volume = { + executable = true; + target = ".config/sketchybar/plugins/volume.sh"; + text = '' + #!/usr/bin/env sh - illuminate_mode() { - if [[ "$mode" = "service" ]] - then - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE - elif [[ "$mode" = "resize" ]] - then - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN - else - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1 + # The volume_change event supplies a $INFO variable in which the current volume + # percentage is passed to the script. + + if [ "$SENDER" = "volume_change" ]; then + + VOLUME=$INFO + + case $VOLUME in + [6-9][0-9] | 100) + ICON="􀊩" + ;; + [3-5][0-9]) + ICON="􀊥" + ;; + [1-9] | [1-2][0-9]) + ICON="􀊡" + ;; + *) ICON="􀊣" ;; + esac + + sketchybar --set $NAME icon="$ICON" label="$VOLUME%" fi - } - case "$SENDER" in - "aerospace_workspace_change") - highlight_focused_workspace $1 + ''; + }; + plugins_front_app = { + executable = true; + target = ".config/sketchybar/plugins/front_app.sh"; + text = '' + # Some events send additional information specific to the event in the $INFO + # variable. E.g. the front_app_switched event sends the name of the newly + # focused application in the $INFO variable: + # https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting + + app_switched() { + for m in $(aerospace list-monitors | awk '{print $1}'); do + for sid in $(aerospace list-workspaces --monitor $m --visible); do + + apps=$( (echo "$INFO"; aerospace list-windows --monitor "$m" --workspace "$sid" \ + | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') \ + | awk '!seen[$0]++' | sort) + + icon_strip="" + if [ "''${apps}" != "" ]; then + while read -r app; do + icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")" + done <<<"''${apps}" + else + icon_strip=" —" + fi + + sketchybar --animate sin 10 --set space.$sid label="$icon_strip" + done + done + } + + if [ "$SENDER" = "front_app_switched" ]; then + + sketchybar --set $NAME label="$INFO" icon="$($CONFIG_DIR/plugins/icons.sh "$INFO")" + + app_switched + fi + ''; + }; + plugins_battery = { + executable = true; + target = ".config/sketchybar/plugins/battery.sh"; + text = '' + #!/usr/bin/env sh + source "$CONFIG_DIR/colors.sh" + + PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1) + CHARGING=$(pmset -g batt | grep 'AC Power') + + if [ $PERCENTAGE = "" ]; then + exit 0 + fi + + case ''${PERCENTAGE} in + 9[0-9] | 100) + ICON="􀛨" + COLOR=$ITEM_COLOR ;; - "aerospace_mode_change") - illuminate_mode + [6-8][0-9]) + ICON="􀺸" + COLOR=$ITEM_COLOR ;; - esac - ''; - }; - }; + [3-5][0-9]) + ICON="􀺶" + COLOR="0xFFd97706" + ;; + [1-2][0-9]) + ICON="􀛩" + COLOR="0xFFf97316" + ;; + *) + ICON="􀛪" + COLOR="0xFFef4444" + ;; + esac + + if [[ $CHARGING != "" ]]; then + ICON="􀢋" + COLOR=$ITEM_COLOR + fi + + # The item invoking this script (name $NAME) will get its icon and label + # updated with the current battery status + sketchybar --set $NAME icon="$ICON" label="''${PERCENTAGE}%" icon.color="$COLOR" + ''; + }; + plugins_aerospace = { + executable = true; + target = ".config/sketchybar/plugins/aerospace.sh"; + text = '' + #!/usr/bin/env bash + source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors + + highlight_focused_workspace() { + if [[ "$1" = "$FOCUSED_WORKSPACE" ]] + then + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=on label.width=0 + else + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic + fi + } + + illuminate_mode() { + if [[ "$mode" = "service" ]] + then + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE + elif [[ "$mode" = "resize" ]] + then + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN + else + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1 + fi + } + case "$SENDER" in + "aerospace_workspace_change") + highlight_focused_workspace $1 + ;; + "aerospace_mode_change") + illuminate_mode + ;; + esac + ''; + }; + } + ); } diff --git a/modules/nixos/services.nix b/modules/nixos/services.nix index a5c6f0f..f0a8401 100644 --- a/modules/nixos/services.nix +++ b/modules/nixos/services.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { services = { avahi = { enable = true; @@ -24,6 +23,7 @@ desktopManager.cosmic.enable = true; displayManager.cosmic-greeter.enable = true; + desktopManager.cosmic.xwayland.enable = true; # Auto mount devices udisks2 = { @@ -40,7 +40,7 @@ # Enable CUPS to print documents. printing = { enable = true; - drivers = [ pkgs.brlaser ]; # Brother printer driver + drivers = [pkgs.brlaser]; # Brother printer driver }; pipewire = { @@ -55,7 +55,7 @@ openssh = { enable = true; - ports = [ 22 ]; + ports = [22]; settings = { PasswordAuthentication = true; UseDns = true; diff --git a/modules/shared/nix.nix b/modules/shared/nix.nix index b8bff36..596509a 100644 --- a/modules/shared/nix.nix +++ b/modules/shared/nix.nix @@ -24,13 +24,11 @@ "https://cache.nixos.org/?priority=10" "https://nix-community.cachix.org" - "https://cosmic.cachix.org/" # For haskell "https://cache.iog.io" ]; trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" # For haskell "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ]; diff --git a/users/natalie/desktop/configuration.nix b/users/natalie/desktop/configuration.nix index abc5094..1e0d3fc 100644 --- a/users/natalie/desktop/configuration.nix +++ b/users/natalie/desktop/configuration.nix @@ -3,8 +3,7 @@ user, host, ... -}: -{ +}: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -18,7 +17,7 @@ enable = true; # Certain features, including CLI integration and system authentication support, # require enabling PolKit integration on some desktop environments (e.g. Plasma). - polkitPolicyOwners = [ user.username ]; + polkitPolicyOwners = [user.username]; }; noisetorch.enable = true; @@ -35,7 +34,7 @@ steam = { enable = true; - package = with pkgs; steam.override { extraPkgs = pkgs: [ attr ]; }; + package = with pkgs; steam.override {extraPkgs = pkgs: [attr];}; }; git = { @@ -59,7 +58,7 @@ xdg.portal = { enable = true; - extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; + extraPortals = with pkgs; [xdg-desktop-portal-gtk]; }; virtualisation = { containers.enable = true; @@ -84,16 +83,14 @@ hybrid-sleep.enable = false; }; - packages = [ pkgs.observatory ]; - - services.monitord.wantedBy = [ "multi-user.target" ]; + services.monitord.wantedBy = ["multi-user.target"]; }; i18n = { # Select internationalisation properties. defaultLocale = "en_US.UTF-8"; - supportedLocales = [ "all" ]; + supportedLocales = ["all"]; extraLocaleSettings = { LC_ADDRESS = "en_US.UTF-8"; @@ -148,7 +145,10 @@ ]; }; environment = { - sessionVariables.COSMIC_DATA_CONTROL_ENABLED = 1; + sessionVariables = { + COSMIC_DATA_CONTROL_ENABLED = 1; + NIXOS_OZONE_WL = "1"; + }; variables.EDITOR = "nvim"; systemPackages = with pkgs; [ @@ -170,7 +170,7 @@ }; interfaces.enp11s0.wakeOnLan = { enable = true; - policy = [ "magic" ]; + policy = ["magic"]; }; }; From 40840a80842b53b3f119c95d5e67e40d070259d0 Mon Sep 17 00:00:00 2001 From: Natalie Marks Date: Wed, 28 May 2025 12:06:37 -0700 Subject: [PATCH 08/12] run format --- flake.lock | 21 + flake.nix | 219 +++--- lib/mkNeovim.nix | 28 +- modules/home/default.nix | 16 +- modules/home/macos/sketchybar.nix | 939 ++++++++++++------------ modules/macos/system.nix | 6 +- modules/nixos/services.nix | 7 +- modules/shared/nix.nix | 3 +- users/natalie/desktop/configuration.nix | 15 +- users/natalie/desktop/home.nix | 4 +- users/natalie/home.nix | 3 +- users/natalie/laptop/configuration.nix | 5 +- users/natalie/vim/default.nix | 3 +- users/natalie/vim/lean.nix | 3 +- users/natalie/vim/visuals.nix | 3 +- 15 files changed, 661 insertions(+), 614 deletions(-) diff --git a/flake.lock b/flake.lock index 0f4e29a..fd97db6 100644 --- a/flake.lock +++ b/flake.lock @@ -595,6 +595,7 @@ "nixpkgs": "nixpkgs_2", "nvf": "nvf", "rust-overlay": "rust-overlay_2", + "zen-browser": "zen-browser", "zig": "zig", "zls": "zls" } @@ -845,6 +846,26 @@ "type": "github" } }, + "zen-browser": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748059546, + "narHash": "sha256-e0jy8RU8ofOdeS5gF9Hir+M5Wn0q7D8MkpeQXsOJdu4=", + "owner": "youwen5", + "repo": "zen-browser-flake", + "rev": "716a5af28d686d67146d01b14112c919b6133a84", + "type": "github" + }, + "original": { + "owner": "youwen5", + "repo": "zen-browser-flake", + "type": "github" + } + }, "zig": { "inputs": { "flake-compat": "flake-compat", diff --git a/flake.nix b/flake.nix index c07de41..c0754a5 100644 --- a/flake.nix +++ b/flake.nix @@ -29,6 +29,10 @@ moonlight.url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly. moonlight.inputs.nixpkgs.follows = "nixpkgs"; + zen-browser = { + url = "github:youwen5/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nh.url = "github:viperML/nh"; nh.inputs.nixpkgs.follows = "nixpkgs"; @@ -37,76 +41,79 @@ nix-index-database.url = "github:nix-community/nix-index-database"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { - self, - nixpkgs, - lix-module, - darwin, - ... - } @ inputs: let - lib = nixpkgs.lib; - # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere. - overlays = [ - inputs.zig.overlays.default - inputs.rust-overlay.overlays.default - inputs.nh.overlays.default + outputs = + { + self, + nixpkgs, + lix-module, + darwin, + ... + }@inputs: + let + lib = nixpkgs.lib; + # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere. + overlays = [ + inputs.zig.overlays.default + inputs.rust-overlay.overlays.default + inputs.nh.overlays.default - # https://github.com/LnL7/nix-darwin/issues/1041 - (_: prev: { - karabiner-elements = prev.karabiner-elements.overrideAttrs (old: { - version = "14.13.0"; + # https://github.com/LnL7/nix-darwin/issues/1041 + (_: prev: { + karabiner-elements = prev.karabiner-elements.overrideAttrs (old: { + version = "14.13.0"; - src = prev.fetchurl { - inherit (old.src) url; - hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw="; - }; - }); - }) - ]; - - # Users of this flake currently use x86_64 Linux and Apple Silicon - systems = [ - "x86_64-linux" - "aarch64-darwin" - ]; - forAllSystems = f: - builtins.listToAttrs ( - builtins.map (system: { - name = system; - value = f ( - inputs - // { - inherit system; - pkgs = nixpkgs.legacyPackages.${system}; - } - ); + src = prev.fetchurl { + inherit (old.src) url; + hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw="; + }; + }); }) - systems - ); + ]; - mkSystem = import ./lib/mkSystem.nix { - inherit - overlays - nixpkgs - lix-module - inputs - mkNeovim - ; - }; - mkNeovim = import ./lib/mkNeovim.nix { - inherit - self - overlays - nixpkgs - inputs - ; - }; - in rec { - inherit self; - # "nix fmt" - formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree); - packages = forAllSystems ( - {system, ...}: + # Users of this flake currently use x86_64 Linux and Apple Silicon + systems = [ + "x86_64-linux" + "aarch64-darwin" + ]; + forAllSystems = + f: + builtins.listToAttrs ( + builtins.map (system: { + name = system; + value = f ( + inputs + // { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + } + ); + }) systems + ); + + mkSystem = import ./lib/mkSystem.nix { + inherit + overlays + nixpkgs + lix-module + inputs + mkNeovim + ; + }; + mkNeovim = import ./lib/mkNeovim.nix { + inherit + self + overlays + nixpkgs + inputs + ; + }; + in + rec { + inherit self; + # "nix fmt" + formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree); + packages = forAllSystems ( + { system, ... }: { nvim-chloe = mkNeovim "chloe" system; nvim-natalie = mkNeovim "natalie" system; @@ -115,46 +122,48 @@ # "nix run .#darwin-rebuild" darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild; } - ); + ); - # natalie's desktop computer - nixosConfigurations.nixos = mkSystem "nixos" { - user = "natalie"; - host = "desktop"; - system = "x86_64-linux"; - extraModules = [ - ]; - }; - # natalie's laptop - darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" { - user = "natalie"; - host = "laptop"; - system = "aarch64-darwin"; - }; + # natalie's desktop computer + nixosConfigurations.nixos = mkSystem "nixos" { + user = "natalie"; + host = "desktop"; + system = "x86_64-linux"; + extraModules = [ + ]; + }; + # natalie's laptop + darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" { + user = "natalie"; + host = "laptop"; + system = "aarch64-darwin"; + }; - # chloe's mac studio "sandwich" - darwinConfigurations.sandwich = mkSystem "sandwich" { - user = "chloe"; - host = "sandwich"; - system = "aarch64-darwin"; - }; - # chloe's macbook air "paperback" - darwinConfigurations.paperback = mkSystem "paperback" { - user = "chloe"; - host = "paperback"; - system = "aarch64-darwin"; - }; + # chloe's mac studio "sandwich" + darwinConfigurations.sandwich = mkSystem "sandwich" { + user = "chloe"; + host = "sandwich"; + system = "aarch64-darwin"; + }; + # chloe's macbook air "paperback" + darwinConfigurations.paperback = mkSystem "paperback" { + user = "chloe"; + host = "paperback"; + system = "aarch64-darwin"; + }; - # generate checks for "nix flake check --all-systems --no-build" - checks.aarch64-darwin = builtins.listToAttrs ( - builtins.map ( - name: let - d = darwinConfigurations.${name}.system; - in { - name = "darwinConfiguration-" + d.name; - value = d; - } - ) (builtins.attrNames darwinConfigurations) - ); - }; + # generate checks for "nix flake check --all-systems --no-build" + checks.aarch64-darwin = builtins.listToAttrs ( + builtins.map ( + name: + let + d = darwinConfigurations.${name}.system; + in + { + name = "darwinConfiguration-" + d.name; + value = d; + } + ) (builtins.attrNames darwinConfigurations) + ); + }; } diff --git a/lib/mkNeovim.nix b/lib/mkNeovim.nix index 5602fae..72e6d9c 100644 --- a/lib/mkNeovim.nix +++ b/lib/mkNeovim.nix @@ -4,7 +4,9 @@ # TODO: apply overlays here overlays, inputs, -}: user: system: let +}: +user: system: +let darwin = nixpkgs.lib.strings.hasSuffix "-darwin" system; host = { @@ -15,15 +17,15 @@ userDir = ../users + "/${user}"; userConfig = import (userDir + "/user.nix"); in - (inputs.nvf.lib.neovimConfiguration { - pkgs = nixpkgs.legacyPackages.${system}; - modules = builtins.filter (f: f != null) [ - (../users + ("/" + user + "/vim.nix")) - ../modules/neovim - ]; - extraSpecialArgs = { - inherit host; - flake = self; - user = userConfig; - }; - }).neovim +(inputs.nvf.lib.neovimConfiguration { + pkgs = nixpkgs.legacyPackages.${system}; + modules = builtins.filter (f: f != null) [ + (../users + ("/" + user + "/vim.nix")) + ../modules/neovim + ]; + extraSpecialArgs = { + inherit host; + flake = self; + user = userConfig; + }; +}).neovim diff --git a/modules/home/default.nix b/modules/home/default.nix index addf68f..98635b4 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -8,14 +8,14 @@ host, mainHomeImports, ... -}: let +}: +let cfg = config.programs; -in { - imports = - mainHomeImports - ++ [ - ./macos/sketchybar.nix - ]; +in +{ + imports = mainHomeImports ++ [ + ./macos/sketchybar.nix + ]; programs = { home-manager.enable = true; nix-index.enable = true; @@ -80,7 +80,7 @@ in { } ]; shellAliases = - {} + { } // lib.optionalAttrs (!host.darwin) { reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now"; }; diff --git a/modules/home/macos/sketchybar.nix b/modules/home/macos/sketchybar.nix index 38695d3..f42a1f0 100644 --- a/modules/home/macos/sketchybar.nix +++ b/modules/home/macos/sketchybar.nix @@ -4,536 +4,539 @@ config, host, ... -}: { +}: +{ home.file = - {} + { } // lib.optionalAttrs host.darwin ( - lib.attrsets.mapAttrs (file: value: ( - lib.attrsets.overrideExisting value {enable = config.shared.darwin.tiling.enable;} - )) { - sketchybarrc = { - executable = true; - target = ".config/sketchybar/sketchybarrc"; - text = '' - #!/usr/bin/env sh + lib.attrsets.mapAttrs + ( + file: value: (lib.attrsets.overrideExisting value { enable = config.shared.darwin.tiling.enable; }) + ) + { + sketchybarrc = { + executable = true; + target = ".config/sketchybar/sketchybarrc"; + text = '' + #!/usr/bin/env sh - source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors + source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors - ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured - PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored + ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured + PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored - FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants - PADDINGS=3 # All paddings use this value (icon, label, background) + FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants + PADDINGS=3 # All paddings use this value (icon, label, background) - # Setting up the general bar appearance and default values - ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \ - blur_radius=30 \ - position=top \ - sticky=on \ - padding_left=10 \ - padding_right=10 + # Setting up the general bar appearance and default values + ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \ + blur_radius=30 \ + position=top \ + sticky=on \ + padding_left=10 \ + padding_right=10 - ${pkgs.sketchybar}/bin/sketchybar --default icon.font="SF Pro:Semibold:12.0" \ - icon.color=$ITEM_COLOR \ - label.font="SF Pro:Semibold:12.0" \ - label.color=$ITEM_COLOR \ - background.color=$ACCENT_COLOR \ - background.corner_radius=10 \ - background.height=20 \ - padding_left=4 \ - padding_right=4 \ - icon.padding_left=6 \ - icon.padding_right=3 \ - label.padding_left=3 \ - label.padding_right=6 + ${pkgs.sketchybar}/bin/sketchybar --default icon.font="SF Pro:Semibold:12.0" \ + icon.color=$ITEM_COLOR \ + label.font="SF Pro:Semibold:12.0" \ + label.color=$ITEM_COLOR \ + background.color=$ACCENT_COLOR \ + background.corner_radius=10 \ + background.height=20 \ + padding_left=4 \ + padding_right=4 \ + icon.padding_left=6 \ + icon.padding_right=3 \ + label.padding_left=3 \ + label.padding_right=6 - # Left - # source "$ITEM_DIR/apple.sh" - source "$ITEM_DIR/spaces.sh" - source "$ITEM_DIR/front_app.sh" + # Left + # source "$ITEM_DIR/apple.sh" + source "$ITEM_DIR/spaces.sh" + source "$ITEM_DIR/front_app.sh" - # Center - # source "$ITEM_DIR/spotify.sh" - source "$ITEM_DIR/calendar.sh" + # Center + # source "$ITEM_DIR/spotify.sh" + source "$ITEM_DIR/calendar.sh" - # Right - source $ITEM_DIR/calendar.sh - source $ITEM_DIR/wifi.sh - source $ITEM_DIR/battery.sh - source $ITEM_DIR/volume.sh + # Right + source $ITEM_DIR/calendar.sh + source $ITEM_DIR/wifi.sh + source $ITEM_DIR/battery.sh + source $ITEM_DIR/volume.sh - # Forcing all item scripts to run (never do this outside of sketchybarrc) - ${pkgs.sketchybar}/bin/sketchybar --update + # Forcing all item scripts to run (never do this outside of sketchybarrc) + ${pkgs.sketchybar}/bin/sketchybar --update - echo "sketchybar configuation loaded.." - ''; - }; - icons = { - executable = true; - target = ".config/sketchybar/plugins/icons.sh"; - text = '' - #!/usr/bin/env sh + echo "sketchybar configuation loaded.." + ''; + }; + icons = { + executable = true; + target = ".config/sketchybar/plugins/icons.sh"; + text = '' + #!/usr/bin/env sh - # Source the icon map with all the application icons - source ${pkgs.sketchybar-app-font}/bin/icon_map.sh + # Source the icon map with all the application icons + source ${pkgs.sketchybar-app-font}/bin/icon_map.sh - # Create a cache directory if it doesn't exist - CACHE_DIR="$HOME/.cache/sketchybar" - mkdir -p "$CACHE_DIR" + # Create a cache directory if it doesn't exist + CACHE_DIR="$HOME/.cache/sketchybar" + mkdir -p "$CACHE_DIR" - # Cache file for icon mappings - ICON_CACHE="$CACHE_DIR/icon_cache.txt" + # Cache file for icon mappings + ICON_CACHE="$CACHE_DIR/icon_cache.txt" - # Create the cache file if it doesn't exist - if [ ! -f "$ICON_CACHE" ]; then - touch "$ICON_CACHE" - fi - - # Check if the app is already in cache - APP_NAME=$(if [ "$1" = "Zen" ]; then echo "Zen Browser"; else echo "$1"; fi) - - CACHED_ICON=$(grep "^$APP_NAME|" "$ICON_CACHE" | cut -d '|' -f2) - - if [ -n "$CACHED_ICON" ]; then - # Cache hit, return the icon - echo "$CACHED_ICON" - exit 0 - fi - - # Get icon from the mapping function - __icon_map "$APP_NAME" - - if [ -n "$icon_result" ]; then - echo "$APP_NAME|$icon_result" >>"$ICON_CACHE" - fi - - echo "$icon_result" - ''; - }; - colors = { - executable = true; - target = ".config/sketchybar/colors.sh"; - text = '' - - export TRANSPARENT=0x00ffffff - - # -- Gray Scheme -- - export ITEM_COLOR=0xff000000 - export ACCENT_COLOR=0xffc3c6cb - - # -- White Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xffffffff - - # -- Teal Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xff2cf9ed - - # -- Purple Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xffeb46f9 - - # -- Red Scheme --- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xffff2453 - - # -- Blue Scheme --- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xff15bdf9 - - # -- Green Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xff1dfca1 - - # -- Orange Scheme -- - # export ITEM_COLOR=0xffffffff - # export ACCENT_COLOR=0xfff97716 - - # -- Yellow Scheme -- - # export ITEM_COLOR=0xff000000 - # export ACCENT_COLOR=0xfff7fc17 - ''; - }; - items_wifi = { - executable = true; - target = ".config/sketchybar/items/wifi.sh"; - text = '' - #!/usr/bin/env/ sh - - sketchybar --add item wifi right \ - --set wifi \ - icon="􀙥" \ - label="Updating..." \ - script="$PLUGIN_DIR/wifi.sh" \ - --subscribe wifi wifi_change - ''; - }; - items_battery = { - executable = true; - target = ".config/sketchybar/items/battery.sh"; - text = '' - #!/usr/bin/env/ sh - sketchybar --add item battery right \ - --set battery update_freq=180 \ - script="$PLUGIN_DIR/battery.sh" \ - --subscribe battery system_woke power_source_change - ''; - }; - items_calendar = { - executable = true; - target = ".config/sketchybar/items/calendar.sh"; - text = '' - #!/usr/bin/env sh - sketchybar --add item calendar right \ - --set calendar icon=􀧞 \ - update_freq=15 \ - script="$PLUGIN_DIR/calendar.sh" - ''; - }; - items_front_app = { - executable = true; - target = ".config/sketchybar/items/front_app.sh"; - text = '' - #!/usr/bin/env sh - - sketchybar --add item front_app left \ - --set front_app background.color=$ACCENT_COLOR \ - icon.color=$ITEM_COLOR \ - label.color=$ITEM_COLOR \ - icon.font="sketchybar-app-font:Regular:12.0" \ - label.font="SF Pro:Semibold:12.0" \ - script="$PLUGIN_DIR/front_app.sh" \ - --subscribe front_app front_app_switched - ''; - }; - items_spaces = { - executable = true; - target = ".config/sketchybar/items/spaces.sh"; - text = '' - sketchybar --add event aerospace_workspace_change - - sketchybar --add item aerospace_dummy left \ - --set aerospace_dummy display=0 \ - script="$PLUGIN_DIR/spaces.sh" \ - --subscribe aerospace_dummy aerospace_workspace_change - - for m in $(aerospace list-monitors | awk '{print $1}'); do - for sid in $(aerospace list-workspaces --monitor $m); do - sketchybar --add space space.$sid left \ - --set space.$sid space=$sid \ - icon=$sid \ - background.color=$TRANSPARENT \ - label.color=$ACCENT_COLOR \ - icon.color=$ACCENT_COLOR \ - display=$m \ - label.font="sketchybar-app-font:Regular:12.0" \ - icon.font="SF Pro:Semibold:12.0" \ - label.padding_right=10 \ - label.y_offset=-1 \ - click_script="$PLUGIN_DIR/space_click.sh $sid" - - apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | - awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}') - - icon_strip="" - if [ "''${apps}" != "" ]; then - while read -r app; do - icon_strip+=" $($PLUGIN_DIR/icons.sh "$app")" - done <<<"''${apps}" - else - icon_strip=" —" - fi - - sketchybar --set space.$sid label="$icon_strip" - - done - - for empty_space in $(aerospace list-workspaces --monitor $m --empty); do - sketchybar --set space.$empty_space display=0 - done - for focus in $(aerospace list-workspaces --focused); do - sketchybar --set space.$focus background.drawing=on \ - background.color=$ACCENT_COLOR \ - label.color=$ITEM_COLOR \ - icon.color=$ITEM_COLOR - done - done - ''; - }; - - items_volume = { - executable = true; - target = ".config/sketchybar/items/volume.sh"; - text = '' - #/usr/bin/env sh - - sketchybar --add item volume right \ - --set volume script="$PLUGIN_DIR/volume.sh" \ - --subscribe volume volume_change - ''; - }; - plugins_wifi = { - executable = true; - target = ".config/sketchybar/plugins/wifi.sh"; - text = '' - #/usr/bin/env sh - - SSID=$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }') - - if [ "$SSID" = "" ]; then - sketchybar --set $NAME icon="􀙈" label="Disconnected" - else - sketchybar --set $NAME icon="􀙇" label="$SSID" - fi - - ''; - }; - plugins_calendar = { - executable = true; - target = ".config/sketchybar/plugins/calendar.sh"; - - text = '' - #/usr/bin/env sh - - sketchybar --set $NAME label="$(date +'%a %d %b %I:%M %p')" - ''; - }; - plugins_spaces = { - executable = true; - target = ".config/sketchybar/plugins/spaces.sh"; - text = '' - #!/usr/bin/env sh - - source "$CONFIG_DIR/colors.sh" - - update_workspace_appearance() { - local sid=$1 - local is_focused=$2 - - if [ "$is_focused" = "true" ]; then - sketchybar --set space.$sid background.drawing=on \ - background.color=$ACCENT_COLOR \ - label.color=$ITEM_COLOR \ - icon.color=$ITEM_COLOR - else - sketchybar --set space.$sid background.drawing=off \ - label.color=$ACCENT_COLOR \ - icon.color=$ACCENT_COLOR - fi - } - - update_icons() { - m=$1 - sid=$2 - - apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" \ - | awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}' \ - | sort) - - icon_strip="" - if [ "''${apps}" != "" ]; then - while read -r app; do - icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")" - done <<<"''${apps}" - else - icon_strip=" —" + # Create the cache file if it doesn't exist + if [ ! -f "$ICON_CACHE" ]; then + touch "$ICON_CACHE" fi - sketchybar --animate sin 10 --set space.$sid label="$icon_strip" - } + # Check if the app is already in cache + APP_NAME=$(if [ "$1" = "Zen" ]; then echo "Zen Browser"; else echo "$1"; fi) - update_workspace_appearance "$PREV_WORKSPACE" "false" - update_workspace_appearance "$FOCUSED_WORKSPACE" "true" + CACHED_ICON=$(grep "^$APP_NAME|" "$ICON_CACHE" | cut -d '|' -f2) - for m in $(aerospace list-monitors | awk '{print $1}'); do - for sid in $(aerospace list-workspaces --monitor $m --visible); do - sketchybar --set space.$sid display=$m + if [ -n "$CACHED_ICON" ]; then + # Cache hit, return the icon + echo "$CACHED_ICON" + exit 0 + fi - update_icons "$m" "$sid" + # Get icon from the mapping function + __icon_map "$APP_NAME" - update_icons "$m" "$PREV_WORKSPACE" + if [ -n "$icon_result" ]; then + echo "$APP_NAME|$icon_result" >>"$ICON_CACHE" + fi - apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | wc -l) - if [ "''${apps}" -eq 0 ]; then - sketchybar --set space.$sid display=0 - fi - done - done - ''; - }; + echo "$icon_result" + ''; + }; + colors = { + executable = true; + target = ".config/sketchybar/colors.sh"; + text = '' - plugins_space_click = { - executable = true; - target = ".config/sketchybar/plugins/space_click.sh"; - text = '' - #/usr/bin/env/ sh + export TRANSPARENT=0x00ffffff - apps=$(aerospace list-windows --workspace $1 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') - focused=$(aerospace list-workspaces --focused) + # -- Gray Scheme -- + export ITEM_COLOR=0xff000000 + export ACCENT_COLOR=0xffc3c6cb - if [ "''${apps}" = "" ] && [ "''${focused}" != "$1" ]; then - sketchybar --set space.$1 display=0 - else - aerospace workspace $1 - fi - ''; - }; - plugins_volume = { - executable = true; - target = ".config/sketchybar/plugins/volume.sh"; - text = '' - #!/usr/bin/env sh + # -- White Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xffffffff - # The volume_change event supplies a $INFO variable in which the current volume - # percentage is passed to the script. + # -- Teal Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xff2cf9ed - if [ "$SENDER" = "volume_change" ]; then + # -- Purple Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xffeb46f9 - VOLUME=$INFO + # -- Red Scheme --- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xffff2453 - case $VOLUME in - [6-9][0-9] | 100) - ICON="􀊩" - ;; - [3-5][0-9]) - ICON="􀊥" - ;; - [1-9] | [1-2][0-9]) - ICON="􀊡" - ;; - *) ICON="􀊣" ;; - esac + # -- Blue Scheme --- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xff15bdf9 - sketchybar --set $NAME icon="$ICON" label="$VOLUME%" - fi - ''; - }; - plugins_front_app = { - executable = true; - target = ".config/sketchybar/plugins/front_app.sh"; - text = '' - # Some events send additional information specific to the event in the $INFO - # variable. E.g. the front_app_switched event sends the name of the newly - # focused application in the $INFO variable: - # https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting + # -- Green Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xff1dfca1 + + # -- Orange Scheme -- + # export ITEM_COLOR=0xffffffff + # export ACCENT_COLOR=0xfff97716 + + # -- Yellow Scheme -- + # export ITEM_COLOR=0xff000000 + # export ACCENT_COLOR=0xfff7fc17 + ''; + }; + items_wifi = { + executable = true; + target = ".config/sketchybar/items/wifi.sh"; + text = '' + #!/usr/bin/env/ sh + + sketchybar --add item wifi right \ + --set wifi \ + icon="􀙥" \ + label="Updating..." \ + script="$PLUGIN_DIR/wifi.sh" \ + --subscribe wifi wifi_change + ''; + }; + items_battery = { + executable = true; + target = ".config/sketchybar/items/battery.sh"; + text = '' + #!/usr/bin/env/ sh + sketchybar --add item battery right \ + --set battery update_freq=180 \ + script="$PLUGIN_DIR/battery.sh" \ + --subscribe battery system_woke power_source_change + ''; + }; + items_calendar = { + executable = true; + target = ".config/sketchybar/items/calendar.sh"; + text = '' + #!/usr/bin/env sh + sketchybar --add item calendar right \ + --set calendar icon=􀧞 \ + update_freq=15 \ + script="$PLUGIN_DIR/calendar.sh" + ''; + }; + items_front_app = { + executable = true; + target = ".config/sketchybar/items/front_app.sh"; + text = '' + #!/usr/bin/env sh + + sketchybar --add item front_app left \ + --set front_app background.color=$ACCENT_COLOR \ + icon.color=$ITEM_COLOR \ + label.color=$ITEM_COLOR \ + icon.font="sketchybar-app-font:Regular:12.0" \ + label.font="SF Pro:Semibold:12.0" \ + script="$PLUGIN_DIR/front_app.sh" \ + --subscribe front_app front_app_switched + ''; + }; + items_spaces = { + executable = true; + target = ".config/sketchybar/items/spaces.sh"; + text = '' + sketchybar --add event aerospace_workspace_change + + sketchybar --add item aerospace_dummy left \ + --set aerospace_dummy display=0 \ + script="$PLUGIN_DIR/spaces.sh" \ + --subscribe aerospace_dummy aerospace_workspace_change - app_switched() { for m in $(aerospace list-monitors | awk '{print $1}'); do - for sid in $(aerospace list-workspaces --monitor $m --visible); do + for sid in $(aerospace list-workspaces --monitor $m); do + sketchybar --add space space.$sid left \ + --set space.$sid space=$sid \ + icon=$sid \ + background.color=$TRANSPARENT \ + label.color=$ACCENT_COLOR \ + icon.color=$ACCENT_COLOR \ + display=$m \ + label.font="sketchybar-app-font:Regular:12.0" \ + icon.font="SF Pro:Semibold:12.0" \ + label.padding_right=10 \ + label.y_offset=-1 \ + click_script="$PLUGIN_DIR/space_click.sh $sid" - apps=$( (echo "$INFO"; aerospace list-windows --monitor "$m" --workspace "$sid" \ - | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') \ - | awk '!seen[$0]++' | sort) + apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | + awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}') icon_strip="" if [ "''${apps}" != "" ]; then while read -r app; do - icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")" + icon_strip+=" $($PLUGIN_DIR/icons.sh "$app")" done <<<"''${apps}" else icon_strip=" —" fi - sketchybar --animate sin 10 --set space.$sid label="$icon_strip" + sketchybar --set space.$sid label="$icon_strip" + + done + + for empty_space in $(aerospace list-workspaces --monitor $m --empty); do + sketchybar --set space.$empty_space display=0 + done + for focus in $(aerospace list-workspaces --focused); do + sketchybar --set space.$focus background.drawing=on \ + background.color=$ACCENT_COLOR \ + label.color=$ITEM_COLOR \ + icon.color=$ITEM_COLOR done done - } + ''; + }; - if [ "$SENDER" = "front_app_switched" ]; then + items_volume = { + executable = true; + target = ".config/sketchybar/items/volume.sh"; + text = '' + #/usr/bin/env sh - sketchybar --set $NAME label="$INFO" icon="$($CONFIG_DIR/plugins/icons.sh "$INFO")" + sketchybar --add item volume right \ + --set volume script="$PLUGIN_DIR/volume.sh" \ + --subscribe volume volume_change + ''; + }; + plugins_wifi = { + executable = true; + target = ".config/sketchybar/plugins/wifi.sh"; + text = '' + #/usr/bin/env sh - app_switched - fi - ''; - }; - plugins_battery = { - executable = true; - target = ".config/sketchybar/plugins/battery.sh"; - text = '' - #!/usr/bin/env sh - source "$CONFIG_DIR/colors.sh" + SSID=$(system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }') - PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1) - CHARGING=$(pmset -g batt | grep 'AC Power') + if [ "$SSID" = "" ]; then + sketchybar --set $NAME icon="􀙈" label="Disconnected" + else + sketchybar --set $NAME icon="􀙇" label="$SSID" + fi - if [ $PERCENTAGE = "" ]; then - exit 0 - fi + ''; + }; + plugins_calendar = { + executable = true; + target = ".config/sketchybar/plugins/calendar.sh"; - case ''${PERCENTAGE} in - 9[0-9] | 100) - ICON="􀛨" - COLOR=$ITEM_COLOR - ;; - [6-8][0-9]) - ICON="􀺸" - COLOR=$ITEM_COLOR - ;; - [3-5][0-9]) - ICON="􀺶" - COLOR="0xFFd97706" - ;; - [1-2][0-9]) - ICON="􀛩" - COLOR="0xFFf97316" - ;; - *) - ICON="􀛪" - COLOR="0xFFef4444" - ;; - esac + text = '' + #/usr/bin/env sh - if [[ $CHARGING != "" ]]; then - ICON="􀢋" - COLOR=$ITEM_COLOR - fi + sketchybar --set $NAME label="$(date +'%a %d %b %I:%M %p')" + ''; + }; + plugins_spaces = { + executable = true; + target = ".config/sketchybar/plugins/spaces.sh"; + text = '' + #!/usr/bin/env sh - # The item invoking this script (name $NAME) will get its icon and label - # updated with the current battery status - sketchybar --set $NAME icon="$ICON" label="''${PERCENTAGE}%" icon.color="$COLOR" - ''; - }; - plugins_aerospace = { - executable = true; - target = ".config/sketchybar/plugins/aerospace.sh"; - text = '' - #!/usr/bin/env bash - source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors + source "$CONFIG_DIR/colors.sh" - highlight_focused_workspace() { - if [[ "$1" = "$FOCUSED_WORKSPACE" ]] - then - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=on label.width=0 + update_workspace_appearance() { + local sid=$1 + local is_focused=$2 + + if [ "$is_focused" = "true" ]; then + sketchybar --set space.$sid background.drawing=on \ + background.color=$ACCENT_COLOR \ + label.color=$ITEM_COLOR \ + icon.color=$ITEM_COLOR + else + sketchybar --set space.$sid background.drawing=off \ + label.color=$ACCENT_COLOR \ + icon.color=$ACCENT_COLOR + fi + } + + update_icons() { + m=$1 + sid=$2 + + apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" \ + | awk -F '|' '{gsub(/^ *| *$/, "", $2); if (!seen[$2]++) print $2}' \ + | sort) + + icon_strip="" + if [ "''${apps}" != "" ]; then + while read -r app; do + icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")" + done <<<"''${apps}" + else + icon_strip=" —" + fi + + sketchybar --animate sin 10 --set space.$sid label="$icon_strip" + } + + update_workspace_appearance "$PREV_WORKSPACE" "false" + update_workspace_appearance "$FOCUSED_WORKSPACE" "true" + + for m in $(aerospace list-monitors | awk '{print $1}'); do + for sid in $(aerospace list-workspaces --monitor $m --visible); do + sketchybar --set space.$sid display=$m + + update_icons "$m" "$sid" + + update_icons "$m" "$PREV_WORKSPACE" + + apps=$(aerospace list-windows --monitor "$m" --workspace "$sid" | wc -l) + if [ "''${apps}" -eq 0 ]; then + sketchybar --set space.$sid display=0 + fi + done + done + ''; + }; + + plugins_space_click = { + executable = true; + target = ".config/sketchybar/plugins/space_click.sh"; + text = '' + #/usr/bin/env/ sh + + apps=$(aerospace list-windows --workspace $1 | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') + focused=$(aerospace list-workspaces --focused) + + if [ "''${apps}" = "" ] && [ "''${focused}" != "$1" ]; then + sketchybar --set space.$1 display=0 else - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic + aerospace workspace $1 fi - } + ''; + }; + plugins_volume = { + executable = true; + target = ".config/sketchybar/plugins/volume.sh"; + text = '' + #!/usr/bin/env sh - illuminate_mode() { - if [[ "$mode" = "service" ]] - then - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE - elif [[ "$mode" = "resize" ]] - then - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN - else - ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1 + # The volume_change event supplies a $INFO variable in which the current volume + # percentage is passed to the script. + + if [ "$SENDER" = "volume_change" ]; then + + VOLUME=$INFO + + case $VOLUME in + [6-9][0-9] | 100) + ICON="􀊩" + ;; + [3-5][0-9]) + ICON="􀊥" + ;; + [1-9] | [1-2][0-9]) + ICON="􀊡" + ;; + *) ICON="􀊣" ;; + esac + + sketchybar --set $NAME icon="$ICON" label="$VOLUME%" fi - } - case "$SENDER" in - "aerospace_workspace_change") - highlight_focused_workspace $1 + ''; + }; + plugins_front_app = { + executable = true; + target = ".config/sketchybar/plugins/front_app.sh"; + text = '' + # Some events send additional information specific to the event in the $INFO + # variable. E.g. the front_app_switched event sends the name of the newly + # focused application in the $INFO variable: + # https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting + + app_switched() { + for m in $(aerospace list-monitors | awk '{print $1}'); do + for sid in $(aerospace list-workspaces --monitor $m --visible); do + + apps=$( (echo "$INFO"; aerospace list-windows --monitor "$m" --workspace "$sid" \ + | awk -F '|' '{gsub(/^ *| *$/, "", $2); print $2}') \ + | awk '!seen[$0]++' | sort) + + icon_strip="" + if [ "''${apps}" != "" ]; then + while read -r app; do + icon_strip+=" $($CONFIG_DIR/plugins/icons.sh "$app")" + done <<<"''${apps}" + else + icon_strip=" —" + fi + + sketchybar --animate sin 10 --set space.$sid label="$icon_strip" + done + done + } + + if [ "$SENDER" = "front_app_switched" ]; then + + sketchybar --set $NAME label="$INFO" icon="$($CONFIG_DIR/plugins/icons.sh "$INFO")" + + app_switched + fi + ''; + }; + plugins_battery = { + executable = true; + target = ".config/sketchybar/plugins/battery.sh"; + text = '' + #!/usr/bin/env sh + source "$CONFIG_DIR/colors.sh" + + PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1) + CHARGING=$(pmset -g batt | grep 'AC Power') + + if [ $PERCENTAGE = "" ]; then + exit 0 + fi + + case ''${PERCENTAGE} in + 9[0-9] | 100) + ICON="􀛨" + COLOR=$ITEM_COLOR ;; - "aerospace_mode_change") - illuminate_mode + [6-8][0-9]) + ICON="􀺸" + COLOR=$ITEM_COLOR ;; - esac - ''; - }; - } + [3-5][0-9]) + ICON="􀺶" + COLOR="0xFFd97706" + ;; + [1-2][0-9]) + ICON="􀛩" + COLOR="0xFFf97316" + ;; + *) + ICON="􀛪" + COLOR="0xFFef4444" + ;; + esac + + if [[ $CHARGING != "" ]]; then + ICON="􀢋" + COLOR=$ITEM_COLOR + fi + + # The item invoking this script (name $NAME) will get its icon and label + # updated with the current battery status + sketchybar --set $NAME icon="$ICON" label="''${PERCENTAGE}%" icon.color="$COLOR" + ''; + }; + plugins_aerospace = { + executable = true; + target = ".config/sketchybar/plugins/aerospace.sh"; + text = '' + #!/usr/bin/env bash + source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors + + highlight_focused_workspace() { + if [[ "$1" = "$FOCUSED_WORKSPACE" ]] + then + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=on label.width=0 + else + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic + fi + } + + illuminate_mode() { + if [[ "$mode" = "service" ]] + then + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE + elif [[ "$mode" = "resize" ]] + then + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN + else + ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1 + fi + } + case "$SENDER" in + "aerospace_workspace_change") + highlight_focused_workspace $1 + ;; + "aerospace_mode_change") + illuminate_mode + ;; + esac + ''; + }; + } ); } diff --git a/modules/macos/system.nix b/modules/macos/system.nix index 4dca169..7bea701 100644 --- a/modules/macos/system.nix +++ b/modules/macos/system.nix @@ -4,9 +4,11 @@ pkgs, lib, ... -}: let +}: +let tiling = config.shared.darwin.tiling.enable; -in { +in +{ # Use touchid or watch to activate sudo security.pam.services.sudo_local = { enable = true; diff --git a/modules/nixos/services.nix b/modules/nixos/services.nix index f0a8401..c48ebc1 100644 --- a/modules/nixos/services.nix +++ b/modules/nixos/services.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ services = { avahi = { enable = true; @@ -40,7 +41,7 @@ # Enable CUPS to print documents. printing = { enable = true; - drivers = [pkgs.brlaser]; # Brother printer driver + drivers = [ pkgs.brlaser ]; # Brother printer driver }; pipewire = { @@ -55,7 +56,7 @@ openssh = { enable = true; - ports = [22]; + ports = [ 22 ]; settings = { PasswordAuthentication = true; UseDns = true; diff --git a/modules/shared/nix.nix b/modules/shared/nix.nix index 596509a..1300a0f 100644 --- a/modules/shared/nix.nix +++ b/modules/shared/nix.nix @@ -1,4 +1,5 @@ -{inputs, ...}: { +{ inputs, ... }: +{ nixpkgs.config = { allowUnfree = true; }; diff --git a/users/natalie/desktop/configuration.nix b/users/natalie/desktop/configuration.nix index 1e0d3fc..f4f95c2 100644 --- a/users/natalie/desktop/configuration.nix +++ b/users/natalie/desktop/configuration.nix @@ -3,7 +3,8 @@ user, host, ... -}: { +}: +{ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -17,7 +18,7 @@ enable = true; # Certain features, including CLI integration and system authentication support, # require enabling PolKit integration on some desktop environments (e.g. Plasma). - polkitPolicyOwners = [user.username]; + polkitPolicyOwners = [ user.username ]; }; noisetorch.enable = true; @@ -34,7 +35,7 @@ steam = { enable = true; - package = with pkgs; steam.override {extraPkgs = pkgs: [attr];}; + package = with pkgs; steam.override { extraPkgs = pkgs: [ attr ]; }; }; git = { @@ -58,7 +59,7 @@ xdg.portal = { enable = true; - extraPortals = with pkgs; [xdg-desktop-portal-gtk]; + extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; }; virtualisation = { containers.enable = true; @@ -83,14 +84,14 @@ hybrid-sleep.enable = false; }; - services.monitord.wantedBy = ["multi-user.target"]; + services.monitord.wantedBy = [ "multi-user.target" ]; }; i18n = { # Select internationalisation properties. defaultLocale = "en_US.UTF-8"; - supportedLocales = ["all"]; + supportedLocales = [ "all" ]; extraLocaleSettings = { LC_ADDRESS = "en_US.UTF-8"; @@ -170,7 +171,7 @@ }; interfaces.enp11s0.wakeOnLan = { enable = true; - policy = ["magic"]; + policy = [ "magic" ]; }; }; diff --git a/users/natalie/desktop/home.nix b/users/natalie/desktop/home.nix index d3aa825..10d4da9 100644 --- a/users/natalie/desktop/home.nix +++ b/users/natalie/desktop/home.nix @@ -8,6 +8,7 @@ ... }: { + programs.mangohud.enable = true; home = { stateVersion = "23.05"; # Please read the comment before changing. @@ -29,6 +30,7 @@ wineWowPackages.stable winetricks (prismlauncher.override { gamemodeSupport = true; }) + umu-launcher #window manager stuff wofi @@ -50,8 +52,8 @@ signal-desktop inputs.zls.packages.x86_64-linux.zls rust-bin.stable.latest.default + inputs.zen-browser.packages.x86_64-linux.default ]; - # programs.mangohud.enable = true; }; # xdg.mimeApps.defaultApplications."inode/directory" = "dolphin.desktop"; diff --git a/users/natalie/home.nix b/users/natalie/home.nix index 230fe96..526e94c 100644 --- a/users/natalie/home.nix +++ b/users/natalie/home.nix @@ -2,7 +2,8 @@ pkgs, lib, ... -} @ args: { +}@args: +{ programs = { # sort-lines:start atuin.enable = true; diff --git a/users/natalie/laptop/configuration.nix b/users/natalie/laptop/configuration.nix index b4c7312..1d8bff8 100644 --- a/users/natalie/laptop/configuration.nix +++ b/users/natalie/laptop/configuration.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ environment.systemPackages = with pkgs; [ pinentry_mac ]; @@ -6,7 +7,7 @@ # Custom configuration modules in "modules" are shared between users, # and can be configured in this "shared" namespace shared.darwin = { - macAppStoreApps = ["wireguard"]; + macAppStoreApps = [ "wireguard" ]; }; # Create /etc/zshrc that loads the nix-darwin environment. diff --git a/users/natalie/vim/default.nix b/users/natalie/vim/default.nix index 7568a91..9afa34b 100644 --- a/users/natalie/vim/default.nix +++ b/users/natalie/vim/default.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ imports = [ ./keybinds.nix ./languages.nix diff --git a/users/natalie/vim/lean.nix b/users/natalie/vim/lean.nix index 8503935..45fb293 100644 --- a/users/natalie/vim/lean.nix +++ b/users/natalie/vim/lean.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ vim = { lazy.plugins."lean.nvim" = { enabled = true; diff --git a/users/natalie/vim/visuals.nix b/users/natalie/vim/visuals.nix index a4f0ac6..9cb6d77 100644 --- a/users/natalie/vim/visuals.nix +++ b/users/natalie/vim/visuals.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ vim = { visuals = { indent-blankline = { From bef0fb01c2d817455c311392f180e270b6af4c1e Mon Sep 17 00:00:00 2001 From: Natalie Date: Wed, 28 May 2025 12:33:47 -0700 Subject: [PATCH 09/12] remove aws-sdk from lix deps --- users/natalie/packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/natalie/packages.nix b/users/natalie/packages.nix index c555a66..a7ef31e 100644 --- a/users/natalie/packages.nix +++ b/users/natalie/packages.nix @@ -34,6 +34,7 @@ with pkgs; #nix tools direnv nh + (lix.override { aws-sdk-cpp = null; }) #terminal stuff (btop.override { cudaSupport = true; }) From 381a06acdfa49cf25f6861a8c203480e6d7ab4f1 Mon Sep 17 00:00:00 2001 From: Natalie Date: Thu, 12 Jun 2025 15:14:43 -0700 Subject: [PATCH 10/12] various things i forgot to commit --- modules/home/default.nix | 2 +- users/natalie/laptop/configuration.nix | 2 + users/natalie/user.nix | 2 +- users/natalie/vim.nix | 4 + users/natalie/vim/coq.nix | 16 ++++ users/natalie/vim/default.nix | 2 + users/natalie/vim/keybinds.nix | 1 - users/natalie/vim/languages.nix | 104 ++++++++++++++++--------- users/natalie/vim/mini.nix | 9 +++ users/natalie/vim/visuals.nix | 16 ++++ 10 files changed, 120 insertions(+), 38 deletions(-) create mode 100644 users/natalie/vim/coq.nix create mode 100644 users/natalie/vim/mini.nix diff --git a/modules/home/default.nix b/modules/home/default.nix index 98635b4..773ddfe 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -86,8 +86,8 @@ in }; shellInit = '' batman --export-env | source + test -r '/Users/${user.username}/.opam/opam-init/init.fish' && source '/Users/${user.username}/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true ''; - ##test -r '/Users/${user.username}/.opam/opam-init/init.fish' && source '/Users/${user.username}/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true }; }; } diff --git a/users/natalie/laptop/configuration.nix b/users/natalie/laptop/configuration.nix index 1d8bff8..73243ce 100644 --- a/users/natalie/laptop/configuration.nix +++ b/users/natalie/laptop/configuration.nix @@ -10,6 +10,8 @@ macAppStoreApps = [ "wireguard" ]; }; + system.defaults.NSGlobalDomain."com.apple.trackpad.scaling" = 1.0; + # Create /etc/zshrc that loads the nix-darwin environment. programs = { gnupg.agent.enable = true; diff --git a/users/natalie/user.nix b/users/natalie/user.nix index 3eeea53..318a692 100644 --- a/users/natalie/user.nix +++ b/users/natalie/user.nix @@ -7,7 +7,7 @@ rec { browser = "firefox"; # Default browser; must select one from ./user/app/browser/ term = "ghostty"; # Default terminal command; font = "iosevka"; # Selected font - editor = "neovim"; # Default editor; + editor = "nvim"; # Default editor; timeZone = "America/Los_Angeles"; sexuality = "bisexual"; } diff --git a/users/natalie/vim.nix b/users/natalie/vim.nix index c1427ee..a642b93 100644 --- a/users/natalie/vim.nix +++ b/users/natalie/vim.nix @@ -4,6 +4,10 @@ ./vim/default.nix ]; vim = { + #enable python provider + withPython3 = true; + python3Packages = [ "pynvim" ]; + options = { tabstop = 2; softtabstop = 2; diff --git a/users/natalie/vim/coq.nix b/users/natalie/vim/coq.nix new file mode 100644 index 0000000..a0ddbba --- /dev/null +++ b/users/natalie/vim/coq.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + + vim = { + # extraPackages = with pkgs; [ + # coq_8_20 + # coqPackages_8_20.stdlib + # ]; + extraPlugins.Coqtail = { + # enabled = true; + package = pkgs.vimPlugins.Coqtail; + # lazy = true; + # ft = "coq"; + }; + }; +} diff --git a/users/natalie/vim/default.nix b/users/natalie/vim/default.nix index 9afa34b..8c7f50b 100644 --- a/users/natalie/vim/default.nix +++ b/users/natalie/vim/default.nix @@ -5,6 +5,8 @@ ./languages.nix ./latex.nix ./lean.nix + ./coq.nix ./visuals.nix + ./mini.nix ]; } diff --git a/users/natalie/vim/keybinds.nix b/users/natalie/vim/keybinds.nix index 619dec4..7ea6545 100644 --- a/users/natalie/vim/keybinds.nix +++ b/users/natalie/vim/keybinds.nix @@ -19,7 +19,6 @@ in (mkKeymap "n" "ff" ":lua require('snacks').picker.files()" "Find File") (mkKeymap "n" "fg" ":lua require('snacks').picker.grep()" "Grep Files") # Lsp - (mkKeymap "n" "K" ":Lspsaga hover_doc" "Hover docs") (mkKeymap "n" "lr" ":lua vim.lsp.buf.rename()" "Rename") # (mkKeymap "n" "th" ":lua function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end" "Toggle Inlay Hints") ]; diff --git a/users/natalie/vim/languages.nix b/users/natalie/vim/languages.nix index 077a138..7ef549c 100644 --- a/users/natalie/vim/languages.nix +++ b/users/natalie/vim/languages.nix @@ -5,49 +5,57 @@ pkgs, ... }: -let - darwin = if host.darwin then "darwin" else "nixos"; - flakePath = "/${if host.darwin then "Users" else "home"}/${user.username}/.dotfiles"; - - # BIG HACK DO NOT DO PLS - - hostname = if host.darwin then "Natalies-MacBook-Air" else "nixos"; -in { vim = { extraPackages = with pkgs; [ python312Packages.pylatexenc + nixd ]; lsp = { lightbulb.enable = false; - lspsaga = { - enable = true; - setupOpts = { - lightbulb = { - virtual_text = false; + # lspsaga = { + # enable = true; + # setupOpts = { + # lightbulb = { + # virtual_text = false; + # }; + # }; + # }; + inlayHints.enable = true; + servers = { + nil = { + settings.nil.nix.flake = { + + autoArchive = true; + autoEvalInputs = true; + }; }; - }; - nvim-docs-view.enable = true; - inlayHints.enable = true; - servers.nixd.settings.nixd = { - nixpkgs.expr = ''import "" { }''; - options = - { - home-manager = { - expr = ''(builtins.getFlake "${flakePath}").${darwin}Configurations.${hostname}.options.home-manager.users.type.getSubOptions [ ]''; - }; - } - // pkgs.lib.optionalAttrs host.darwin { - nix-darwin = { - expr = ''(builtins.getFlake "${flakePath}").darwinConfigurations.${hostname}.options''; - }; - } - // pkgs.lib.optionalAttrs host.linux { - nixos = { - expr = ''(builtins.getFlake "${flakePath}").nixosConfigurations.${hostname}.options''; - }; + nixd = { + settings.nixd = { + nixpkgs.expr = ''import "${flake.inputs.nixpkgs}" { }''; + + options = + { + home-manager = { + expr = ''(let pkgs = import "${flake.inputs.nixpkgs}" { }; lib = import "${flake.inputs.home-manager}/modules/lib/stdlib-extended.nix" pkgs.lib; in (lib.evalModules { modules = (import "${flake.inputs.home-manager}/modules/modules.nix") { inherit lib pkgs;check = false;}; })).options''; + # (builtins.getFlake "${flakePath}").${darwin}Configurations.${hostname}.options.home-manager.users.type.getSubOptions [ ]''; + }; + } + // pkgs.lib.optionalAttrs host.darwin { + nix-darwin = { + expr = ''(let pkgs = import "${flake.inputs.nixpkgs}" { }; in (pkgs.lib.evalModules { modules = (import "${flake.inputs.darwin}/modules/module-list.nix"); check = false;})).options''; + # (builtins.getFlake "${flakePath}").darwinConfigurations.${hostname}.options''; + }; + } + // pkgs.lib.optionalAttrs host.linux { + nixos = { + expr = ''(let pkgs = import "${flake.inputs.nixpkgs}" { }; in (pkgs.lib.evalModules { modules = (import "${flake.inputs.nixpkgs}/nixos/modules/module-list.nix"); check = false;})).options''; + # (builtins.getFlake "${flakePath}").nixosConfigurations.${hostname}.options''; + }; + }; }; + }; }; mappings = { codeAction = "ca"; @@ -55,7 +63,7 @@ in goToDefinition = "gd"; listReferences = "gr"; goToType = "gy"; - hover = null; + hover = "K"; nextDiagnostic = "d"; openDiagnosticFloat = "df"; renameSymbol = "rn"; @@ -91,7 +99,6 @@ in }; }; }; - diagnostics = { enable = true; config = { @@ -177,5 +184,32 @@ in }; }; }; + + lazy.plugins."blink.pairs" = { + enabled = true; + package = pkgs.vimPlugins.blink-pairs; + setupModule = "blink.pairs"; + setupOpts = { + mappings = { + # -- you can call require("blink.pairs.mappings").enable() and require("blink.pairs.mappings").disable() to enable/disable mappings at runtime + enabled = true; + # -- see the defaults: https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#L10 + pairs = [ ]; + }; + highlights = { + enabled = true; + groups = [ + "BlinkPairsOrange" + "BlinkPairsPurple" + "BlinkPairsBlue" + ]; + matchparen = { + enabled = true; + group = "MatchParen"; + }; + }; + debug = false; + }; + }; }; } diff --git a/users/natalie/vim/mini.nix b/users/natalie/vim/mini.nix new file mode 100644 index 0000000..269036b --- /dev/null +++ b/users/natalie/vim/mini.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +{ + vim = { + mini = { + icons.enable = true; + ai.enable = true; + }; + }; +} diff --git a/users/natalie/vim/visuals.nix b/users/natalie/vim/visuals.nix index 9cb6d77..357fb36 100644 --- a/users/natalie/vim/visuals.nix +++ b/users/natalie/vim/visuals.nix @@ -7,6 +7,22 @@ }; }; ui = { + noice = { + enable = true; + setupOpts = { + lsp = { + progress.enabled = false; + signature.enabled = true; + }; + presets = { + lsp_doc_border = true; + long_message_to_split = true; + inc_rename = false; + command_palette = false; + bottom_search = true; + }; + }; + }; borders = { enable = true; }; From d6ce08fa89bb2cc444800c21b441810524b54967 Mon Sep 17 00:00:00 2001 From: Natalie Marks Date: Wed, 2 Jul 2025 15:45:43 -0700 Subject: [PATCH 11/12] added devenv --- users/natalie/packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/natalie/packages.nix b/users/natalie/packages.nix index a7ef31e..8fde40e 100644 --- a/users/natalie/packages.nix +++ b/users/natalie/packages.nix @@ -24,6 +24,7 @@ with pkgs; qemu podman docker + devenv #productivity glance From 680b8090626fbdb0c62d2894c9a61b95286a9c1f Mon Sep 17 00:00:00 2001 From: Natalie Marks Date: Fri, 4 Jul 2025 21:30:20 -0700 Subject: [PATCH 12/12] update flake inputs --- flake.lock | 123 +++++++++++++------------------- users/natalie/vim.nix | 3 +- users/natalie/vim/languages.nix | 2 + 3 files changed, 52 insertions(+), 76 deletions(-) diff --git a/flake.lock b/flake.lock index fd97db6..6099bbc 100644 --- a/flake.lock +++ b/flake.lock @@ -15,11 +15,11 @@ "sf-pro": "sf-pro" }, "locked": { - "lastModified": 1740961576, - "narHash": "sha256-9L6d3owtajM72YvUOpK1zYle2nM0BpsuopbF9lm9lJs=", + "lastModified": 1748299691, + "narHash": "sha256-HMlx5HzeOOhpewq3y9UaSMP9AkhEo+AFJHZIWLQvJGw=", "owner": "Lyndeno", "repo": "apple-fonts.nix", - "rev": "4df58996ed654f6ce9b71b41c1826484c6870739", + "rev": "ec51ae2e8ba89adbb5188c40aa262a7418c48b00", "type": "github" }, "original": { @@ -35,11 +35,11 @@ ] }, "locked": { - "lastModified": 1747820204, - "narHash": "sha256-oY/mH8K1LOd+YbO58sw9ORtOdTxy3rR9lvTzOJKVUtA=", + "lastModified": 1751313918, + "narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "e2676937faf868111dcea6a4a9cf4b6549907c9d", + "rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf", "type": "github" }, "original": { @@ -86,11 +86,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", "type": "github" }, "original": { @@ -284,11 +284,11 @@ ] }, "locked": { - "lastModified": 1747834438, - "narHash": "sha256-AHJt79W8wADzur2htCx1U8FtEk4XjvrHb9/3iDfNedI=", + "lastModified": 1751489990, + "narHash": "sha256-ENTd/sd4Vz/VJYn14SVqW1OH2m7WIAvsm9A9SrmDZRY=", "owner": "nix-community", "repo": "home-manager", - "rev": "6c2eb1e24cd0e76d88bdd633ef4c50d6286586e0", + "rev": "89af52d9a893af013f5f4c1d2d56912106827153", "type": "github" }, "original": { @@ -338,7 +338,7 @@ "narHash": "sha256-11R4K3iAx4tLXjUs+hQ5K90JwDABD/XHhsM9nkeS5N8=", "rev": "cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc.tar.gz" + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc.tar.gz?rev=cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc" }, "original": { "type": "tarball", @@ -347,11 +347,11 @@ }, "mnw": { "locked": { - "lastModified": 1748278309, - "narHash": "sha256-JCeiMrUhFku44kfKsgiD9Ibzho4MblBD2WmOQYsQyTY=", + "lastModified": 1748710831, + "narHash": "sha256-eZu2yH3Y2eA9DD3naKWy/sTxYS5rPK2hO7vj8tvUCSU=", "owner": "Gerg-L", "repo": "mnw", - "rev": "486a17ba1279ab2357cae8ff66b309db622f8831", + "rev": "cff958a4e050f8d917a6ff3a5624bc4681c6187d", "type": "github" }, "original": { @@ -368,11 +368,11 @@ ] }, "locked": { - "lastModified": 1747413594, - "narHash": "sha256-cFsVYlIkSNEpGw4qT9Eea6sa1+dZyaCRZNrgQTc8wu4=", + "lastModified": 1750621684, + "narHash": "sha256-E8iHTYK9iUtIjYgBNj54Xeulj9WaxSGDbzOLLFhCSqA=", "owner": "moonlight-mod", "repo": "moonlight", - "rev": "fc7c0119e923d50ce8873ea654fa7542f60be27f", + "rev": "9398874e59f5e2b8485c489ce6c0f6c9c7d210a0", "type": "github" }, "original": { @@ -388,11 +388,11 @@ ] }, "locked": { - "lastModified": 1748096601, - "narHash": "sha256-ji/9z1pRbosyKVVAIGBazyz6PjWV8bc2Ux2RdQrVDWY=", + "lastModified": 1751375534, + "narHash": "sha256-9z1W64dDVtVxqgPzUbjIQqRfygg1hdivUOZ6d/H+yFg=", "owner": "viperML", "repo": "nh", - "rev": "1ea27e73a3dcbc9950258e9054377ee677d12b9e", + "rev": "d0abb8eebe32f79ce4659e68dd777cf497a5d3d2", "type": "github" }, "original": { @@ -403,22 +403,17 @@ }, "nil": { "inputs": { - "flake-utils": [ - "nvf", - "flake-utils" - ], "nixpkgs": [ "nvf", "nixpkgs" - ], - "rust-overlay": "rust-overlay" + ] }, "locked": { - "lastModified": 1741118843, - "narHash": "sha256-ggXU3RHv6NgWw+vc+HO4/9n0GPufhTIUjVuLci8Za8c=", + "lastModified": 1750047244, + "narHash": "sha256-vluLARrk4485npdyHOj8XKr0yk6H22pNf+KVRNL+i/Y=", "owner": "oxalica", "repo": "nil", - "rev": "577d160da311cc7f5042038456a0713e9863d09e", + "rev": "870a4b1b5f12004832206703ac15aa85c42c247b", "type": "github" }, "original": { @@ -434,11 +429,11 @@ ] }, "locked": { - "lastModified": 1747540584, - "narHash": "sha256-cxCQ413JTUuRv9Ygd8DABJ1D6kuB/nTfQqC0Lu9C0ls=", + "lastModified": 1751170039, + "narHash": "sha256-3EKpUmyGmHYA/RuhZjINTZPU+OFWko0eDwazUOW64nw=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "ec179dd13fb7b4c6844f55be91436f7857226dce", + "rev": "9c932ae632d6b5150515e5749b198c175d8565db", "type": "github" }, "original": { @@ -485,11 +480,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1743296961, - "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "lastModified": 1748740939, + "narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "rev": "656a64127e9d791a334452c6b6606d17539476e2", "type": "github" }, "original": { @@ -500,11 +495,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1747744144, - "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", + "lastModified": 1751271578, + "narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", + "rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df", "type": "github" }, "original": { @@ -557,11 +552,11 @@ "systems": "systems_5" }, "locked": { - "lastModified": 1748318168, - "narHash": "sha256-pUDVxHarStrDYxd2tztz4SjNflzFxuMMEC3SK9WLUK8=", + "lastModified": 1751186226, + "narHash": "sha256-Bt7jtmCW72JUPxOIrV73qBTAUOy4qvJXsls2ERDUcGo=", "owner": "notashelf", "repo": "nvf", - "rev": "74ba4d955976af1422ea1f095968e547db70aa04", + "rev": "5bad5dd94ce5ea3b40b08d9e6802e69d02198d21", "type": "github" }, "original": { @@ -594,7 +589,7 @@ "nix-options-search": "nix-options-search", "nixpkgs": "nixpkgs_2", "nvf": "nvf", - "rust-overlay": "rust-overlay_2", + "rust-overlay": "rust-overlay", "zen-browser": "zen-browser", "zig": "zig", "zls": "zls" @@ -603,37 +598,15 @@ "rust-overlay": { "inputs": { "nixpkgs": [ - "nvf", - "nil", "nixpkgs" ] }, "locked": { - "lastModified": 1741055476, - "narHash": "sha256-52vwEV0oS2lCnx3c/alOFGglujZTLmObit7K8VblnS8=", + "lastModified": 1751423951, + "narHash": "sha256-AowKhJGplXRkAngSvb+32598DTiI6LOzhAnzgvbCtYM=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "aefb7017d710f150970299685e8d8b549d653649", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_2": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1747795013, - "narHash": "sha256-c7i0xJ+xFhgjO9SWHYu5dF/7lq63RPDvwKAdjc6VCE4=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "6b1cf12374361859242a562e1933a7930649131a", + "rev": "1684ed5b15859b655caf41b467d046e29a994d04", "type": "github" }, "original": { @@ -853,11 +826,11 @@ ] }, "locked": { - "lastModified": 1748059546, - "narHash": "sha256-e0jy8RU8ofOdeS5gF9Hir+M5Wn0q7D8MkpeQXsOJdu4=", + "lastModified": 1751256876, + "narHash": "sha256-4A8LmE0Hd9RvQwSEPYdITJebpLt7J99VY76IphzqZKc=", "owner": "youwen5", "repo": "zen-browser-flake", - "rev": "716a5af28d686d67146d01b14112c919b6133a84", + "rev": "615b9244dc7ac777b8f0bc3a9cb7290936e4fcf9", "type": "github" }, "original": { @@ -873,11 +846,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1747829603, - "narHash": "sha256-H8Vj7GSOyHgAUTDM/EkkdiTyEZg2C1UUlsp/fDSbxNQ=", + "lastModified": 1751458413, + "narHash": "sha256-eyKdTzRaY4blNs/GVJODh4E+16wpEKmlnQUpGf9e9gc=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "53899a028ece2f77939c08c59d547416a59086c0", + "rev": "4f33e11d99060c5cb2bdc380a11a9b23858dcfde", "type": "github" }, "original": { diff --git a/users/natalie/vim.nix b/users/natalie/vim.nix index a642b93..c58abf2 100644 --- a/users/natalie/vim.nix +++ b/users/natalie/vim.nix @@ -3,6 +3,7 @@ imports = [ ./vim/default.nix ]; + vim = { #enable python provider withPython3 = true; @@ -57,7 +58,7 @@ ]; binds = { hardtime-nvim = { - enable = true; + enable = false; setupOpts = { disable_mouse = false; restriction_mode = "warn"; diff --git a/users/natalie/vim/languages.nix b/users/natalie/vim/languages.nix index 7ef549c..630dacd 100644 --- a/users/natalie/vim/languages.nix +++ b/users/natalie/vim/languages.nix @@ -12,6 +12,7 @@ nixd ]; lsp = { + formatOnSave = true; lightbulb.enable = false; # lspsaga = { # enable = true; @@ -88,6 +89,7 @@ enable = true; }; }; + nix.format.enable = true; }; formatter.conform-nvim = {