Extend NixOS: Difference between revisions
m Fixed casing |
→Quick Implementation: Use current channel for search.nixos.org link Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 5: | Line 5: | ||
We want to start up an IRC client whenever a user logs into/starts their session. | We want to start up an IRC client whenever a user logs into/starts their session. | ||
It is possible to find a variety of different ways to do this, but a simple modern approach that fits well within NixOS's | It is possible to find a variety of different ways to do this, but a simple modern approach that fits well within NixOS's [[Declarative model]] is to declare a {{ic|systemd}} unit which initializes the IRC client upon session login by a user. | ||
Assume that our IRC client is {{ic|irssi}} as the IRC client. We'll run it inside a [https://wiki.archlinux.org/title/GNU_Screen screen] daemon, which apart from allowing us to [https://en.wikipedia.org/wiki/Terminal_multiplexer multiplex] our terminal sessions, also enables the IRC session to continue even after we log out of our shell session. | Assume that our IRC client is {{ic|irssi}} as the IRC client. We'll run it inside a [https://wiki.archlinux.org/title/GNU_Screen screen] daemon, which apart from allowing us to [https://en.wikipedia.org/wiki/Terminal_multiplexer multiplex] our terminal sessions, also enables the IRC session to continue even after we log out of our shell session. | ||
| Line 18: | Line 18: | ||
* [https://www.freedesktop.org/software/systemd/man/latest/systemd.html# systemd man pages] | * [https://www.freedesktop.org/software/systemd/man/latest/systemd.html# systemd man pages] | ||
* NixOS [[ modules ]] | * NixOS [[ modules ]] | ||
* use [[ NixOS Search ]] and [https://nixos.org/nixos/manual/options.html NixOS Manual: List of Options] to look up more information about specific module options that we use | * use [[NixOS search|NixOS Search]] and [https://nixos.org/nixos/manual/options.html NixOS Manual: List of Options] to look up more information about specific module options that we use | ||
= Implementations = | = Implementations = | ||
| Line 24: | Line 24: | ||
== Quick Implementation == | == Quick Implementation == | ||
NixOS provides [https://search.nixos.org/options? | NixOS provides [https://search.nixos.org/options?show=systemd a systemd module] with a wide variety of configuration options. A small number of those (which you can check out on [[ NixOS search ]]) allows us to implement this little snippet within our {{ic|configuration.nix}}: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||