diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 00000000..d2cf8f58 --- /dev/null +++ b/.zed/settings.json @@ -0,0 +1,8 @@ +{ + "formatter": { + "external": { + "command": "direnv", + "arguments": ["exec", ".", "treefmt", "--stdin", "{buffer_path}"] + } + } +} diff --git a/flake.nix b/flake.nix index 1a801647..46cee133 100644 --- a/flake.nix +++ b/flake.nix @@ -70,9 +70,13 @@ flake-compat.flake = false; }; - outputs = inputs@{ self, flake-parts, ... }: + outputs = + inputs@{ self, flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { - systems = [ "x86_64-linux" "aarch64-darwin" ]; + systems = [ + "x86_64-linux" + "aarch64-darwin" + ]; imports = [ ./lib diff --git a/hosts/default.nix b/hosts/default.nix index 9b33b816..68add135 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,6 +1,8 @@ { self, ... }: -let inherit (self.lib.darwin) mkDarwinConfiguration; -in { +let + inherit (self.lib.darwin) mkDarwinConfiguration; +in +{ flake.darwinConfigurations = { eMac = mkDarwinConfiguration { system = "aarch64-darwin"; diff --git a/hosts/eMac/configuration.nix b/hosts/eMac/configuration.nix index 26fbe4fd..371fcf3b 100644 --- a/hosts/eMac/configuration.nix +++ b/hosts/eMac/configuration.nix @@ -1,6 +1,16 @@ -{ lib, suites, profiles, ... }: { - imports = with suites; - base ++ fonts ++ identity ++ [ +{ + lib, + suites, + profiles, + ... +}: +{ + imports = + with suites; + base + ++ fonts + ++ identity + ++ [ profiles.users.ethan profiles.builders.builder profiles.builders.darwin-linux @@ -24,7 +34,12 @@ taps = [ "homebrew/services" ]; - casks = [ "steam" "utm" "vlc" "zoom" ]; + casks = [ + "steam" + "utm" + "vlc" + "zoom" + ]; masApps = { "Paprika Recipe Manager 3" = 1303222628; diff --git a/hosts/mercury/configuration.nix b/hosts/mercury/configuration.nix index c5b95d38..df0a375a 100644 --- a/hosts/mercury/configuration.nix +++ b/hosts/mercury/configuration.nix @@ -1,7 +1,13 @@ -{ suites, profiles, secrets, ... }: { - imports = with suites; - base ++ fonts ++ [ secrets.hosts.mercury.configuration ] - ++ [ profiles.users.et ]; +{ + suites, + profiles, + secrets, + ... +}: +{ + imports = + with suites; + base ++ fonts ++ [ secrets.hosts.mercury.configuration ] ++ [ profiles.users.et ]; tilde.host.directory = "/Users/et/Workspace/tilde"; @@ -15,7 +21,14 @@ }; homebrew = { - casks = [ "bruno" "figma" "jabra-direct" "linear" "loom" "postico" ]; + casks = [ + "bruno" + "figma" + "jabra-direct" + "linear" + "loom" + "postico" + ]; masApps = { "Flow" = 1423210932; diff --git a/lib/compat/default.nix b/lib/compat/default.nix index 81fb3310..e9ad08f5 100644 --- a/lib/compat/default.nix +++ b/lib/compat/default.nix @@ -1,6 +1,9 @@ -(import (let lock = builtins.fromJSON (builtins.readFile ../../flake.lock); -in fetchTarball { - url = - "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; - sha256 = lock.nodes.flake-compat.locked.narHash; -}) { src = ../../.; }) +(import ( + let + lock = builtins.fromJSON (builtins.readFile ../../flake.lock); + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } +) { src = ../../.; }) diff --git a/lib/default.nix b/lib/default.nix index ef49fa71..fc743b60 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,4 +1,9 @@ -{ inputs, self, withSystem, ... }: +{ + inputs, + self, + withSystem, + ... +}: let haumea = inputs.haumea.lib; lib = haumea.load { @@ -8,4 +13,7 @@ let flake = self; }; }; -in { flake.lib = lib; } +in +{ + flake.lib = lib; +} diff --git a/lib/src/darwin.nix b/lib/src/darwin.nix index a57ef9da..3c7591cb 100644 --- a/lib/src/darwin.nix +++ b/lib/src/darwin.nix @@ -5,21 +5,34 @@ let l = inputs.nixpkgs.lib // builtins; - sharedModules = (l.attrValues flake.darwinModules) ++ (with inputs; [ - home-manager.darwinModules.home-manager - sops-nix.darwinModules.sops - ]); + sharedModules = + (l.attrValues flake.darwinModules) + ++ (with inputs; [ + home-manager.darwinModules.home-manager + sops-nix.darwinModules.sops + ]); specialArgs = { - inherit flake inputs secrets homeConfigurations; + inherit + flake + inputs + secrets + homeConfigurations + ; suites = flake.suites.darwin; profiles = flake.profiles.darwin; }; - mkDarwinConfiguration = { system, configuration }: - withSystem system ({ pkgs, ... }: + mkDarwinConfiguration = + { system, configuration }: + withSystem system ( + { pkgs, ... }: inputs.nix-darwin.lib.darwinSystem { inherit pkgs system specialArgs; modules = sharedModules ++ [ configuration ]; - }); -in { inherit mkDarwinConfiguration; } + } + ); +in +{ + inherit mkDarwinConfiguration; +} diff --git a/lib/src/hm.nix b/lib/src/hm.nix index bb6d2ed9..99ab6432 100644 --- a/lib/src/hm.nix +++ b/lib/src/hm.nix @@ -5,8 +5,8 @@ let l = inputs.nixpkgs.lib // builtins; - sharedModules = l.attrValues flake.homeModules - ++ (with inputs; [ sops-nix.homeManagerModules.sops ]); + sharedModules = + l.attrValues flake.homeModules ++ (with inputs; [ sops-nix.homeManagerModules.sops ]); extraSpecialArgs = { inherit flake inputs secrets; @@ -14,11 +14,17 @@ let profiles = flake.profiles.home; }; - mkHomeManagerConfiguration = { system, configuration }: - withSystem system ({ pkgs, ... }: + mkHomeManagerConfiguration = + { system, configuration }: + withSystem system ( + { pkgs, ... }: inputs.home-manager.lib.homeManagerConfiguration { inherit pkgs extraSpecialArgs; modules = sharedModules ++ [ configuration ]; - }); + } + ); -in { inherit sharedModules extraSpecialArgs mkHomeManagerConfiguration; } +in +{ + inherit sharedModules extraSpecialArgs mkHomeManagerConfiguration; +} diff --git a/lib/src/utils.nix b/lib/src/utils.nix index 55ec258f..3fce150e 100644 --- a/lib/src/utils.nix +++ b/lib/src/utils.nix @@ -7,23 +7,31 @@ let # # Type: # tree :: { [ name :: string ] :: ( leaf :: (T | ( branch :: ( leaf | tree )))), ... } -> { string -> leaf } - flattenTree = tree: + flattenTree = + tree: let - inherit (builtins) concatStringsSep isPath isAttrs foldl' attrNames; + inherit (builtins) + concatStringsSep + isPath + isAttrs + foldl' + attrNames + ; # Takes an accumulator attribute set, a path in the form of a list of strings, and a value of what is at that # path (either an attribute set, meaning a subdirectory; a path, meaning it's a file; or nothing, meaning it's an # empty directory). Will turn the path into a dot-separated string (`foo/bar/biz` turns into `foo.bar.biz`) and # will recurse over the subdirectory if it's an attribute set, add to our accumulator if it's a file, or just # return the accumulator if it's neither - flatten = acc: path: leaf: + flatten = + acc: path: leaf: # If the value is a path, then format the path as a dot-separated string and add this path and value to the if isPath leaf then (acc // { "${concatStringsSep "." path}" = leaf; }) - # If the value is a set of attributes, this means there is a subtree -- run again for those attributes + # If the value is a set of attributes, this means there is a subtree -- run again for those attributes else if isAttrs leaf then (recurse acc path leaf) - # If it's not a value or a path (meaning null), just return the accumulated results without doing anything + # If it's not a value or a path (meaning null), just return the accumulated results without doing anything else acc; @@ -34,12 +42,13 @@ let # # `flatten` against that path and leaf # let op = acc: leaf: (flatten (acc (path ++ [ leaf ]) tree.${leaf})); # in foldl' (op acc (attrNames tree)); - recurse = acc: path: leaf: - foldl' (acc: key: flatten acc (path ++ [ key ]) leaf.${key}) acc - (attrNames leaf); + recurse = + acc: path: leaf: + foldl' (acc: key: flatten acc (path ++ [ key ]) leaf.${key}) acc (attrNames leaf); # Call `recurse`, starting with an empty accumulator, an empty path, and a tree to run the function against - in recurse { } [ ] tree; + in + recurse { } [ ] tree; # Flattens attribute set of modules into a key-value set of dot-separated paths as keys and imported paths as values # @@ -50,6 +59,8 @@ let # attrset :: { # [ name :: string ] :: ( leaf :: (T | ( branch :: ( leaf | tree )))), ... # } -> { string -> path } - importModules = attrset: - builtins.mapAttrs (_: value: (import value)) (flattenTree attrset); -in { inherit importModules; } + importModules = attrset: builtins.mapAttrs (_: value: (import value)) (flattenTree attrset); +in +{ + inherit importModules; +} diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index fe0b7d28..b62a4ad0 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -2,9 +2,12 @@ let inherit (self.lib) utils; inherit (self.inputs) haumea; -in { - flake.darwinModules = utils.importModules (haumea.lib.load { - src = ./src; - loader = haumea.lib.loaders.path; - }); +in +{ + flake.darwinModules = utils.importModules ( + haumea.lib.load { + src = ./src; + loader = haumea.lib.loaders.path; + } + ); } diff --git a/modules/development/ci.nix b/modules/development/ci.nix index 03fe1b3f..d8decb03 100644 --- a/modules/development/ci.nix +++ b/modules/development/ci.nix @@ -1,132 +1,141 @@ { self, inputs, ... }: -let l = inputs.nixpkgs.lib // builtins; -in { +let + l = inputs.nixpkgs.lib // builtins; +in +{ imports = [ inputs.actions-nix.flakeModules.default ]; - flake.actions-nix.workflows = let - actions = { - checkout = "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"; - install-lix = - "samueldr/lix-gha-installer-action@7b7f14d320d6aacfb65bd1ef761566b3b69e474c"; - ssh-agent = - "webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555"; - attic = "ryanccn/attic-action@1887fd507f03327c96c64cca30118c96eb17fdad"; - cachix = "cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c"; - }; - setup = [ - { - name = "Checkout code"; - uses = actions.checkout; - } - { - name = "Install Lix"; - uses = actions.install-lix; - "with" = { - extra_nix_config = '' - accept-flake-config = true - max-jobs = auto - ''; - }; - } - { - name = "Add SSH keys to ssh-agent"; - uses = actions.ssh-agent; - "with" = { - ssh-private-key = '' - ''${{ secrets.SECRETS_DEPLOY_KEY }} - ''${{ secrets.PRAGMATAPRO_DEPLOY_KEY }} - ''; - }; - } - { - name = "Setup Attic cache"; - uses = actions.attic; - "with" = { - cache = "tilde"; - endpoint = "https://cache.e10.camp"; - token = "\${{ secrets.ATTIC_TOKEN }}"; - }; - } - { - name = "Use Cachix store"; - uses = actions.cachix; - "with" = { - authToken = "\${{ secrets.CACHIX_AUTH_TOKEN }}"; - installCommand = - "nix profile install github:NixOS/nixpkgs/nixpkgs-unstable#cachix"; - name = "tilde"; - }; - } - ]; - in { - ".github/workflows/check.yml" = { - name = "Check"; - jobs = { - check = { - name = "Check flake"; - runs-on = "ubuntu-latest"; - steps = setup ++ [{ - name = "Run check flake"; - run = "nix flake -Lv check --impure --show-trace"; - }]; + flake.actions-nix.workflows = + let + actions = { + checkout = "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"; + install-lix = "samueldr/lix-gha-installer-action@7b7f14d320d6aacfb65bd1ef761566b3b69e474c"; + ssh-agent = "webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555"; + attic = "ryanccn/attic-action@1887fd507f03327c96c64cca30118c96eb17fdad"; + cachix = "cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c"; + }; + setup = [ + { + name = "Checkout code"; + uses = actions.checkout; + } + { + name = "Install Lix"; + uses = actions.install-lix; + "with" = { + extra_nix_config = '' + accept-flake-config = true + max-jobs = auto + ''; + }; + } + { + name = "Add SSH keys to ssh-agent"; + uses = actions.ssh-agent; + "with" = { + ssh-private-key = '' + ''${{ secrets.SECRETS_DEPLOY_KEY }} + ''${{ secrets.PRAGMATAPRO_DEPLOY_KEY }} + ''; + }; + } + { + name = "Setup Attic cache"; + uses = actions.attic; + "with" = { + cache = "tilde"; + endpoint = "https://cache.e10.camp"; + token = "\${{ secrets.ATTIC_TOKEN }}"; + }; + } + { + name = "Use Cachix store"; + uses = actions.cachix; + "with" = { + authToken = "\${{ secrets.CACHIX_AUTH_TOKEN }}"; + installCommand = "nix profile install github:NixOS/nixpkgs/nixpkgs-unstable#cachix"; + name = "tilde"; + }; + } + ]; + in + { + ".github/workflows/check.yml" = { + name = "Check"; + jobs = { + check = { + name = "Check flake"; + runs-on = "ubuntu-latest"; + steps = setup ++ [ + { + name = "Run check flake"; + run = "nix flake -Lv check --impure --show-trace"; + } + ]; + }; }; }; - }; - ".github/workflows/hosts.yml" = { - name = "Host configurations"; - jobs = { - build-system = { - name = "Build host system"; - runs-on = "macos-15"; - strategy.matrix.host = l.attrNames self.darwinConfigurations; - steps = setup ++ [{ - name = "Build \${{ matrix.host }} host system"; - run = '' - nix build .#darwinConfigurations.''${{ matrix.host }}.system --keep-going --print-build-logs --show-trace --verbose - ''; - }]; + ".github/workflows/hosts.yml" = { + name = "Host configurations"; + jobs = { + build-system = { + name = "Build host system"; + runs-on = "macos-15"; + strategy.matrix.host = l.attrNames self.darwinConfigurations; + steps = setup ++ [ + { + name = "Build \${{ matrix.host }} host system"; + run = '' + nix build .#darwinConfigurations.''${{ matrix.host }}.system --keep-going --print-build-logs --show-trace --verbose + ''; + } + ]; + }; }; }; - }; - ".github/workflows/packages.yml" = { - name = "Build packages"; - on.push.paths = - [ ".github/**/*.yml" "modules/packages/**/*.nix" "flake.lock" ]; - jobs = { - build-package = { - name = "Build package"; - runs-on = "macos-15"; - strategy.matrix = { - architecture = [ "aarch64-darwin" ]; - package = l.filter (name: name != "render-workflows") - (l.attrNames self.packages.aarch64-darwin); + ".github/workflows/packages.yml" = { + name = "Build packages"; + on.push.paths = [ + ".github/**/*.yml" + "modules/packages/**/*.nix" + "flake.lock" + ]; + jobs = { + build-package = { + name = "Build package"; + runs-on = "macos-15"; + strategy.matrix = { + architecture = [ "aarch64-darwin" ]; + package = l.filter (name: name != "render-workflows") (l.attrNames self.packages.aarch64-darwin); + }; + steps = setup ++ [ + { + name = "Build \${{ matrix.package }} (\${{ matrix.architecture }}) package"; + run = '' + nix build .#packages.''${{ matrix.architecture }}.''${{ matrix.package }} --keep-going --print-build-logs --show-trace --verbose + ''; + } + ]; }; - steps = setup ++ [{ - name = - "Build \${{ matrix.package }} (\${{ matrix.architecture }}) package"; - run = '' - nix build .#packages.''${{ matrix.architecture }}.''${{ matrix.package }} --keep-going --print-build-logs --show-trace --verbose - ''; - }]; }; }; - }; - ".github/workflows/devshell.yml" = { - name = "devShell"; - jobs = { - build-dev-shell = { - name = "Build devShell"; - runs-on = "macos-15"; - steps = setup ++ [{ - name = "Build aarch64-darwin shell"; - run = - "nix build .#devShells.aarch64-darwin.default --impure --keep-going --print-build-logs --show-trace --verbose"; - }]; + ".github/workflows/devshell.yml" = { + name = "devShell"; + jobs = { + build-dev-shell = { + name = "Build devShell"; + runs-on = "macos-15"; + steps = setup ++ [ + { + name = "Build aarch64-darwin shell"; + run = "nix build .#devShells.aarch64-darwin.default --impure --keep-going --print-build-logs --show-trace --verbose"; + } + ]; + }; }; }; }; - }; } diff --git a/modules/development/shell.nix b/modules/development/shell.nix index 70b27fbb..01a76c17 100644 --- a/modules/development/shell.nix +++ b/modules/development/shell.nix @@ -1,21 +1,29 @@ { self, inputs, ... }: { - perSystem = { config, pkgs, lib, system, ... }: { - devShells.default = pkgs.mkShell { - inputsFrom = [ self.devShells.${system}.treefmt ]; + perSystem = + { + config, + pkgs, + lib, + system, + ... + }: + { + devShells.default = pkgs.mkShell { + inputsFrom = [ self.devShells.${system}.treefmt ]; - nativeBuildInputs = with pkgs; [ - cachix - just - nh - nix-output-monitor - sops - inputs.home-manager.packages.${system}.default - ]; + nativeBuildInputs = with pkgs; [ + cachix + just + nh + nix-output-monitor + sops + inputs.home-manager.packages.${system}.default + ]; - shellHook = '' - export FLAKE_ROOT="${lib.getExe config.flake-root.package}" - export SOPS_AGE_KEY_FILE=$HOME/.config/sops/age/keys.txt - ''; + shellHook = '' + export FLAKE_ROOT="${lib.getExe config.flake-root.package}" + export SOPS_AGE_KEY_FILE=$HOME/.config/sops/age/keys.txt + ''; + }; }; - }; } diff --git a/modules/development/treefmt.nix b/modules/development/treefmt.nix index bca131b4..7ec961d4 100644 --- a/modules/development/treefmt.nix +++ b/modules/development/treefmt.nix @@ -1,7 +1,8 @@ -{ inputs, ... }: { +{ inputs, lib, ... }: { imports = [ inputs.treefmt.flakeModule ]; - perSystem = { config, pkgs, ... }: + perSystem = + { config, pkgs, ... }: let treefmtConfig = { inherit (config.flake-root) projectRootFile; @@ -10,10 +11,8 @@ actionlint.enable = true; deadnix.enable = true; statix.enable = true; - nixfmt = { - enable = true; - package = pkgs.nixfmt-classic; - }; + nixfmt.enable = true; + nixpkgs-fmt.enable = true; prettier.enable = true; }; settings.formatter = { @@ -23,16 +22,29 @@ "**/secrets.json" "**/secrets.yml" ]; + nixfmt.excludes = [ + "modules/packages/**/*.nix" + "modules/darwin/src/**/*.nix" + "modules/home/src/**/*.nix" + ]; + nixpkgs-fmt.includes = lib.mkOverride 10 [ + "modules/packages/**/*.nix" + "modules/darwin/src/**/*.nix" + "modules/home/src/**/*.nix" + ]; }; }; - in { + in + { treefmt.config = treefmtConfig; formatter = inputs.treefmt.lib.mkWrapper pkgs treefmtConfig; devShells.treefmt = pkgs.mkShell { - nativeBuildInputs = [ config.treefmt.build.wrapper ] - ++ (builtins.attrValues config.treefmt.build.programs); + nativeBuildInputs = [ + config.treefmt.build.wrapper + ] + ++ (builtins.attrValues config.treefmt.build.programs); }; }; } diff --git a/modules/home/default.nix b/modules/home/default.nix index ac3d8013..b763a042 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -2,9 +2,12 @@ let inherit (self.lib) utils; inherit (self.inputs) haumea; -in { - flake.homeModules = utils.importModules (haumea.lib.load { - src = ./src; - loader = haumea.lib.loaders.path; - }); +in +{ + flake.homeModules = utils.importModules ( + haumea.lib.load { + src = ./src; + loader = haumea.lib.loaders.path; + } + ); } diff --git a/modules/home/src/programs/navi/default.nix b/modules/home/src/programs/navi/default.nix index ee412aa8..085c7ae2 100644 --- a/modules/home/src/programs/navi/default.nix +++ b/modules/home/src/programs/navi/default.nix @@ -1,72 +1,92 @@ -{ config, lib, pkgs, ... }: +{ config +, lib +, pkgs +, ... +}: with lib; let cfg = config.programs.navi; - configDir = if pkgs.stdenv.isDarwin then - "Library/Application Support" - else - config.xdg.configHome; + configDir = if pkgs.stdenv.isDarwin then "Library/Application Support" else config.xdg.configHome; printTags = tags: "% ${concatStringsSep ", " tags}"; - printCheats = cheats: - concatStringsSep "\n" (map (cheat: '' - # ${cheat.description} - ${cheat.command} - '') cheats); - printVariables = variables: - concatStringsSep "\n" (mapAttrsToList (name: value: '' - $ ${name}: ${value} - '') variables); + printCheats = + cheats: + concatStringsSep "\n" ( + map + (cheat: '' + # ${cheat.description} + ${cheat.command} + '') + cheats + ); + printVariables = + variables: + concatStringsSep "\n" ( + mapAttrsToList + (name: value: '' + $ ${name}: ${value} + '') + variables + ); printExtensions = extensions: "@ ${concatStringsSep ", " extensions}"; -in { +in +{ options.programs.navi = { cheatfiles = mkOption { - type = types.attrsOf (types.submodule { - options = { - tags = mkOption { - type = types.listOf types.str; - description = "Tags for this cheatfile"; + type = types.attrsOf ( + types.submodule { + options = { + tags = mkOption { + type = types.listOf types.str; + description = "Tags for this cheatfile"; + }; + cheats = mkOption { + type = types.listOf ( + types.submodule { + options = { + description = mkOption { + type = types.str; + description = "Description of this cheat"; + }; + command = mkOption { + type = types.lines; + description = "What to run for this cheat"; + }; + }; + } + ); + default = [ ]; + }; + variables = mkOption { + type = types.attrs; + default = { }; + description = "Variables for this cheatfile"; + }; + extensions = mkOption { + type = types.listOf types.str; + default = [ ]; + description = "Other cheatfiles to extend into this file"; + }; }; - cheats = mkOption { - type = types.listOf (types.submodule { - options = { - description = mkOption { - type = types.str; - description = "Description of this cheat"; - }; - command = mkOption { - type = types.lines; - description = "What to run for this cheat"; - }; - }; - }); - default = [ ]; - }; - variables = mkOption { - type = types.attrs; - default = { }; - description = "Variables for this cheatfile"; - }; - extensions = mkOption { - type = types.listOf types.str; - default = [ ]; - description = "Other cheatfiles to extend into this file"; - }; - }; - }); + } + ); }; }; config = mkIf cfg.enable { - home.file = mapAttrs' (name: cheatfile: - nameValuePair "${configDir}/navi/cheats/${name}.cheat" { - text = '' - ${printTags cheatfile.tags} - ${printCheats cheatfile.cheats} - ${printVariables cheatfile.variables} - ${printExtensions cheatfile.extensions} - ''; - }) cfg.cheatfiles; + home.file = mapAttrs' + ( + name: cheatfile: + nameValuePair "${configDir}/navi/cheats/${name}.cheat" { + text = '' + ${printTags cheatfile.tags} + ${printCheats cheatfile.cheats} + ${printVariables cheatfile.variables} + ${printExtensions cheatfile.extensions} + ''; + } + ) + cfg.cheatfiles; }; } diff --git a/modules/home/src/programs/rippkgs/default.nix b/modules/home/src/programs/rippkgs/default.nix index af67a008..4221c751 100644 --- a/modules/home/src/programs/rippkgs/default.nix +++ b/modules/home/src/programs/rippkgs/default.nix @@ -1,9 +1,15 @@ -{ config, lib, pkgs, ... }: +{ config +, lib +, pkgs +, ... +}: with lib; -let cfg = config.programs.rippkgs; -in { +let + cfg = config.programs.rippkgs; +in +{ options.programs.rippkgs = { enable = mkEnableOption "Enable rippkgs"; @@ -21,10 +27,16 @@ in { }; config = mkIf cfg.enable { - home.packages = let - indexerRunner = pkgs.writeShellScriptBin "rippkgs-index-runner" '' - ${lib.getExe' cfg.package "rippkgs-index"} $@ -o ${cfg.indexLocation} - ''; - in with cfg; [ package indexerRunner ]; + home.packages = + let + indexerRunner = pkgs.writeShellScriptBin "rippkgs-index-runner" '' + ${lib.getExe' cfg.package "rippkgs-index"} $@ -o ${cfg.indexLocation} + ''; + in + with cfg; + [ + package + indexerRunner + ]; }; } diff --git a/modules/home/src/programs/tmuxp/default.nix b/modules/home/src/programs/tmuxp/default.nix index 82a648df..e118a929 100644 --- a/modules/home/src/programs/tmuxp/default.nix +++ b/modules/home/src/programs/tmuxp/default.nix @@ -1,11 +1,16 @@ -{ config, lib, pkgs, ... }: +{ config +, lib +, pkgs +, ... +}: with lib; let cfg = config.programs.tmuxp; yamlFormat = pkgs.formats.yaml { }; -in { +in +{ options.programs.tmuxp = { enable = mkEnableOption "Enable tmuxp"; package = mkOption { @@ -21,9 +26,13 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; - xdg.configFile = mapAttrs' (name: attrs: - nameValuePair "tmuxp/${name}.yaml" { - source = yamlFormat.generate "tmuxp-${name}.yaml" attrs; - }) cfg.workspaces; + xdg.configFile = mapAttrs' + ( + name: attrs: + nameValuePair "tmuxp/${name}.yaml" { + source = yamlFormat.generate "tmuxp-${name}.yaml" attrs; + } + ) + cfg.workspaces; }; } diff --git a/modules/overlays/default.nix b/modules/overlays/default.nix index fe9e9269..9d2a6ce6 100644 --- a/modules/overlays/default.nix +++ b/modules/overlays/default.nix @@ -2,16 +2,18 @@ imports = [ inputs.flake-parts.flakeModules.easyOverlay ]; perSystem = { system, ... }: { - overlayAttrs = let - nixpkgs-master = import inputs.nixpkgs-master { - inherit system; + overlayAttrs = + let + nixpkgs-master = import inputs.nixpkgs-master { + inherit system; - config.allowUnfree = true; - }; - in { - nixpkgs-master-darwin-linux-builder = nixpkgs-master.darwin.linux-builder; + config.allowUnfree = true; + }; + in + { + nixpkgs-master-darwin-linux-builder = nixpkgs-master.darwin.linux-builder; - inherit (nixpkgs-master) ghostty-bin zed-editor; - }; + inherit (nixpkgs-master) ghostty-bin zed-editor; + }; }; } diff --git a/modules/packages/default.nix b/modules/packages/default.nix index 81d2318c..b38099a1 100644 --- a/modules/packages/default.nix +++ b/modules/packages/default.nix @@ -4,7 +4,12 @@ perSystem = { config, pkgs, ... }: { overlayAttrs = { inherit (config.packages) - firehydrant-mcp mcp-remote oh-my-tmux postgres-mcp sf-pro; + firehydrant-mcp + mcp-remote + oh-my-tmux + postgres-mcp + sf-pro + ; }; packages = { diff --git a/modules/packages/firehydrant-mcp.nix b/modules/packages/firehydrant-mcp.nix index 7c4284b3..28663964 100644 --- a/modules/packages/firehydrant-mcp.nix +++ b/modules/packages/firehydrant-mcp.nix @@ -1,4 +1,8 @@ -{ lib, buildNpmPackage, fetchFromGitHub }: +{ + lib, + buildNpmPackage, + fetchFromGitHub, +}: buildNpmPackage (finalAttrs: { pname = "firehydrant-mcp"; diff --git a/modules/packages/fonts/sf-pro.nix b/modules/packages/fonts/sf-pro.nix index 42241268..5f1978c9 100644 --- a/modules/packages/fonts/sf-pro.nix +++ b/modules/packages/fonts/sf-pro.nix @@ -1,4 +1,8 @@ -{ stdenv, lib, fetchFromGitHub }: +{ stdenv +, lib +, fetchFromGitHub +, +}: stdenv.mkDerivation { pname = "sf-pro"; diff --git a/modules/packages/mcp-remote.nix b/modules/packages/mcp-remote.nix index afb9af8f..f370569c 100644 --- a/modules/packages/mcp-remote.nix +++ b/modules/packages/mcp-remote.nix @@ -1,8 +1,18 @@ -{ stdenv, pnpm_10, fetchFromGitHub, fetchPnpmDeps, pnpmConfigHook, nodejs -, makeWrapper, lib }: +{ + stdenv, + pnpm_10, + fetchFromGitHub, + fetchPnpmDeps, + pnpmConfigHook, + nodejs, + makeWrapper, + lib, +}: -let pnpm = pnpm_10; -in stdenv.mkDerivation (finalAttrs: rec { +let + pnpm = pnpm_10; +in +stdenv.mkDerivation (finalAttrs: rec { pname = "mcp-remote"; version = "0.1.38"; @@ -20,7 +30,12 @@ in stdenv.mkDerivation (finalAttrs: rec { hash = "sha256-5podB1HJahhn2vlMBnu0wm7AJ0bjq8pvXqPgdR8c3GQ="; }; - nativeBuildInputs = [ nodejs pnpmConfigHook pnpm makeWrapper ]; + nativeBuildInputs = [ + nodejs + pnpmConfigHook + pnpm + makeWrapper + ]; doCheck = true; @@ -50,8 +65,7 @@ in stdenv.mkDerivation (finalAttrs: rec { ''; meta = { - description = - "Connect an MCP Client that only supports local (stdio) servers to a Remote MCP Server, with auth support"; + description = "Connect an MCP Client that only supports local (stdio) servers to a Remote MCP Server, with auth support"; homepage = "https://github.com/geelen/mcp-remote"; license = lib.licenses.mit; platforms = lib.platforms.all; diff --git a/modules/packages/oh-my-tmux.nix b/modules/packages/oh-my-tmux.nix index 77cf0faf..7bc7106a 100644 --- a/modules/packages/oh-my-tmux.nix +++ b/modules/packages/oh-my-tmux.nix @@ -7,8 +7,7 @@ stdenv.mkDerivation { # fetchFromGitHub has trouble with the extracted directory from the ZIP file having a # preceding dot, so use fetchTarball instead src = fetchTarball { - url = - "https://github.com/gpakosz/.tmux/archive/af33f07134b76134acca9d01eacbdecca9c9cda6.tar.gz"; + url = "https://github.com/gpakosz/.tmux/archive/af33f07134b76134acca9d01eacbdecca9c9cda6.tar.gz"; sha256 = "sha256-nXm664l84YSwZeRM4Hsweqgz+OlpyfwXcgEdyNGhaGA="; }; @@ -26,8 +25,7 @@ stdenv.mkDerivation { meta = { homepage = "https://github.com/gpakosz/.tmux"; - description = - "Oh my tmux! My self-contained, pretty & versatile tmux configuration made with love"; + description = "Oh my tmux! My self-contained, pretty & versatile tmux configuration made with love"; platforms = lib.platforms.all; license = lib.licenses.mit; }; diff --git a/modules/packages/postgres-mcp.nix b/modules/packages/postgres-mcp.nix index 88bcf9d8..0b43747d 100644 --- a/modules/packages/postgres-mcp.nix +++ b/modules/packages/postgres-mcp.nix @@ -1,4 +1,8 @@ -{ lib, python312Packages, fetchFromGitHub }: +{ + lib, + python312Packages, + fetchFromGitHub, +}: python312Packages.buildPythonApplication { pname = "postgres-mcp"; diff --git a/modules/profiles/default.nix b/modules/profiles/default.nix index a984e9bd..5404e622 100644 --- a/modules/profiles/default.nix +++ b/modules/profiles/default.nix @@ -1,6 +1,8 @@ { self, ... }: -let inherit (self.inputs) haumea; -in { +let + inherit (self.inputs) haumea; +in +{ flake.profiles = { darwin = haumea.lib.load { src = ./system; diff --git a/modules/profiles/home/bat.nix b/modules/profiles/home/bat.nix index aeb79f10..be2f44e0 100644 --- a/modules/profiles/home/bat.nix +++ b/modules/profiles/home/bat.nix @@ -4,5 +4,9 @@ config.theme = "Nord"; }; - home.packages = with pkgs.bat-extras; [ batdiff batgrep batman ]; + home.packages = with pkgs.bat-extras; [ + batdiff + batgrep + batman + ]; } diff --git a/modules/profiles/home/emacs.nix b/modules/profiles/home/emacs.nix index cf98d73a..19eb9fd7 100644 --- a/modules/profiles/home/emacs.nix +++ b/modules/profiles/home/emacs.nix @@ -7,23 +7,21 @@ let patchedEmacs = configuredEmacs.overrideAttrs (old: { patches = (old.patches or [ ]) ++ [ (pkgs.fetchpatch { - url = - "https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-30/system-appearance.patch"; + url = "https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-30/system-appearance.patch"; sha256 = "3QLq91AQ6E921/W9nfDjdOUWR8YVsqBAT/W9c1woqAw="; }) (pkgs.fetchpatch { - url = - "https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-30/round-undecorated-frame.patch"; + url = "https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-30/round-undecorated-frame.patch"; sha256 = "uYIxNTyfbprx5mCqMNFVrBcLeo+8e21qmBE3lpcnd+4="; }) (pkgs.fetchpatch { - url = - "https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-28/fix-window-role.patch"; + url = "https://github.com/d12frosted/homebrew-emacs-plus/raw/refs/heads/master/patches/emacs-28/fix-window-role.patch"; sha256 = "+z/KfsBm1lvZTZNiMbxzXQGRTjkCFO4QPlEK35upjsE="; }) ]; }); -in { +in +{ programs.emacs = { enable = true; package = patchedEmacs; diff --git a/modules/profiles/home/fish.nix b/modules/profiles/home/fish.nix index 68fa9d0b..c8c5f371 100644 --- a/modules/profiles/home/fish.nix +++ b/modules/profiles/home/fish.nix @@ -18,14 +18,16 @@ functions.fish_greeting = ""; - plugins = [{ - name = "foreign-env"; - src = pkgs.fetchFromGitHub { - owner = "oh-my-fish"; - repo = "plugin-foreign-env"; - rev = "7f0cf099ae1e1e4ab38f46350ed6757d54471de7"; - sha256 = "4+k5rSoxkTtYFh/lEjhRkVYa2S4KEzJ/IJbyJl+rJjQ="; - }; - }]; + plugins = [ + { + name = "foreign-env"; + src = pkgs.fetchFromGitHub { + owner = "oh-my-fish"; + repo = "plugin-foreign-env"; + rev = "7f0cf099ae1e1e4ab38f46350ed6757d54471de7"; + sha256 = "4+k5rSoxkTtYFh/lEjhRkVYa2S4KEzJ/IJbyJl+rJjQ="; + }; + } + ]; }; } diff --git a/modules/profiles/home/gh.nix b/modules/profiles/home/gh.nix index b53f971b..c47c7dee 100644 --- a/modules/profiles/home/gh.nix +++ b/modules/profiles/home/gh.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, ... }: { +{ + config, + lib, + pkgs, + ... +}: +{ programs.gh = { enable = true; extensions = with pkgs; [ gh-poi ]; diff --git a/modules/profiles/home/git/common.nix b/modules/profiles/home/git/common.nix index 148ea8bc..4d79c321 100644 --- a/modules/profiles/home/git/common.nix +++ b/modules/profiles/home/git/common.nix @@ -1,12 +1,25 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let - mkGitShellScript = { name, text, extraRuntimeInputs ? [ ] }: - lib.getExe (pkgs.writeShellApplication { - inherit name text; + mkGitShellScript = + { + name, + text, + extraRuntimeInputs ? [ ], + }: + lib.getExe ( + pkgs.writeShellApplication { + inherit name text; - runtimeInputs = [ config.programs.git.package ] ++ extraRuntimeInputs; - }); -in { + runtimeInputs = [ config.programs.git.package ] ++ extraRuntimeInputs; + } + ); +in +{ home.packages = with pkgs; [ delta ]; programs.git = { @@ -15,41 +28,43 @@ in { settings = { user.name = "Ethan Turkeltaub"; - alias = let - superprune = mkGitShellScript { - name = "git-alias-superprune"; - text = '' - echo 'Fetching remote then deleting branches that are gone. This may take a moment' + alias = + let + superprune = mkGitShellScript { + name = "git-alias-superprune"; + text = '' + echo 'Fetching remote then deleting branches that are gone. This may take a moment' - git fetch -p + git fetch -p - gone=$(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}') - for branch in $gone; do - git branch -D "$branch"; - done; - ''; + gone=$(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}') + for branch in $gone; do + git branch -D "$branch"; + done; + ''; + }; + co = mkGitShellScript { + name = "git-alias-co"; + extraRuntimeInputs = [ pkgs.fzf ]; + text = '' + git checkout "$(git branch --sort="-committerdate" | fzf | tr -d '[:space:]')"; + ''; + }; + wipe = mkGitShellScript { + name = "git-alias-wipe"; + text = '' + git add . + git stash + ''; + }; + in + { + s = "status"; + superprune = "!sh ${superprune}"; + co = "!sh ${co}"; + wipe = "!sh ${wipe}"; + sync = "!${lib.getExe pkgs.gh} repo sync"; }; - co = mkGitShellScript { - name = "git-alias-co"; - extraRuntimeInputs = [ pkgs.fzf ]; - text = '' - git checkout "$(git branch --sort="-committerdate" | fzf | tr -d '[:space:]')"; - ''; - }; - wipe = mkGitShellScript { - name = "git-alias-wipe"; - text = '' - git add . - git stash - ''; - }; - in { - s = "status"; - superprune = "!sh ${superprune}"; - co = "!sh ${co}"; - wipe = "!sh ${wipe}"; - sync = "!${lib.getExe pkgs.gh} repo sync"; - }; http.sslCAinfo = "/etc/ssl/certs/ca-certificates.crt"; @@ -61,7 +76,14 @@ in { init.defaultBranch = "main"; }; - ignores = [ "*~" "#*#" ".elc" ".#*" "flycheck_*.el" ".projectile" ]; + ignores = [ + "*~" + "#*#" + ".elc" + ".#*" + "flycheck_*.el" + ".projectile" + ]; signing.signByDefault = config.programs.git.signing.key != null; }; diff --git a/modules/profiles/home/gnupg/default.nix b/modules/profiles/home/gnupg/default.nix index 14b81ddd..3898d973 100644 --- a/modules/profiles/home/gnupg/default.nix +++ b/modules/profiles/home/gnupg/default.nix @@ -17,8 +17,7 @@ personal-cipher-preferences = "AES256 AES192 AES"; personal-digest-preferences = "SHA512 SHA384 SHA256"; personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed"; - default-preference-list = - "SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed"; + default-preference-list = "SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed"; cert-digest-algo = "SHA512"; s2k-digest-algo = "SHA512"; s2k-cipher-algo = "AES256"; @@ -36,15 +35,16 @@ throw-keyids = true; }; - publicKeys = [{ - source = ./key.pub; - trust = "ultimate"; - }]; + publicKeys = [ + { + source = ./key.pub; + trust = "ultimate"; + } + ]; }; home.file.".gnupg/gpg-agent.conf".source = ./gpg-agent.conf; # This has to be set here, even though gpg-agent in nix-darwin should be able to set it - home.sessionVariables.SSH_AUTH_SOCK = - "$(${lib.getExe' pkgs.gnupg "gpgconf"} --list-dirs agent-ssh-socket)"; + home.sessionVariables.SSH_AUTH_SOCK = "$(${lib.getExe' pkgs.gnupg "gpgconf"} --list-dirs agent-ssh-socket)"; } diff --git a/modules/profiles/home/helix.nix b/modules/profiles/home/helix.nix index 04e4b94c..ee6b2a8b 100644 --- a/modules/profiles/home/helix.nix +++ b/modules/profiles/home/helix.nix @@ -1,6 +1,8 @@ { programs.helix = { enable = true; - settings = { theme = "nord"; }; + settings = { + theme = "nord"; + }; }; } diff --git a/modules/profiles/home/jujutsu.nix b/modules/profiles/home/jujutsu.nix index a64a9ef7..a2c3d3d7 100644 --- a/modules/profiles/home/jujutsu.nix +++ b/modules/profiles/home/jujutsu.nix @@ -1,7 +1,9 @@ { programs.jujutsu = { enable = true; - settings = { user.name = "Ethan Turkeltaub"; }; + settings = { + user.name = "Ethan Turkeltaub"; + }; }; programs.jjui.enable = true; diff --git a/modules/profiles/home/mcp/github/default.nix b/modules/profiles/home/mcp/github/default.nix index c1a8c5b7..89b98b21 100644 --- a/modules/profiles/home/mcp/github/default.nix +++ b/modules/profiles/home/mcp/github/default.nix @@ -5,7 +5,8 @@ let export GITHUB_PERSONAL_ACCESS_TOKEN="$(cat ${config.sops.secrets.github_mcp_pat.path})" exec ${pkgs.github-mcp-server}/bin/github-mcp-server stdio ''; -in { +in +{ sops = { secrets.github_mcp_pat = { sopsFile = ./secrets.json; diff --git a/modules/profiles/home/mcp/memory.nix b/modules/profiles/home/mcp/memory.nix index 8e667f9a..9ed9fc4f 100644 --- a/modules/profiles/home/mcp/memory.nix +++ b/modules/profiles/home/mcp/memory.nix @@ -1,14 +1,22 @@ -{ config, lib, pkgs, ... }: -let memoryDir = "${config.xdg.dataHome}/mcp-memory"; -in { +{ + config, + lib, + pkgs, + ... +}: +let + memoryDir = "${config.xdg.dataHome}/mcp-memory"; +in +{ programs.mcp.servers.memory = { command = lib.getExe pkgs.mcp-server-memory; args = [ ]; - env = { MEMORY_FILE_PATH = "${memoryDir}/memory.jsonl"; }; + env = { + MEMORY_FILE_PATH = "${memoryDir}/memory.jsonl"; + }; }; - home.activation.createMcpMemoryDir = - lib.hm.dag.entryAfter [ "writeBoundary" ] '' - run mkdir -p "${memoryDir}" - ''; + home.activation.createMcpMemoryDir = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + run mkdir -p "${memoryDir}" + ''; } diff --git a/modules/profiles/home/navi.nix b/modules/profiles/home/navi.nix index 768090a6..d8b134dc 100644 --- a/modules/profiles/home/navi.nix +++ b/modules/profiles/home/navi.nix @@ -5,13 +5,15 @@ cheatfiles.git = { tags = [ "git" ]; - cheats = [{ - description = "checkout a remote branch"; - command = '' - git fetch origin : - git checkout - ''; - }]; + cheats = [ + { + description = "checkout a remote branch"; + command = '' + git fetch origin : + git checkout + ''; + } + ]; }; }; } diff --git a/modules/profiles/home/nodejs.nix b/modules/profiles/home/nodejs.nix index 30a72436..ecd55435 100644 --- a/modules/profiles/home/nodejs.nix +++ b/modules/profiles/home/nodejs.nix @@ -1,5 +1,8 @@ { pkgs, ... }: { - home.packages = with pkgs; [ nodejs pnpm ]; + home.packages = with pkgs; [ + nodejs + pnpm + ]; home.sessionPath = [ "$HOME/.pnpm" ]; } diff --git a/modules/profiles/home/opencode/default.nix b/modules/profiles/home/opencode/default.nix index f0bb1801..2e7ca149 100644 --- a/modules/profiles/home/opencode/default.nix +++ b/modules/profiles/home/opencode/default.nix @@ -10,7 +10,9 @@ enable = true; package = pkgs.llm-agents.opencode; enableMcpIntegration = true; - tui = { theme = "nord"; }; + tui = { + theme = "nord"; + }; settings = { formatter = true; lsp = true; @@ -21,7 +23,9 @@ }; }; }; - permission = { "*" = "ask"; }; + permission = { + "*" = "ask"; + }; }; }; } diff --git a/modules/profiles/home/starship.nix b/modules/profiles/home/starship.nix index ef04b2b4..6f110509 100644 --- a/modules/profiles/home/starship.nix +++ b/modules/profiles/home/starship.nix @@ -2,6 +2,8 @@ programs.starship = { enable = true; enableFishIntegration = true; - settings = { nix_shell.symbol = "❄️ "; }; + settings = { + nix_shell.symbol = "❄️ "; + }; }; } diff --git a/modules/profiles/home/tools/darwin.nix b/modules/profiles/home/tools/darwin.nix index 45546a0c..5e9e5a5c 100644 --- a/modules/profiles/home/tools/darwin.nix +++ b/modules/profiles/home/tools/darwin.nix @@ -1,3 +1,8 @@ { pkgs, lib, ... }: { - home.packages = with pkgs; (lib.optionals stdenv.isDarwin [ cacert mas ]); + home.packages = + with pkgs; + (lib.optionals stdenv.isDarwin [ + cacert + mas + ]); } diff --git a/modules/profiles/home/tools/media-management.nix b/modules/profiles/home/tools/media-management.nix index c354b2a8..7ee79969 100644 --- a/modules/profiles/home/tools/media-management.nix +++ b/modules/profiles/home/tools/media-management.nix @@ -1 +1,6 @@ -{ pkgs, ... }: { home.packages = with pkgs; [ ffmpeg yt-dlp ]; } +{ pkgs, ... }: { + home.packages = with pkgs; [ + ffmpeg + yt-dlp + ]; +} diff --git a/modules/profiles/home/vscode.nix b/modules/profiles/home/vscode.nix index 4edcc675..13c1fcac 100644 --- a/modules/profiles/home/vscode.nix +++ b/modules/profiles/home/vscode.nix @@ -139,11 +139,15 @@ "ruby.useLanguageServer" = true; # Nix settings - "[nix]" = { "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; }; - "nixfmt.path" = lib.getExe pkgs.nixfmt-classic; + "[nix]" = { + "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; + }; + "nixfmt.path" = lib.getExe pkgs.nixfmt; # JSON settings - "[json]" = { "editor.defaultFormatter" = "esbenp.prettier-vscode"; }; + "[json]" = { + "editor.defaultFormatter" = "esbenp.prettier-vscode"; + }; # TypeScript settings "[typescriptreact]" = { diff --git a/modules/profiles/home/zed-editor.nix b/modules/profiles/home/zed-editor.nix index 725d53e6..a9c785ba 100644 --- a/modules/profiles/home/zed-editor.nix +++ b/modules/profiles/home/zed-editor.nix @@ -48,7 +48,12 @@ git.inline_blame.enabled = false; # File associations - file_types = { "Haskell" = [ "ghci" "persistentmodels" ]; }; + file_types = { + "Haskell" = [ + "ghci" + "persistentmodels" + ]; + }; # Direnv load_direnv = "shell_hook"; @@ -56,10 +61,13 @@ # Language-specific languages = { Nix = { - language_servers = [ "nixd" "!nil" ]; + language_servers = [ + "nixd" + "!nil" + ]; formatter = { external = { - command = lib.getExe pkgs.nixfmt-classic; + command = lib.getExe pkgs.nixfmt; arguments = [ ]; }; }; diff --git a/modules/profiles/system/builders/builder.nix b/modules/profiles/system/builders/builder.nix index 971f4c56..c504ece2 100644 --- a/modules/profiles/system/builders/builder.nix +++ b/modules/profiles/system/builders/builder.nix @@ -2,18 +2,27 @@ imports = [ ./common.nix ]; nix = { - buildMachines = [{ - hostName = "builder"; - system = "x86_64-linux"; - protocol = "ssh-ng"; - maxJobs = 16; - speedFactor = 1; - supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; - mandatoryFeatures = [ ]; - sshUser = "builder"; - sshKey = "/Users/ethan/Workspace/e10/keys/builder_rsa"; - }]; + buildMachines = [ + { + hostName = "builder"; + system = "x86_64-linux"; + protocol = "ssh-ng"; + maxJobs = 16; + speedFactor = 1; + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + ]; + mandatoryFeatures = [ ]; + sshUser = "builder"; + sshKey = "/Users/ethan/Workspace/e10/keys/builder_rsa"; + } + ]; - settings = { builders-use-substitutes = true; }; + settings = { + builders-use-substitutes = true; + }; }; } diff --git a/modules/profiles/system/core/nix-config/default.nix b/modules/profiles/system/core/nix-config/default.nix index ffedf2c4..f9e58bae 100644 --- a/modules/profiles/system/core/nix-config/default.nix +++ b/modules/profiles/system/core/nix-config/default.nix @@ -1,6 +1,8 @@ { config, pkgs, ... }: { sops = { - secrets.nix-conf-github-pat = { sopsFile = ./secrets.json; }; + secrets.nix-conf-github-pat = { + sopsFile = ./secrets.json; + }; templates."nix/nix-conf-access-tokens" = { content = '' @@ -22,8 +24,7 @@ }; nix = { - extraOptions = - "!include ${config.sops.templates."nix/nix-conf-access-tokens".path}"; + extraOptions = "!include ${config.sops.templates."nix/nix-conf-access-tokens".path}"; gc.automatic = true; }; diff --git a/modules/profiles/system/darwin/brew.nix b/modules/profiles/system/darwin/brew.nix index eeaf5a7c..54774bd6 100644 --- a/modules/profiles/system/darwin/brew.nix +++ b/modules/profiles/system/darwin/brew.nix @@ -8,10 +8,12 @@ brews = [ "pinentry-mac" ]; - taps = [{ - name = "railwaycat/emacsmacport"; - trusted = true; - }]; + taps = [ + { + name = "railwaycat/emacsmacport"; + trusted = true; + } + ]; casks = [ "1password" @@ -34,6 +36,8 @@ "zen" ]; - masApps = { "Amphetamine" = 937984704; }; + masApps = { + "Amphetamine" = 937984704; + }; }; } diff --git a/modules/profiles/system/darwin/common.nix b/modules/profiles/system/darwin/common.nix index 9ecf699d..1b7403ee 100644 --- a/modules/profiles/system/darwin/common.nix +++ b/modules/profiles/system/darwin/common.nix @@ -6,7 +6,10 @@ settings = { trusted-users = [ config.system.primaryUser ]; extra-nix-path = [ "darwin-config=${flake}/lib/compat/darwin" ]; - extra-experimental-features = [ "nix-command" "flakes" ]; + extra-experimental-features = [ + "nix-command" + "flakes" + ]; }; }; diff --git a/modules/profiles/system/shells.nix b/modules/profiles/system/shells.nix index 37c1a88c..98126b4e 100644 --- a/modules/profiles/system/shells.nix +++ b/modules/profiles/system/shells.nix @@ -1,5 +1,8 @@ { pkgs, ... }: { environment.systemPackages = with pkgs; [ fish ]; - environment.shells = with pkgs; [ fish bashInteractive ]; + environment.shells = with pkgs; [ + fish + bashInteractive + ]; } diff --git a/modules/suites/default.nix b/modules/suites/default.nix index 2df5c0b4..099a37c1 100644 --- a/modules/suites/default.nix +++ b/modules/suites/default.nix @@ -1,6 +1,8 @@ { self, ... }: -let inherit (self) profiles; -in { +let + inherit (self) profiles; +in +{ flake.suites = { darwin = import ./system.nix { profiles = profiles.darwin; }; diff --git a/modules/suites/home.nix b/modules/suites/home.nix index a570dec9..5f25d65d 100644 --- a/modules/suites/home.nix +++ b/modules/suites/home.nix @@ -52,5 +52,15 @@ with profiles; work = [ git.large-repos ]; - minimal = [ autojump bat fish fzf git.common gh navi starship tools.common ]; + minimal = [ + autojump + bat + fish + fzf + git.common + gh + navi + starship + tools.common + ]; } diff --git a/users/default.nix b/users/default.nix index b4db3b3d..85d00ffe 100644 --- a/users/default.nix +++ b/users/default.nix @@ -1,6 +1,8 @@ { self, ... }: -let inherit (self.lib.hm) mkHomeManagerConfiguration; -in { +let + inherit (self.lib.hm) mkHomeManagerConfiguration; +in +{ flake.homeConfigurations = { ethan = mkHomeManagerConfiguration { system = "aarch64-darwin"; diff --git a/users/et/home.nix b/users/et/home.nix index 8f304e55..0a84eb55 100644 --- a/users/et/home.nix +++ b/users/et/home.nix @@ -1,7 +1,22 @@ -{ suites, secrets, profiles, ... }: { - imports = with suites; - base ++ development ++ work ++ identity - ++ (with profiles; [ haskell nodejs ]) ++ [ secrets.users.et.home ] ++ [ +{ + suites, + secrets, + profiles, + ... +}: +{ + imports = + with suites; + base + ++ development + ++ work + ++ identity + ++ (with profiles; [ + haskell + nodejs + ]) + ++ [ secrets.users.et.home ] + ++ [ ./profiles/git.nix ./profiles/jujutsu.nix ./profiles/mcp/figma.nix diff --git a/users/et/profiles/git.nix b/users/et/profiles/git.nix index 385dcde2..2f0e6bd9 100644 --- a/users/et/profiles/git.nix +++ b/users/et/profiles/git.nix @@ -1,6 +1,8 @@ { programs.git = { - settings = { user.email = "et@mercury.com"; }; + settings = { + user.email = "et@mercury.com"; + }; signing.key = "F8E4DBB3201AFD1E"; }; } diff --git a/users/et/profiles/mcp/firehydrant/default.nix b/users/et/profiles/mcp/firehydrant/default.nix index 9f3b4dbf..3faaf9ff 100644 --- a/users/et/profiles/mcp/firehydrant/default.nix +++ b/users/et/profiles/mcp/firehydrant/default.nix @@ -1,5 +1,13 @@ -{ config, lib, pkgs, ... }: { - sops.secrets = { firehydrant_mcp_api_key.sopsFile = ./secrets.json; }; +{ + config, + lib, + pkgs, + ... +}: +{ + sops.secrets = { + firehydrant_mcp_api_key.sopsFile = ./secrets.json; + }; programs.mcp.servers.firehydrant = { command = lib.getExe pkgs.firehydrant-mcp; diff --git a/users/et/profiles/mcp/grafana/default.nix b/users/et/profiles/mcp/grafana/default.nix index 88b6d806..e216b430 100644 --- a/users/et/profiles/mcp/grafana/default.nix +++ b/users/et/profiles/mcp/grafana/default.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, ... }: { +{ + config, + lib, + pkgs, + ... +}: +{ sops.secrets = { grafana_mcp_url.sopsFile = ./secrets.json; grafana_mcp_service_account_token.sopsFile = ./secrets.json; @@ -8,8 +14,7 @@ command = lib.getExe pkgs.mcp-grafana; env = { GRAFANA_URL = "$(cat ${config.sops.secrets.grafana_mcp_url.path}})"; - GRAFANA_SERVICE_ACCOUNT_TOKEN = - "$(cat ${config.sops.secrets.grafana_mcp_service_account_token.path}})"; + GRAFANA_SERVICE_ACCOUNT_TOKEN = "$(cat ${config.sops.secrets.grafana_mcp_service_account_token.path}})"; }; }; } diff --git a/users/et/profiles/mcp/postgres/default.nix b/users/et/profiles/mcp/postgres/default.nix index 3832511c..0ce61f2a 100644 --- a/users/et/profiles/mcp/postgres/default.nix +++ b/users/et/profiles/mcp/postgres/default.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, ... }: { +{ + config, + lib, + pkgs, + ... +}: +{ sops.secrets = { postgres_mcp_connection_string_production.sopsFile = ./secrets.json; postgres_mcp_connection_string_development.sopsFile = ./secrets.json; @@ -8,15 +14,13 @@ postgres-production = { command = lib.getExe pkgs.postgres-mcp; env = { - DATABASE_URI = - "$(cat ${config.sops.secrets.postgres_mcp_connection_string_production.path}})"; + DATABASE_URI = "$(cat ${config.sops.secrets.postgres_mcp_connection_string_production.path}})"; }; }; postgres-development = { command = lib.getExe pkgs.postgres-mcp; env = { - DATABASE_URI = - "$(cat ${config.sops.secrets.postgres_mcp_connection_string_development.path}})"; + DATABASE_URI = "$(cat ${config.sops.secrets.postgres_mcp_connection_string_development.path}})"; }; }; }; diff --git a/users/et/profiles/opencode/default.nix b/users/et/profiles/opencode/default.nix index 6d22abf2..d4ac2e01 100644 --- a/users/et/profiles/opencode/default.nix +++ b/users/et/profiles/opencode/default.nix @@ -2,16 +2,14 @@ sops.secrets = { opencode_anthropic_api_key = { sopsFile = ./secrets.json; - path = - "${config.xdg.dataHome}/secrets/opencode/opencode-anthropic-api-key"; + path = "${config.xdg.dataHome}/secrets/opencode/opencode-anthropic-api-key"; }; }; programs.opencode.settings = { provider.anthropic = { options = { - apiKey = - "{file:${config.sops.secrets.opencode_anthropic_api_key.path}}"; + apiKey = "{file:${config.sops.secrets.opencode_anthropic_api_key.path}}"; }; }; }; diff --git a/users/et/profiles/tmuxp.nix b/users/et/profiles/tmuxp.nix index c3110cf2..6ed1264f 100644 --- a/users/et/profiles/tmuxp.nix +++ b/users/et/profiles/tmuxp.nix @@ -7,24 +7,26 @@ focus = true; layout = "c5e0,212x37,0,0,3"; options = { }; - panes = [{ - focus = true; - shell_command = "direnv reload"; - }]; - start_directory = - "${config.home.homeDirectory}/Workspace/personal/tilde"; + panes = [ + { + focus = true; + shell_command = "direnv reload"; + } + ]; + start_directory = "${config.home.homeDirectory}/Workspace/personal/tilde"; window_name = "tilde"; } { focus = false; layout = "c5e0,212x37,0,0,3"; options = { }; - panes = [{ - focus = true; - shell_command = "direnv reload"; - }]; - start_directory = - "${config.home.homeDirectory}/Workspace/personal/tilde-secrets"; + panes = [ + { + focus = true; + shell_command = "direnv reload"; + } + ]; + start_directory = "${config.home.homeDirectory}/Workspace/personal/tilde-secrets"; window_name = "tilde-secrets"; } ]; diff --git a/users/et/profiles/tools.nix b/users/et/profiles/tools.nix index f57e5f4d..46ef87ae 100644 --- a/users/et/profiles/tools.nix +++ b/users/et/profiles/tools.nix @@ -1,8 +1,14 @@ { pkgs, ... }: { - home.packages = with pkgs; [ fnm mkcert ]; + home.packages = with pkgs; [ + fnm + mkcert + ]; - programs.fish.interactiveShellInit = let fnm = pkgs.lib.getExe pkgs.fnm; - in '' - ${fnm} env --use-on-cd --shell fish | source - ''; + programs.fish.interactiveShellInit = + let + fnm = pkgs.lib.getExe pkgs.fnm; + in + '' + ${fnm} env --use-on-cd --shell fish | source + ''; } diff --git a/users/et/profiles/vscode.nix b/users/et/profiles/vscode.nix index 4a872122..aa64ac28 100644 --- a/users/et/profiles/vscode.nix +++ b/users/et/profiles/vscode.nix @@ -52,7 +52,9 @@ ]; userSettings = { - "files.associations" = { "BUCK" = "starlark"; }; + "files.associations" = { + "BUCK" = "starlark"; + }; "[dockercompose]" = { "editor.insertSpaces" = true; "editor.tabSize" = 2; diff --git a/users/ethan/home.nix b/users/ethan/home.nix index 5dedac80..fd93eab8 100644 --- a/users/ethan/home.nix +++ b/users/ethan/home.nix @@ -1,13 +1,30 @@ -{ suites, profiles, pkgs, ... }: { - imports = (with suites; base ++ development ++ identity) - ++ (with profiles; [ elixir mise nodejs tools.media-management ruby ]) ++ [ +{ + suites, + profiles, + pkgs, + ... +}: +{ + imports = + (with suites; base ++ development ++ identity) + ++ (with profiles; [ + elixir + mise + nodejs + tools.media-management + ruby + ]) + ++ [ ./profiles/git.nix ./profiles/jujutsu.nix ./profiles/tmuxp.nix ./profiles/vscode.nix ]; - home.packages = with pkgs; [ restic nixd ]; + home.packages = with pkgs; [ + restic + nixd + ]; home = { username = "ethan"; diff --git a/users/ethan/profiles/git.nix b/users/ethan/profiles/git.nix index 0156f248..d8c2e01e 100644 --- a/users/ethan/profiles/git.nix +++ b/users/ethan/profiles/git.nix @@ -1,6 +1,8 @@ { programs.git = { - settings = { user.email = "ethan@turkeltaub.dev"; }; + settings = { + user.email = "ethan@turkeltaub.dev"; + }; signing.key = "0x690FEBBF6380166A"; }; } diff --git a/users/ethan/profiles/tmuxp.nix b/users/ethan/profiles/tmuxp.nix index 2469afe7..613274c8 100644 --- a/users/ethan/profiles/tmuxp.nix +++ b/users/ethan/profiles/tmuxp.nix @@ -2,62 +2,78 @@ programs.tmuxp.workspaces = { tilde = { session_name = "tilde"; - windows = [{ - focus = true; - layout = "c5e0,212x37,0,0,3"; - options = { }; - panes = [{ + windows = [ + { focus = true; - shell_command = "direnv reload"; - }]; - start_directory = "${config.home.homeDirectory}/Workspace/tilde"; - window_name = "fish"; - }]; + layout = "c5e0,212x37,0,0,3"; + options = { }; + panes = [ + { + focus = true; + shell_command = "direnv reload"; + } + ]; + start_directory = "${config.home.homeDirectory}/Workspace/tilde"; + window_name = "fish"; + } + ]; }; e10 = { session_name = "e10"; - windows = [{ - focus = true; - layout = "c5e0,212x37,0,0,3"; - options = { }; - panes = [{ + windows = [ + { focus = true; - shell_command = "direnv reload"; - }]; - start_directory = "${config.home.homeDirectory}/Workspace/e10"; - window_name = "fish"; - }]; + layout = "c5e0,212x37,0,0,3"; + options = { }; + panes = [ + { + focus = true; + shell_command = "direnv reload"; + } + ]; + start_directory = "${config.home.homeDirectory}/Workspace/e10"; + window_name = "fish"; + } + ]; }; ethan-haus = { session_name = "ethan-haus"; - windows = [{ - focus = true; - layout = "c5e0,212x37,0,0,3"; - options = { }; - panes = [{ + windows = [ + { focus = true; - shell_command = "direnv reload"; - }]; - start_directory = "${config.home.homeDirectory}/Workspace/ethan.haus"; - window_name = "fish"; - }]; + layout = "c5e0,212x37,0,0,3"; + options = { }; + panes = [ + { + focus = true; + shell_command = "direnv reload"; + } + ]; + start_directory = "${config.home.homeDirectory}/Workspace/ethan.haus"; + window_name = "fish"; + } + ]; }; turkdeau = { session_name = "turkdeau"; - windows = [{ - focus = true; - layout = "c5e0,212x37,0,0,3"; - options = { }; - panes = [{ + windows = [ + { focus = true; - shell_command = "direnv reload"; - }]; - start_directory = "${config.home.homeDirectory}/Workspace/turkdeau.com"; - window_name = "fish"; - }]; + layout = "c5e0,212x37,0,0,3"; + options = { }; + panes = [ + { + focus = true; + shell_command = "direnv reload"; + } + ]; + start_directory = "${config.home.homeDirectory}/Workspace/turkdeau.com"; + window_name = "fish"; + } + ]; }; }; } diff --git a/users/ethan/profiles/vscode.nix b/users/ethan/profiles/vscode.nix index 54438f0c..c2a8ff3f 100644 --- a/users/ethan/profiles/vscode.nix +++ b/users/ethan/profiles/vscode.nix @@ -15,7 +15,9 @@ } ]; userSettings = { - "[astro]" = { "editor.defaultFormatter" = "astro-build.astro-vscode"; }; + "[astro]" = { + "editor.defaultFormatter" = "astro-build.astro-vscode"; + }; }; }; }