From 1f8cd61dfa9362a54f14d8e5652d0eb97d45e50f Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Mon, 14 Oct 2024 22:24:08 +1100 Subject: [PATCH] 49 papercuts --- CHANGELOG.md | 1 + flake.lock | 21 +++++++++++++++++++++ flake.nix | 9 ++++++++- modules/base.nix | 5 ++++- modules/nix-index.nix | 11 ----------- 5 files changed, 34 insertions(+), 13 deletions(-) delete mode 100644 modules/nix-index.nix diff --git a/CHANGELOG.md b/CHANGELOG.md index cb57abd..e020ebe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- Use `nix-index-database` for prebuilt `nix-index` databases on all platforms - Fixed `darwin-rebuild switch` outputting `Dock` PID - Fixed `vscode` build on macOS - Removed `berkeleydb` and `swift-quit` overlays diff --git a/flake.lock b/flake.lock index cf5a5d0..9233594 100644 --- a/flake.lock +++ b/flake.lock @@ -334,6 +334,26 @@ "type": "github" } }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1728790083, + "narHash": "sha256-grMdAd4KSU6uPqsfLzA1B/3pb9GtGI9o8qb0qFzEU/Y=", + "owner": "nix-community", + "repo": "nix-index-database", + "rev": "5c54c33aa04df5dd4b0984b7eb861d1981009b22", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-index-database", + "type": "github" + } + }, "nix-overlay": { "inputs": { "empty": [], @@ -473,6 +493,7 @@ "home-manager": "home-manager", "impermanence": "impermanence", "nix-darwin": "nix-darwin", + "nix-index-database": "nix-index-database", "nix-overlay": "nix-overlay", "nixos-anywhere": "nixos-anywhere", "nixos-apple-silicon": "nixos-apple-silicon", diff --git a/flake.nix b/flake.nix index ca65bb6..3455178 100644 --- a/flake.nix +++ b/flake.nix @@ -67,8 +67,12 @@ inputs.impermanence.url = "github:nix-community/impermanence"; + inputs.nix-index-database.url = "github:nix-community/nix-index-database"; + inputs.nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; + outputs = inputs@{ self, nixpkgs, nix-darwin, home-manager, flake-utils-plus - , agenix, disko, impermanence, flake-parts, git-hooks, terranix, ... }: + , agenix, disko, impermanence, nix-index-database, flake-parts, git-hooks + , terranix, ... }: nixpkgs.lib.recursiveUpdate @@ -133,6 +137,7 @@ darwinModules = map (getAttr "darwinModule") (filter (hasAttr "darwinModule") modulesToImport); home = [ + nix-index-database.hmModules.nix-index impermanence.nixosModules.home-manager.impermanence ./hosts/${host}/home.nix ] ++ homeModules; @@ -160,6 +165,7 @@ agenix.nixosModules.age disko.nixosModules.disko impermanence.nixosModules.impermanence + nix-index-database.nixosModules.nix-index ./hosts/${host}/configuration.nix ] ++ nixosModules ++ [ home-manager.nixosModules.home-manager @@ -190,6 +196,7 @@ modules = [ flake-utils-plus.darwinModules.autoGenFromInputs agenix.darwinModules.age + nix-index-database.darwinModules.nix-index ./hosts/${host}/darwin-configuration.nix ] ++ darwinModules ++ [ home-manager.darwinModules.home-manager diff --git a/modules/base.nix b/modules/base.nix index f558ddf..398f8c7 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -67,6 +67,8 @@ let path = "${config.users.users.${user}.home}/.zshrc.secrets"; owner = user; }; + + programs.nix-index-database.comma.enable = true; }; in { imports = [ @@ -75,7 +77,6 @@ in { "cache" "flakes" "kitty" - "nix-index" "syncthing" "termite" "vm" @@ -361,6 +362,8 @@ in { }; }; + programs.nix-index-database.comma.enable = true; + programs.direnv.enable = true; programs.direnv.nix-direnv.enable = true; diff --git a/modules/nix-index.nix b/modules/nix-index.nix deleted file mode 100644 index 869238e..0000000 --- a/modules/nix-index.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - homeModule = { pkgs, lib, ... }: - let - inherit (lib) mkIf; - inherit (pkgs.stdenv) hostPlatform; - in (mkIf (!hostPlatform.isDarwin || !hostPlatform.isAarch64) { - home.packages = builtins.attrValues { inherit (pkgs) comma; }; - - programs.nix-index.enable = true; - }); -}