diff --git a/SwarselSystems.org b/SwarselSystems.org index c77f6f6..7a93daa 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -403,6 +403,7 @@ Mind the comma at the end. You need this because the =...= is being passed as th nixos-hardware, nix-alien, nswitch-rcm-nix, + nix-index-database, #+end_src @@ -429,8 +430,11 @@ A short overview over each input and what it does: Provides specific hardware setting for some hardware configurations. For example, this sets some better defaults for my Lenovo Thinkpad P14s Gen2. - [[https://github.com/thiagokokada/nix-alien][nix-alien]] This is supposed to allow me to run unpatched libraries directly without a need for ELF patching or resorting to =steam-run=. However, I have not yet gotten this to work. -- nswitch-rcm-nix +- [[https://github.com/Swarsel/nswitch-rcm-nix][nswitch-rcm-nix]] Allows auto injection of payloads upon connecting a Nintendo Switch. +- [[https://github.com/nix-community/nix-index-database][nix-index-database]] + This provides a database for =nix-index= that is updated weekly. This allows for declarative management, without needing to run the =nix-index= command for database assembly. + #+begin_src nix :tangle no :noweb-ref flakeinputs @@ -499,6 +503,12 @@ A short overview over each input and what it does: url = "github:Swarsel/nswitch-rcm-nix"; }; + # weekly updated nix-index database + nix-index-database = { + url = "github:nix-community/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + #+end_src *** let :PROPERTIES: @@ -545,6 +555,7 @@ Lastly I define some common module lists that I can simply load depending on the ]; # Home-Manager modules wanted on both NixOS and non-NixOS systems mixedModules = [ sops-nix.homeManagerModules.sops + nix-index-database.hmModules.nix-index ./profiles/common/home.nix ]; @@ -5751,13 +5762,34 @@ This section is for programs that require no further configuration. zsh Integrat yt-dlp.enable = true; mpv.enable = true; jq.enable = true; - nix-index.enable = true; ripgrep.enable = true; pandoc.enable = true; fzf.enable = true; zoxide.enable = true; - }; +#+end_src +*** nix-index + +nix-index provides a way to find out which packages are provided by which derivations. By default it also comes with a replacement for =command-not-found.sh=, however, the implementation is based on a channel based setup. I like consistency, so I replace the command with one that provides a flakes-based output. + +#+begin_src nix :tangle profiles/common/home.nix + + nix-index = let + command-not-found = pkgs.runCommandLocal "command-not-found.sh" { } '' + mkdir -p $out/etc/profile.d + substitute ${../../scripts/command-not-found.sh} \ + $out/etc/profile.d/command-not-found.sh \ + --replace @nix-locate@ ${pkgs.nix-index}/bin/nix-locate \ + --replace @tput@ ${pkgs.ncurses}/bin/tput + ''; + in { + enable = true; + package = pkgs.symlinkJoin { + name = "nix-index"; + paths = [ command-not-found ]; + }; + }; + }; #+end_src *** password-store diff --git a/flake.lock b/flake.lock index 7311653..1399b51 100644 --- a/flake.lock +++ b/flake.lock @@ -572,6 +572,26 @@ "type": "github" } }, + "nix-index-database_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720926593, + "narHash": "sha256-fW6e27L6qY6s+TxInwrS2EXZZfhMAlaNqT0sWS49qMA=", + "owner": "nix-community", + "repo": "nix-index-database", + "rev": "5fe5b0cdf1268112dc96319388819b46dc051ef4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-index-database", + "type": "github" + } + }, "nix-on-droid": { "inputs": { "home-manager": "home-manager_2", @@ -1015,6 +1035,7 @@ "lanzaboote": "lanzaboote", "nix-alien": "nix-alien", "nix-gaming": "nix-gaming", + "nix-index-database": "nix-index-database_2", "nix-on-droid": "nix-on-droid", "nixgl": "nixgl", "nixos-generators": "nixos-generators", diff --git a/flake.nix b/flake.nix index df2dcdb..9142c2d 100644 --- a/flake.nix +++ b/flake.nix @@ -66,6 +66,12 @@ nswitch-rcm-nix = { url = "github:Swarsel/nswitch-rcm-nix"; }; + + # weekly updated nix-index database + nix-index-database = { + url = "github:nix-community/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs @ { @@ -82,6 +88,7 @@ nixos-hardware, nix-alien, nswitch-rcm-nix, + nix-index-database, ... }: let system = "x86_64-linux"; # not very portable, but I do not use other architectures at the moment @@ -127,6 +134,7 @@ # Home-Manager modules wanted on both NixOS and non-NixOS systems mixedModules = [ sops-nix.homeManagerModules.sops + nix-index-database.hmModules.nix-index ./profiles/common/home.nix ]; in { diff --git a/index.html b/index.html index 90ff89c..f08a3af 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +-This file has 41033 words spanning 10909 lines and was last revised on 2024-07-19 00:52:31 +0200. +This file has 41233 words spanning 10941 lines and was last revised on 2024-07-19 14:29:02 +0200.
@@ -437,7 +438,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry
-My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-07-19 00:52:31 +0200) +My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-07-19 14:29:02 +0200)
steam-run. However, I have not yet gotten this to work.nix-index that is updated weekly. This allows for declarative management, without needing to run the nix-index command for database assembly.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
@@ -1000,6 +1005,12 @@ nswitch-rcm-nix = {
url = "github:Swarsel/nswitch-rcm-nix";
};
+# weekly updated nix-index database
+nix-index-database = {
+ url = "github:nix-community/nix-index-database";
+ inputs.nixpkgs.follows = "nixpkgs";
+};
+
+nix-index provides a way to find out which packages are provided by which derivations. By default it also comes with a replacement for command-not-found.sh, however, the implementation is based on a channel based setup. I like consistency, so I replace the command with one that provides a flakes-based output.
+
+nix-index = let
+ command-not-found = pkgs.runCommandLocal "command-not-found.sh" { } ''
+ mkdir -p $out/etc/profile.d
+ substitute ${../../scripts/command-not-found.sh} \
+ $out/etc/profile.d/command-not-found.sh \
+ --replace @nix-locate@ ${pkgs.nix-index}/bin/nix-locate \
+ --replace @tput@ ${pkgs.ncurses}/bin/tput
+ '';
+in {
+ enable = true;
+ package = pkgs.symlinkJoin {
+ name = "nix-index";
+ paths = [ command-not-found ];
+ };
+};
+};
+
+
Enables password store with the pass-otp extension which allows me to store and generate one-time-passwords.
@@ -7015,7 +7053,7 @@ programs.password-store = {
Enables direnv, which I use for nearly all of my nix dev flakes. @@ -7033,7 +7071,7 @@ programs.direnv = {
Eza provides me with a better ls command and some other useful aliases.
@@ -7056,7 +7094,7 @@ programs.eza = {
Here I set up my git config, automatic signing of commits, useful aliases for my ost used commands (for when I am not using Magit) as well as a git template defined in Linking dotfiles. @@ -7106,7 +7144,7 @@ programs.git = {
Here I only need to set basic layout options - the rest is being managed by stylix. @@ -7131,7 +7169,7 @@ programs.fuzzel = {
Starship makes my zsh look cooler! I have symbols for most programming languages and toolchains, also I build my own powerline.
@@ -7248,7 +7286,7 @@ programs.starship = {
Kitty is the terminal emulator of choice for me, it is nice to configure using nix, fast, and has a nice style. @@ -7275,7 +7313,7 @@ programs.kitty = {
zsh is the most convenient shell for me and it happens to be super neat to configure within home manager. @@ -7341,7 +7379,7 @@ programs.zsh = {
Normally I use 4 mail accounts - here I set them all up. Three of them are Google accounts (sadly), which are a chore to setup. The last is just a sender account that I setup SMTP for here. @@ -7482,7 +7520,7 @@ accounts.email = {
By using the emacs-overlay NixOS module, I can install all Emacs packages that I want to use right through NixOS. This is done by passing my init.el file to the configuration which will then be parsed upon system rebuild, looking for use-package sections in the Elisp code. Also I define here the style of Emacs that I want to run - I am going with native Wayland Emacs here (emacs-pgtk). All of the nice options such as tree-sitter support are enabled by default, so I do not need to adjust the build process.
@@ -7545,7 +7583,7 @@ programs.emacs = {
Again I am just using the first bar option here that I was able to find good understandable documentation for. Of note is that the `cpu` section's `format` is not defined here, but in section 1 (since not every machine has the same number of cores) @@ -7757,7 +7795,7 @@ programs.waybar = {
Setting up firefox along with some policies that are important to me (mostly disabling telemetry related stuff as well as Pocket). I also enable some integrations that enable super useful packages, namely tridactyl and browserpass.
@@ -7877,7 +7915,7 @@ programs.firefox = {
Services that can be defined through home-manager should be defined here. @@ -8016,7 +8054,7 @@ group-by=category
I am currently using SwayFX, which adds some nice effects to sway, like rounded corners and hiding the separator between title and content of a window. @@ -8403,6 +8441,12 @@ This tangles the flake.nix file; This block only needs to be touched when updati url = "github:Swarsel/nswitch-rcm-nix"; }; + # weekly updated nix-index database + nix-index-database = { + url = "github:nix-community/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; outputs = inputs@{ @@ -8420,6 +8464,7 @@ This tangles the flake.nix file; This block only needs to be touched when updati nixos-hardware, nix-alien, nswitch-rcm-nix, + nix-index-database, ... }: let @@ -8458,6 +8503,7 @@ This tangles the flake.nix file; This block only needs to be touched when updati ]; # Home-Manager modules wanted on both NixOS and non-NixOS systems mixedModules = [ sops-nix.homeManagerModules.sops + nix-index-database.hmModules.nix-index ./profiles/common/home.nix ]; @@ -9341,7 +9387,7 @@ The standard Emacs behaviour for the Python process shell is a bit annoying. Thi
This function searches for common delimiters in region and removes them, summarizing all captured lines by it. @@ -12912,7 +12958,7 @@ My laptop, sadly soon to be replaced by a new one, since most basic functions ar