feat: add nix-index-database

This commit is contained in:
Swarsel 2024-07-19 14:30:07 +02:00
parent 6ea2eb0782
commit 193cf5748e
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
6 changed files with 196 additions and 41 deletions

View file

@ -403,6 +403,7 @@ Mind the comma at the end. You need this because the =...= is being passed as th
nixos-hardware, nixos-hardware,
nix-alien, nix-alien,
nswitch-rcm-nix, nswitch-rcm-nix,
nix-index-database,
#+end_src #+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. 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]] - [[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. 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. 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 #+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"; 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 #+end_src
*** let *** let
:PROPERTIES: :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 # Home-Manager modules wanted on both NixOS and non-NixOS systems
mixedModules = [ sops-nix.homeManagerModules.sops mixedModules = [ sops-nix.homeManagerModules.sops
nix-index-database.hmModules.nix-index
./profiles/common/home.nix ./profiles/common/home.nix
]; ];
@ -5751,13 +5762,34 @@ This section is for programs that require no further configuration. zsh Integrat
yt-dlp.enable = true; yt-dlp.enable = true;
mpv.enable = true; mpv.enable = true;
jq.enable = true; jq.enable = true;
nix-index.enable = true;
ripgrep.enable = true; ripgrep.enable = true;
pandoc.enable = true; pandoc.enable = true;
fzf.enable = true; fzf.enable = true;
zoxide.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 #+end_src
*** password-store *** password-store

21
flake.lock generated
View file

