diff --git a/src/consts.ts b/src/consts.ts index bb385751..99154ac7 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -79,6 +79,7 @@ export const SIDEBAR: Sidebar = { }, { text: "umcli", link: "en/usage/umcli" }, { text: "eduroam", link: "en/usage/eduroam" }, + { text: "nix", link: "en/usage/nix" }, ], "Linux Concepts": [ { text: "What is Linux?", link: "en/linux/overview" }, diff --git a/src/content/docs/en/linux/overview.mdx b/src/content/docs/en/linux/overview.mdx index b48f0b2b..1af784b3 100644 --- a/src/content/docs/en/linux/overview.mdx +++ b/src/content/docs/en/linux/overview.mdx @@ -59,4 +59,4 @@ Ultramarine is built on Fedora, the base for Red Hat's Enterprise Linux. This me #### [Next Up: The Filesystem →](/en/linux/filesystem) -#### [← Back To: eduroam](/en/usage/eduroam/) +#### [← Back To: Nix](/en/usage/nix) diff --git a/src/content/docs/en/usage/eduroam.mdx b/src/content/docs/en/usage/eduroam.mdx index 9ce6e972..ec016136 100644 --- a/src/content/docs/en/usage/eduroam.mdx +++ b/src/content/docs/en/usage/eduroam.mdx @@ -33,6 +33,6 @@ You're done! Just visit any eduroam hotspot and you'll be automatically connecte If you need further support, we recommend contacting your institution's helpdesk, or hopping into one of [our chats](/en/community/community/). -#### [Next Up: Linux Concepts: What is Linux? →](/en/linux/overview) +#### [Next Up: Nix →](/en/usage/nix) #### [← Back To: umcli](/en/usage/umcli) diff --git a/src/content/docs/en/usage/nix.mdx b/src/content/docs/en/usage/nix.mdx new file mode 100644 index 00000000..f7bc5279 --- /dev/null +++ b/src/content/docs/en/usage/nix.mdx @@ -0,0 +1,98 @@ +--- +title: Nix +description: "Getting Started with Nix on Ultramarine Linux" +--- + +Nix is a package manager aiming to provide reproducable development +environments and builds by removing _dependency hell_. For us, this means +no longer having to install `-devel` packages we only use occasionally, +ephemeral shells that we can create for temporarily checking out utilities, +quickly assimilating into codebases with a `flake.nix` file, and more! + +The world of Nix is vast and difficult to navigate, so let's see Nix in action +with real-world examples + +# Installing Nix + +Ultramarine Linux provides a nice little tweak for quickly installing Nix. + +```bash +$ um tweaks enable nix +``` + +# Real-world example 1: Ephemeral shell + +Let's say you wanna try a cute new package, like something that prints out a +cute little character saying a string, but you don't really feel like +insatlling yet another system package + +```bash +$ nix run nixpkgs#ponysay "hey nixos is pretty cool" +``` + +# Real-world example 2: Schmoyalties + +FFmpeg hides some great functionality behind a compile-time `--enable-nonfree` +flag that makes the resulting binary not something a repository can legally +distribute, requiring the end user to compile it with their desired settings +instead. If only there was a way to manage that elegantly (i.e not under +`make` and `make install` that overwrites the system FFmpeg). + +`nix flake init` in a folder, then paste this into `flake.nix` (overriding +the default): + +```nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ + (self: super: {ffmpeg = super.ffmpeg.override { + ## We define the build options here + withUnfree = true; + withDav1d = true; + withFdkAac = true; + };}) + }; + in + with pkgs; + { + devShells.default = mkShell { + buildInputs = [ + ffmpeg + ]; + }; + } + ); +} +``` + +Then `nix develop`, wait, and bam! FFmpeg with all the nitty-gritty unfree +codecs~ + +# Real-world example 3: Working with a Nix project + +TBD + +# End + +With this piece, I hope you can see the value of the Nix package manager +within Ultramarine Linux. Whether you're a poweruser or a developer, you'll +find great power within Nix. + + +And hey, if you're still not sold on it, the tweak is a toggleable, and we've +made sure to make it a clean uninstall so you'll be back to a "clean" machine +if you're still not convinced (or if you run out of storage, Nix can get a +little unwieldy). + +#### [Next Up: Linux Concepts: What is Linux? →](/en/linux/overview) + +#### [← Back To: eduroam](/en/usage/eduroam/) diff --git a/src/content/docs/en/usage/umcli.mdx b/src/content/docs/en/usage/umcli.mdx index 60a74306..3772f14a 100644 --- a/src/content/docs/en/usage/umcli.mdx +++ b/src/content/docs/en/usage/umcli.mdx @@ -39,10 +39,10 @@ List of umcli Tweaks: | openssl-legacy-negotiation | Toggleable | Use unsafe legacy negotiation for OpenSSL | Should only be used if absolutely necessary | | sudo-pwfeedback | Toggleable | Add `*` feedback when entering in password during a sudo prompt | | | cachyos-kernel | Toggleable | Install the [CachyOS kernel](https://wiki.cachyos.org/features/kernel/) via the COPR, and enable as default kernel entry | If you are using Secure Boot, you will need to set up `sbctl` according to the CachyOS specification. More info can be found when enabling the tweak | +| nix | Toggleable | Install/Uninstall the Nix package manager | | ## Planned Features -- umcli wrapper around the Nix language installer. Also pre-configure nix to instantly be able to have an easy to use experience. - `umcli upgrade`, potentially a wrapper around the `topgrade` package. Would update everything on the system (system packages, flatpaks, firmware, etc.). - `um get PACKAGE`. A way to easily install packages that are not in a common package repository, but do distribute their own RPMs, or their own repositories. Based on [deb-get](https://github.com/wimpysworld/deb-get) - And more!