From d35e5253887450a2eacba43406458968223097f6 Mon Sep 17 00:00:00 2001 From: Reboot-Codes Date: Thu, 3 Jul 2025 09:43:43 -0700 Subject: [PATCH] Nix-Index-Database --- common/home/default.nix | 4 +++- common/home/home.nix | 3 ++- common/nixos/default-config.nix | 1 - flake.lock | 21 +++++++++++++++++++++ flake.nix | 11 ++++++++--- nixos/default.nix | 5 +++-- 6 files changed, 37 insertions(+), 8 deletions(-) diff --git a/common/home/default.nix b/common/home/default.nix index 0824fc1..b56573e 100644 --- a/common/home/default.nix +++ b/common/home/default.nix @@ -1,10 +1,12 @@ -{ hostConfig, pkgs, pkgs-stable, pwndbg, ... }: { +{ hostConfig, pkgs, pkgs-stable, pwndbg, nix-index-database, ... }: { home-manager = { backupFileExtension = ".bak"; users."${hostConfig.username}" = { + imports = [ ./home.nix + nix-index-database.hmModules.nix-index (./configs + "/${hostConfig.systemType}.nix") ]; }; diff --git a/common/home/home.nix b/common/home/home.nix index c44815e..13a76a8 100755 --- a/common/home/home.nix +++ b/common/home/home.nix @@ -1,9 +1,10 @@ # This file has general setting configs to make sure that our experiences are consistent. -{ config, pkgs, pkgs-stable, home-manager, ...}: { +{ config, pkgs, pkgs-stable, home-manager, nix-index-database, ...}: { programs = { home-manager.enable = true; direnv.enable = true; + nix-index.enable = true; zsh = { enable = true; diff --git a/common/nixos/default-config.nix b/common/nixos/default-config.nix index 023a5e2..6e1adfb 100644 --- a/common/nixos/default-config.nix +++ b/common/nixos/default-config.nix @@ -146,7 +146,6 @@ libraries = import ../utils/nix-ld.nix { inherit pkgs pkgs-stable lib; }; }; - command-not-found.enable = true; # This basically doesn't work imo. appimage.binfmt = true; }; diff --git a/flake.lock b/flake.lock index 0af0272..c52896a 100644 --- a/flake.lock +++ b/flake.lock @@ -232,6 +232,26 @@ "type": "github" } }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751170039, + "narHash": "sha256-3EKpUmyGmHYA/RuhZjINTZPU+OFWko0eDwazUOW64nw=", + "owner": "nix-community", + "repo": "nix-index-database", + "rev": "9c932ae632d6b5150515e5749b198c175d8565db", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-index-database", + "type": "github" + } + }, "nixGL": { "inputs": { "flake-utils": "flake-utils", @@ -417,6 +437,7 @@ "disko": "disko", "flatpaks": "flatpaks", "home-manager": "home-manager_2", + "nix-index-database": "nix-index-database", "nixGL": "nixGL", "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable", diff --git a/flake.nix b/flake.nix index c056bbc..be947eb 100755 --- a/flake.nix +++ b/flake.nix @@ -54,16 +54,21 @@ url = "github:pwndbg/pwndbg"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nix-index-database = { + url = "github:nix-community/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, nixpkgs-stable, home-manager, flatpaks, rust-overlay, nur, chaotic, aagl, nixGL, disko, pwndbg }: { + outputs = { self, nixpkgs, nixpkgs-stable, home-manager, flatpaks, rust-overlay, nur, chaotic, aagl, nixGL, disko, pwndbg, nix-index-database }: { nixosConfigurations = import ./nixos { - inherit nixpkgs nixpkgs-stable home-manager flatpaks rust-overlay nur chaotic aagl nixGL disko pwndbg; + inherit nixpkgs nixpkgs-stable home-manager flatpaks rust-overlay nur chaotic aagl nixGL disko pwndbg nix-index-database; }; # For *nix systems that are not NixOS or macOS homeConfigurations = import ./home-manager.nix { - inherit nixpkgs nixpkgs-stable home-manager flatpaks rust-overlay nur chaotic aagl nixGL pwndbg; + inherit nixpkgs nixpkgs-stable home-manager flatpaks rust-overlay nur chaotic aagl nixGL pwndbg nix-index-database; }; }; } diff --git a/nixos/default.nix b/nixos/default.nix index 75f963c..e7e4ca1 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,4 +1,4 @@ -{ disko, nixpkgs, nixpkgs-stable, home-manager, flatpaks, rust-overlay, nur, chaotic, aagl, nixGL, pwndbg, ... }: let +{ disko, nixpkgs, nixpkgs-stable, home-manager, flatpaks, rust-overlay, nur, chaotic, aagl, nixGL, pwndbg, nix-index-database, ... }: let defaultDesktop = { username = "reboot"; system = "x86_64-linux"; @@ -34,7 +34,7 @@ in nixpkgs.lib.nixosSystem rec { # The `specialArgs` parameter passes the non-default nixpkgs instances to other nix modules specialArgs = { - inherit pkgs-stable rust-overlay nixGL hostConfig pwndbg; + inherit pkgs-stable rust-overlay nixGL hostConfig pwndbg nix-index-database; }; modules = [ @@ -43,6 +43,7 @@ in nixpkgs.lib.nixosSystem rec { flatpaks.nixosModules.nix-flatpak nur.modules.nixos.default chaotic.nixosModules.default + nix-index-database.nixosModules.nix-index { networking.hostName = "${hostname}"; # Define your hostname. -- 2.51.2