-
-
Notifications
You must be signed in to change notification settings - Fork 16
usage: add Nix guide #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
usage: add Nix guide #136
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -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, | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you may wanna mention this is for advanced users |
||||||
| 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 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| # Installing Nix | ||||||
|
|
||||||
| Ultramarine Linux provides a nice little tweak for quickly installing Nix. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```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 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```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. | ||||||
|
|
||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i have some comments on this section generally |
||||||
|
|
||||||
| 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/) | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | | | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Link to nix page in here? |
||
|
|
||
| ## 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! | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is nix capitalized in branding? if yes please