Extend NixOS: Difference between revisions
imported>Bzm3r m Various small fixes to my initial edit. |
→Quick Implementation: Use current channel for search.nixos.org link Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
| (3 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 13: | Line 13: | ||
= Some helpful links = | = Some helpful links = | ||
This article assumes some familiarity with [[systemd]], and [[ | This article assumes some familiarity with [[systemd]], and [[NixOS options]]. The following links will be helpful for providing this background: | ||
* General overviews of {{ic|systemd}}: [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/chap-managing_services_with_systemd from RedHat], [https://wiki.archlinux.org/title/Systemd the Arch Linux Wiki], [https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units tutorial from Digital Ocean] | * General overviews of {{ic|systemd}}: [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/chap-managing_services_with_systemd from RedHat], [https://wiki.archlinux.org/title/Systemd the Arch Linux Wiki], [https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units tutorial from Digital Ocean] | ||
* [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"> | ||