@ -572,6 +572,26 @@
"type": "github" "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": { "nix-on-droid": {
"inputs": { "inputs": {
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
@ -1015,6 +1035,7 @@
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nix-alien": "nix-alien", "nix-alien": "nix-alien",
"nix-gaming": "nix-gaming", "nix-gaming": "nix-gaming",
"nix-index-database": "nix-index-database_2",
"nix-on-droid": "nix-on-droid", "nix-on-droid": "nix-on-droid",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",

View file

@ -66,6 +66,12 @@
nswitch-rcm-nix = { nswitch-rcm-nix = {
url = "github:Swarsel/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 @ { outputs = inputs @ {
@ -82,6 +88,7 @@
nixos-hardware, nixos-hardware,
nix-alien, nix-alien,
nswitch-rcm-nix, nswitch-rcm-nix,
nix-index-database,
... ...
}: let }: let
system = "x86_64-linux"; # not very portable, but I do not use other architectures at the moment 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 # Home-Manager modules wanted on both NixOS and non-NixOS systems
mixedModules = [ mixedModules = [
sops-nix.homeManagerModules.sops sops-nix.homeManagerModules.sops
nix-index-database.hmModules.nix-index
./profiles/common/home.nix ./profiles/common/home.nix
]; ];
in { in {

View file

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2024-07-19 Fr 00:52 --> <!-- 2024-07-19 Fr 14:29 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>SwarselSystems: NixOS + Emacs Configuration</title> <title>SwarselSystems: NixOS + Emacs Configuration</title>
@ -261,20 +261,21 @@
<li><a href="#h:5ef03803-e150-41bc-b603-e80d60d96efc">3.3.6. Linking dotfiles</a></li> <li><a href="#h:5ef03803-e150-41bc-b603-e80d60d96efc">3.3.6. Linking dotfiles</a></li>
<li><a href="#h:4486b02f-4fb8-432b-bfa2-2e786206341d">3.3.7. Sourcing environment variables</a></li> <li><a href="#h:4486b02f-4fb8-432b-bfa2-2e786206341d">3.3.7. Sourcing environment variables</a></li>
<li><a href="#h:070a75ce-e209-4cda-aa25-e979bbf75d47">3.3.8. Programs</a></li> <li><a href="#h:070a75ce-e209-4cda-aa25-e979bbf75d47">3.3.8. Programs</a></li>
<li><a href="#h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae">3.3.9. password-store</a></li> <li><a href="#org5609ccf">3.3.9. nix-index</a></li>
<li><a href="#h:1ab84307-b3fb-4c32-9def-4b89a53a8547">3.3.10. direnv</a></li> <li><a href="#h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae">3.3.10. password-store</a></li>
<li><a href="#h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6">3.3.11. eza</a></li> <li><a href="#h:1ab84307-b3fb-4c32-9def-4b89a53a8547">3.3.11. direnv</a></li>
<li><a href="#h:419675ec-3310-438e-80ae-9eaa798a319d">3.3.12. git</a></li> <li><a href="#h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6">3.3.12. eza</a></li>
<li><a href="#h:069cabf3-df14-49ba-8d17-75f2bcf34fbf">3.3.13. Fuzzel</a></li> <li><a href="#h:419675ec-3310-438e-80ae-9eaa798a319d">3.3.13. git</a></li>
<li><a href="#h:55212502-c8f6-43af-ae99-55c8377ef34e">3.3.14. Starship</a></li> <li><a href="#h:069cabf3-df14-49ba-8d17-75f2bcf34fbf">3.3.14. Fuzzel</a></li>
<li><a href="#h:5f1287db-d2e8-49aa-8c58-730129c7795c">3.3.15. Kitty</a></li> <li><a href="#h:55212502-c8f6-43af-ae99-55c8377ef34e">3.3.15. Starship</a></li>
<li><a href="#h:91dd4cc4-aada-4e74-be23-0cc69ed85af5">3.3.16. zsh</a></li> <li><a href="#h:5f1287db-d2e8-49aa-8c58-730129c7795c">3.3.16. Kitty</a></li>
<li><a href="#h:506d01fc-c20b-473a-ac78-bce4b53fe0e3">3.3.17. Mail</a></li> <li><a href="#h:91dd4cc4-aada-4e74-be23-0cc69ed85af5">3.3.17. zsh</a></li>
<li><a href="#h:c05d1b64-7110-4151-b436-46bc447113b4">3.3.18. Home-manager: Emacs</a></li> <li><a href="#h:506d01fc-c20b-473a-ac78-bce4b53fe0e3">3.3.18. Mail</a></li>
<li><a href="#h:0bf51f63-01c0-4053-a591-7f0c5697c690">3.3.19. Waybar</a></li> <li><a href="#h:c05d1b64-7110-4151-b436-46bc447113b4">3.3.19. Home-manager: Emacs</a></li>
<li><a href="#h:fbec0bd4-690b-4f79-8b2b-a40263760a96">3.3.20. Firefox</a></li> <li><a href="#h:0bf51f63-01c0-4053-a591-7f0c5697c690">3.3.20. Waybar</a></li>
<li><a href="#h:387c3a82-1fb1-4c0f-8051-874e2acb8804">3.3.21. Services</a></li> <li><a href="#h:fbec0bd4-690b-4f79-8b2b-a40263760a96">3.3.21. Firefox</a></li>
<li><a href="#h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20">3.3.22. Sway</a></li> <li><a href="#h:387c3a82-1fb1-4c0f-8051-874e2acb8804">3.3.22. Services</a></li>
<li><a href="#h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20">3.3.23. Sway</a></li>
</ul> </ul>
</li> </li>
<li><a href="#h:aee5ec75-7ca6-40d8-b6ac-a3e7e33a474b">3.4. flake.nix template and Closing Parenthesis (this needs to be the last heading in the Systems header)</a> <li><a href="#h:aee5ec75-7ca6-40d8-b6ac-a3e7e33a474b">3.4. flake.nix template and Closing Parenthesis (this needs to be the last heading in the Systems header)</a>
@ -387,7 +388,7 @@
</div> </div>
</div> </div>
<p> <p>
<b>This file has 41033 words spanning 10909 lines and was last revised on 2024-07-19 00:52:31 +0200.</b> <b>This file has 41233 words spanning 10941 lines and was last revised on 2024-07-19 14:29:02 +0200.</b>
</p> </p>
<p> <p>
@ -437,7 +438,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry
</p> </p>
<p> <p>
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)
</p></li> </p></li>
</ul> </ul>
@ -899,6 +900,7 @@ lanzaboote,
nixos-hardware, nixos-hardware,
nix-alien, nix-alien,
nswitch-rcm-nix, nswitch-rcm-nix,
nix-index-database,
</pre> </pre>
</div> </div>
@ -929,10 +931,13 @@ This brings nix to android in an app that is similar to tmux! Of course most of
Provides specific hardware setting for some hardware configurations. For example, this sets some better defaults for my Lenovo Thinkpad P14s Gen2.</li> Provides specific hardware setting for some hardware configurations. For example, this sets some better defaults for my Lenovo Thinkpad P14s Gen2.</li>
<li><a href="https://github.com/thiagokokada/nix-alien">nix-alien</a> <li><a href="https://github.com/thiagokokada/nix-alien">nix-alien</a>
This is supposed to allow me to run unpatched libraries directly without a need for ELF patching or resorting to <code>steam-run</code>. However, I have not yet gotten this to work.</li> This is supposed to allow me to run unpatched libraries directly without a need for ELF patching or resorting to <code>steam-run</code>. However, I have not yet gotten this to work.</li>
<li>nswitch-rcm-nix <li><a href="https://github.com/Swarsel/nswitch-rcm-nix">nswitch-rcm-nix</a>
Allows auto injection of payloads upon connecting a Nintendo Switch.</li> Allows auto injection of payloads upon connecting a Nintendo Switch.</li>
<li><a href="https://github.com/nix-community/nix-index-database">nix-index-database</a>
This provides a database for <code>nix-index</code> that is updated weekly. This allows for declarative management, without needing to run the <code>nix-index</code> command for database assembly.</li>
</ul> </ul>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-nix"> <pre class="src src-nix">
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
@ -1000,6 +1005,12 @@ nswitch-rcm-nix = {
url = "github:Swarsel/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";
};
</pre> </pre>
</div> </div>
</div> </div>
@ -1051,6 +1062,7 @@ homeModules = [ stylix.homeManagerModules.stylix
]; ];
# Home-Manager modules wanted on both NixOS and non-NixOS systems # Home-Manager modules wanted on both NixOS and non-NixOS systems
mixedModules = [ sops-nix.homeManagerModules.sops mixedModules = [ sops-nix.homeManagerModules.sops
nix-index-database.hmModules.nix-index
./profiles/common/home.nix ./profiles/common/home.nix
]; ];
@ -6983,21 +6995,47 @@ programs = {
yt-dlp.enable = true; yt-dlp.enable = true;
mpv.enable = true; mpv.enable = true;
jq.enable = true; jq.enable = true;
nix-index.enable = true;
ripgrep.enable = true; ripgrep.enable = true;
pandoc.enable = true; pandoc.enable = true;
fzf.enable = true; fzf.enable = true;
zoxide.enable = true; zoxide.enable = true;
};
</pre> </pre>
</div> </div>
</div> </div>
</li> </li>
</ol> </ol>
</div> </div>
<div id="outline-container-org5609ccf" class="outline-4">
<h4 id="org5609ccf"><span class="section-number-4">3.3.9.</span> nix-index</h4>
<div class="outline-text-4" id="text-3-3-9">
<p>
nix-index provides a way to find out which packages are provided by which derivations. By default it also comes with a replacement for <code>command-not-found.sh</code>, 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.
</p>
<div class="org-src-container">
<pre class="src src-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 ];
};
};
};
</pre>
</div>
</div>
</div>
<div id="outline-container-h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae" class="outline-4"> <div id="outline-container-h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae" class="outline-4">
<h4 id="h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae"><span class="section-number-4">3.3.9.</span> password-store</h4> <h4 id="h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae"><span class="section-number-4">3.3.10.</span> password-store</h4>
<div class="outline-text-4" id="text-h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae"> <div class="outline-text-4" id="text-h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae">
<p> <p>
Enables password store with the <code>pass-otp</code> extension which allows me to store and generate one-time-passwords. Enables password store with the <code>pass-otp</code> extension which allows me to store and generate one-time-passwords.
@ -7015,7 +7053,7 @@ programs.password-store = {
</div> </div>
</div> </div>
<div id="outline-container-h:1ab84307-b3fb-4c32-9def-4b89a53a8547" class="outline-4"> <div id="outline-container-h:1ab84307-b3fb-4c32-9def-4b89a53a8547" class="outline-4">
<h4 id="h:1ab84307-b3fb-4c32-9def-4b89a53a8547"><span class="section-number-4">3.3.10.</span> direnv</h4> <h4 id="h:1ab84307-b3fb-4c32-9def-4b89a53a8547"><span class="section-number-4">3.3.11.</span> direnv</h4>
<div class="outline-text-4" id="text-h:1ab84307-b3fb-4c32-9def-4b89a53a8547"> <div class="outline-text-4" id="text-h:1ab84307-b3fb-4c32-9def-4b89a53a8547">
<p> <p>
Enables direnv, which I use for nearly all of my nix dev flakes. Enables direnv, which I use for nearly all of my nix dev flakes.
@ -7033,7 +7071,7 @@ programs.direnv = {
</div> </div>
</div> </div>
<div id="outline-container-h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6" class="outline-4"> <div id="outline-container-h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6" class="outline-4">
<h4 id="h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6"><span class="section-number-4">3.3.11.</span> eza</h4> <h4 id="h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6"><span class="section-number-4">3.3.12.</span> eza</h4>
<div class="outline-text-4" id="text-h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6"> <div class="outline-text-4" id="text-h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6">
<p> <p>
Eza provides me with a better <code>ls</code> command and some other useful aliases. Eza provides me with a better <code>ls</code> command and some other useful aliases.
@ -7056,7 +7094,7 @@ programs.eza = {
</div> </div>
</div> </div>
<div id="outline-container-h:419675ec-3310-438e-80ae-9eaa798a319d" class="outline-4"> <div id="outline-container-h:419675ec-3310-438e-80ae-9eaa798a319d" class="outline-4">
<h4 id="h:419675ec-3310-438e-80ae-9eaa798a319d"><span class="section-number-4">3.3.12.</span> git</h4> <h4 id="h:419675ec-3310-438e-80ae-9eaa798a319d"><span class="section-number-4">3.3.13.</span> git</h4>
<div class="outline-text-4" id="text-h:419675ec-3310-438e-80ae-9eaa798a319d"> <div class="outline-text-4" id="text-h:419675ec-3310-438e-80ae-9eaa798a319d">
<p> <p>
Here I set up my git config, automatic signing of commits, useful aliases for my ost used commands (for when I am not using <a href="#h:d2c7323d-f8c6-4f23-b70a-930e3e4ecce5">Magit</a>) as well as a git template defined in <a href="#h:5ef03803-e150-41bc-b603-e80d60d96efc">Linking dotfiles</a>. Here I set up my git config, automatic signing of commits, useful aliases for my ost used commands (for when I am not using <a href="#h:d2c7323d-f8c6-4f23-b70a-930e3e4ecce5">Magit</a>) as well as a git template defined in <a href="#h:5ef03803-e150-41bc-b603-e80d60d96efc">Linking dotfiles</a>.
@ -7106,7 +7144,7 @@ programs.git = {
</div> </div>
</div> </div>
<div id="outline-container-h:069cabf3-df14-49ba-8d17-75f2bcf34fbf" class="outline-4"> <div id="outline-container-h:069cabf3-df14-49ba-8d17-75f2bcf34fbf" class="outline-4">
<h4 id="h:069cabf3-df14-49ba-8d17-75f2bcf34fbf"><span class="section-number-4">3.3.13.</span> Fuzzel</h4> <h4 id="h:069cabf3-df14-49ba-8d17-75f2bcf34fbf"><span class="section-number-4">3.3.14.</span> Fuzzel</h4>
<div class="outline-text-4" id="text-h:069cabf3-df14-49ba-8d17-75f2bcf34fbf"> <div class="outline-text-4" id="text-h:069cabf3-df14-49ba-8d17-75f2bcf34fbf">
<p> <p>
Here I only need to set basic layout options - the rest is being managed by stylix. Here I only need to set basic layout options - the rest is being managed by stylix.
@ -7131,7 +7169,7 @@ programs.fuzzel = {
</div> </div>
</div> </div>
<div id="outline-container-h:55212502-c8f6-43af-ae99-55c8377ef34e" class="outline-4"> <div id="outline-container-h:55212502-c8f6-43af-ae99-55c8377ef34e" class="outline-4">
<h4 id="h:55212502-c8f6-43af-ae99-55c8377ef34e"><span class="section-number-4">3.3.14.</span> Starship</h4> <h4 id="h:55212502-c8f6-43af-ae99-55c8377ef34e"><span class="section-number-4">3.3.15.</span> Starship</h4>
<div class="outline-text-4" id="text-h:55212502-c8f6-43af-ae99-55c8377ef34e"> <div class="outline-text-4" id="text-h:55212502-c8f6-43af-ae99-55c8377ef34e">
<p> <p>
Starship makes my <code>zsh</code> look cooler! I have symbols for most programming languages and toolchains, also I build my own powerline. Starship makes my <code>zsh</code> look cooler! I have symbols for most programming languages and toolchains, also I build my own powerline.
@ -7248,7 +7286,7 @@ programs.starship = {
</div> </div>
</div> </div>
<div id="outline-container-h:5f1287db-d2e8-49aa-8c58-730129c7795c" class="outline-4"> <div id="outline-container-h:5f1287db-d2e8-49aa-8c58-730129c7795c" class="outline-4">
<h4 id="h:5f1287db-d2e8-49aa-8c58-730129c7795c"><span class="section-number-4">3.3.15.</span> Kitty</h4> <h4 id="h:5f1287db-d2e8-49aa-8c58-730129c7795c"><span class="section-number-4">3.3.16.</span> Kitty</h4>
<div class="outline-text-4" id="text-h:5f1287db-d2e8-49aa-8c58-730129c7795c"> <div class="outline-text-4" id="text-h:5f1287db-d2e8-49aa-8c58-730129c7795c">
<p> <p>
Kitty is the terminal emulator of choice for me, it is nice to configure using nix, fast, and has a nice style. 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 = {
</div> </div>
</div> </div>
<div id="outline-container-h:91dd4cc4-aada-4e74-be23-0cc69ed85af5" class="outline-4"> <div id="outline-container-h:91dd4cc4-aada-4e74-be23-0cc69ed85af5" class="outline-4">
<h4 id="h:91dd4cc4-aada-4e74-be23-0cc69ed85af5"><span class="section-number-4">3.3.16.</span> zsh</h4> <h4 id="h:91dd4cc4-aada-4e74-be23-0cc69ed85af5"><span class="section-number-4">3.3.17.</span> zsh</h4>
<div class="outline-text-4" id="text-h:91dd4cc4-aada-4e74-be23-0cc69ed85af5"> <div class="outline-text-4" id="text-h:91dd4cc4-aada-4e74-be23-0cc69ed85af5">
<p> <p>
zsh is the most convenient shell for me and it happens to be super neat to configure within home manager. 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 = {
</div> </div>
</div> </div>
<div id="outline-container-h:506d01fc-c20b-473a-ac78-bce4b53fe0e3" class="outline-4"> <div id="outline-container-h:506d01fc-c20b-473a-ac78-bce4b53fe0e3" class="outline-4">
<h4 id="h:506d01fc-c20b-473a-ac78-bce4b53fe0e3"><span class="section-number-4">3.3.17.</span> Mail</h4> <h4 id="h:506d01fc-c20b-473a-ac78-bce4b53fe0e3"><span class="section-number-4">3.3.18.</span> Mail</h4>
<div class="outline-text-4" id="text-h:506d01fc-c20b-473a-ac78-bce4b53fe0e3"> <div class="outline-text-4" id="text-h:506d01fc-c20b-473a-ac78-bce4b53fe0e3">
<p> <p>
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. 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 = {
</div> </div>
</div> </div>
<div id="outline-container-h:c05d1b64-7110-4151-b436-46bc447113b4" class="outline-4"> <div id="outline-container-h:c05d1b64-7110-4151-b436-46bc447113b4" class="outline-4">
<h4 id="h:c05d1b64-7110-4151-b436-46bc447113b4"><span class="section-number-4">3.3.18.</span> Home-manager: Emacs</h4> <h4 id="h:c05d1b64-7110-4151-b436-46bc447113b4"><span class="section-number-4">3.3.19.</span> Home-manager: Emacs</h4>
<div class="outline-text-4" id="text-h:c05d1b64-7110-4151-b436-46bc447113b4"> <div class="outline-text-4" id="text-h:c05d1b64-7110-4151-b436-46bc447113b4">
<p> <p>
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 <code>init.el</code> file to the configuration which will then be parsed upon system rebuild, looking for <code>use-package</code> 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 (<code>emacs-pgtk</code>). All of the nice options such as <code>tree-sitter</code> support are enabled by default, so I do not need to adjust the build process. 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 <code>init.el</code> file to the configuration which will then be parsed upon system rebuild, looking for <code>use-package</code> 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 (<code>emacs-pgtk</code>). All of the nice options such as <code>tree-sitter</code> support are enabled by default, so I do not need to adjust the build process.
@ -7545,7 +7583,7 @@ programs.emacs = {
</div> </div>
</div> </div>
<div id="outline-container-h:0bf51f63-01c0-4053-a591-7f0c5697c690" class="outline-4"> <div id="outline-container-h:0bf51f63-01c0-4053-a591-7f0c5697c690" class="outline-4">
<h4 id="h:0bf51f63-01c0-4053-a591-7f0c5697c690"><span class="section-number-4">3.3.19.</span> Waybar</h4> <h4 id="h:0bf51f63-01c0-4053-a591-7f0c5697c690"><span class="section-number-4">3.3.20.</span> Waybar</h4>
<div class="outline-text-4" id="text-h:0bf51f63-01c0-4053-a591-7f0c5697c690"> <div class="outline-text-4" id="text-h:0bf51f63-01c0-4053-a591-7f0c5697c690">
<p> <p>
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) 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 = {
</div> </div>
</div> </div>
<div id="outline-container-h:fbec0bd4-690b-4f79-8b2b-a40263760a96" class="outline-4"> <div id="outline-container-h:fbec0bd4-690b-4f79-8b2b-a40263760a96" class="outline-4">
<h4 id="h:fbec0bd4-690b-4f79-8b2b-a40263760a96"><span class="section-number-4">3.3.20.</span> Firefox</h4> <h4 id="h:fbec0bd4-690b-4f79-8b2b-a40263760a96"><span class="section-number-4">3.3.21.</span> Firefox</h4>
<div class="outline-text-4" id="text-h:fbec0bd4-690b-4f79-8b2b-a40263760a96"> <div class="outline-text-4" id="text-h:fbec0bd4-690b-4f79-8b2b-a40263760a96">
<p> <p>
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 <code>tridactyl</code> and <code>browserpass</code>. 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 <code>tridactyl</code> and <code>browserpass</code>.
@ -7877,7 +7915,7 @@ programs.firefox = {
</div> </div>
</div> </div>
<div id="outline-container-h:387c3a82-1fb1-4c0f-8051-874e2acb8804" class="outline-4"> <div id="outline-container-h:387c3a82-1fb1-4c0f-8051-874e2acb8804" class="outline-4">
<h4 id="h:387c3a82-1fb1-4c0f-8051-874e2acb8804"><span class="section-number-4">3.3.21.</span> Services</h4> <h4 id="h:387c3a82-1fb1-4c0f-8051-874e2acb8804"><span class="section-number-4">3.3.22.</span> Services</h4>
<div class="outline-text-4" id="text-h:387c3a82-1fb1-4c0f-8051-874e2acb8804"> <div class="outline-text-4" id="text-h:387c3a82-1fb1-4c0f-8051-874e2acb8804">
<p> <p>
Services that can be defined through home-manager should be defined here. Services that can be defined through home-manager should be defined here.
@ -8016,7 +8054,7 @@ group-by=category
</ol> </ol>
</div> </div>
<div id="outline-container-h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20" class="outline-4"> <div id="outline-container-h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20" class="outline-4">
<h4 id="h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20"><span class="section-number-4">3.3.22.</span> Sway</h4> <h4 id="h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20"><span class="section-number-4">3.3.23.</span> Sway</h4>
<div class="outline-text-4" id="text-h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20"> <div class="outline-text-4" id="text-h:02df9dfc-d1af-4a37-a7a0-d8da0af96a20">
<p> <p>
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. 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"; 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@{ outputs = inputs@{
@ -8420,6 +8464,7 @@ This tangles the flake.nix file; This block only needs to be touched when updati
nixos-hardware, nixos-hardware,
nix-alien, nix-alien,
nswitch-rcm-nix, nswitch-rcm-nix,
nix-index-database,
... ...
}: let }: 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 # Home-Manager modules wanted on both NixOS and non-NixOS systems
mixedModules = [ sops-nix.homeManagerModules.sops mixedModules = [ sops-nix.homeManagerModules.sops
nix-index-database.hmModules.nix-index
./profiles/common/home.nix ./profiles/common/home.nix
]; ];
@ -9341,7 +9387,7 @@ The standard Emacs behaviour for the Python process shell is a bit annoying. Thi
</div> </div>
</div> </div>
</li> </li>
<li><a id="orgbb564b1"></a>Nix common prefix bracketer<br /> <li><a id="org3fc11ee"></a>Nix common prefix bracketer<br />
<div class="outline-text-5" id="text-4-2-1-15"> <div class="outline-text-5" id="text-4-2-1-15">
<p> <p>
This function searches for common delimiters in region and removes them, summarizing all captured lines by it. 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
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Leon Schwarzäugl</p> <p class="author">Author: Leon Schwarzäugl</p>
<p class="date">Created: 2024-07-19 Fr 00:52</p> <p class="date">Created: 2024-07-19 Fr 14:29</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View file

@ -546,11 +546,26 @@
yt-dlp.enable = true; yt-dlp.enable = true;
mpv.enable = true; mpv.enable = true;
jq.enable = true; jq.enable = true;
nix-index.enable = true;
ripgrep.enable = true; ripgrep.enable = true;
pandoc.enable = true; pandoc.enable = true;
fzf.enable = true; fzf.enable = true;
zoxide.enable = true; zoxide.enable = true;
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];
};
};
}; };
programs.password-store = { programs.password-store = {

View file

@ -0,0 +1,33 @@
# Adapted from https://github.com/bennofs/nix-index/blob/master/command-not-found.sh
command_not_found_handle () {
if [ -n "${MC_SID-}" ] || ! [ -t 1 ]; then
>&2 echo "$1: command not found"
return 127
fi
echo -n "searching nix-index..."
ATTRS=$(@nix-locate@ --minimal --no-group --type x --type s --top-level --whole-name --at-root "/bin/$1")
case `echo -n "$ATTRS" | grep -c "^"` in
0)
>&2 echo -ne "$(@tput@ el1)\r"
>&2 echo "$1: command not found"
;;
*)
>&2 echo -ne "$(@tput@ el1)\r"
>&2 echo "The program $(@tput@ setaf 4)$1$(@tput@ sgr0) is currently not installed."
>&2 echo "It is provided by the following derivation(s):"
while read ATTR; do
ATTR=$(echo "$ATTR" | sed 's|\.out$||') # Strip trailing '.out'
>&2 echo " $(@tput@ setaf 12)nixpkgs#$(@tput@ setaf 4)$ATTR$(@tput@ sgr0)"
done <<< "$ATTRS"
esac
return 127
}
command_not_found_handler () {
command_not_found_handle $@
return $?
}