From 8fee70f405c33fa590f59915e486b8f3483980ac Mon Sep 17 00:00:00 2001 From: Tyler Beckman Date: Mon, 2 Dec 2024 19:35:25 -0700 Subject: [PATCH] Add command-not-found and comma support --- flake.nix | 11 ++++++++++- hosts/laptop/modules/packages.nix | 6 +++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index ddf1d63..f11475e 100755 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,11 @@ # General NixOS config nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-24-11.url = "github:NixOS/nixpkgs/nixos-24.11"; + # Nixpkgs index for command-not-found support + nix-index-database = { + url = "github:nix-community/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # NixOS Grub Themes (hyperfluent) nixos-grub-themes = { url = "github:jeslie0/nixos-grub-themes"; @@ -45,7 +50,7 @@ }; }; - outputs = inputs@{ nixpkgs, home-manager, plasma-manager, ... }: let + outputs = inputs@{ nixpkgs, home-manager, plasma-manager, nix-index-database, ... }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; secrets = import ./secrets.nix; @@ -56,6 +61,10 @@ modules = [ ./hosts/laptop + # Better command-not-found + nix-index-database.nixosModules.nix-index + { programs.nix-index-database.comma.enable = true; } + # Home manager home-manager.nixosModules.home-manager ./home-manager diff --git a/hosts/laptop/modules/packages.nix b/hosts/laptop/modules/packages.nix index 293eb38..c2373ef 100644 --- a/hosts/laptop/modules/packages.nix +++ b/hosts/laptop/modules/packages.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, inputs, ... }: { # Install system packages environment.systemPackages = with pkgs; [ @@ -22,6 +22,10 @@ # Install zsh programs.zsh.enable = true; + # Disable default command-not-found (it doesn't work with flakes) + programs.command-not-found.enable = false; + programs.nix-index.enable = true; + # Manage default firefox web browser install programs.firefox = { enable = true;