mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-02-12 06:19:06 +00:00
![Gabriel Arazas](/assets/img/avatar_default.png)
This update is too large, I made too many notes on stuff. Nonetheless, it is very nice to see progress. I've made note revisions on the following topics: - Learning - Writing - Various Linux-related stuff I've yet to start learning illustration but I'll be starting tomorrow for an update how do I keep in mind with those writings. There are still a lot of things to be processed from the backlog with yet more notes on learning but I keep having those perspectives whenever I practice so ehhh... Better have those than nothing? Furthermore, I've also updated the timestamp format. It is pretty simple to update all of the notes with a couple of `sed` calls. Aaaand, I've also changed the way how the assets stored with the folders only leaving it up for the generated files instead of enforcing it on every note. I create more visual aids and managing them is a pain for each note. This restructuring frees me of that burden.
4.2 KiB
4.2 KiB
Nix flakes
As of 2021-06-30, the version used for this note is at v2.3 so it needs to be invoked with the unstable version.
- similar to Guix channels
- a collection of packages and functions while making it easy to configure Nix declaratively
- replaces the traditional Nix channels since fully reproducing an environment with Nix requires special care in practice; plus, there's no standard way of composing projects with Nix
- as of 2021-06-30, this is on the unstable version of the Nix package manager and needs some additional configuration
why flakes?
- provides a structure for discoverability
- makes 100% reproducibility a little easier with Nix
- in case you're using NixOS, it also provides an easier way to extend it with third-party custom modules
Here's an example to interact with a flake. It will show the entire outputs of a flake as well as the normalized version of the flake object.
#! nix-shell -i bash -p nixUnstable
nix --experimental-features 'nix-command flakes' flake show <<flake-sample-object()>> | sed -e "s/\x1b\[.\{1,5\}m//g"
github:edolstra/dwarffs/f691e2c991e75edb22836f1dbe632c40324215c5 ├───checks │ ├───aarch64-linux │ │ ├───build: derivation 'dwarffs-0.1.20210121.f691e2c' │ │ └───test: derivation 'vm-test-run-unnamed' │ ├───i686-linux │ │ ├───build: derivation 'dwarffs-0.1.20210121.f691e2c' │ │ └───test: derivation 'vm-test-run-unnamed' │ └───x86_64-linux │ ├───build: derivation 'dwarffs-0.1.20210121.f691e2c' │ └───test: derivation 'vm-test-run-unnamed' ├───defaultPackage │ ├───aarch64-linux: package 'dwarffs-0.1.20210121.f691e2c' │ ├───i686-linux: package 'dwarffs-0.1.20210121.f691e2c' │ └───x86_64-linux: package 'dwarffs-0.1.20210121.f691e2c' ├───nixosModules │ └───dwarffs: NixOS module └───overlay: Nixpkgs overlay
Let's build from one of the outputs of call_flake-sample-object().
#! nix-shell -i bash -p nixUnstable
nix --experimental-features 'nix-command flakes' build 'github:edolstra/dwarffs#checks.aarch64-linux.build'
nix --experimental-features 'nix-command flakes' shell 'github:edolstra/dwarffs' --command dwarffs --version
fusermount version: 2.9.9
For full reproducibility, you can refer to specific point of a flake (e.g., commit).
To easily get a pinned URL, you can run flake metadata
subcommand.
#! nix-shell -i bash -p nixUnstable
nix --experimental-features 'nix-command flakes' flake metadata 'github:edolstra/dwarffs' | sed -e "s/\x1b\[.\{1,5\}m//g"
Resolved URL: github:edolstra/dwarffs Locked URL: github:edolstra/dwarffs/f691e2c991e75edb22836f1dbe632c40324215c5 Description: A filesystem that fetches DWARF debug info from the Internet on demand Path: /nix/store/769s05vjydmc2lcf6b02az28wsa9ixh1-source Revision: f691e2c991e75edb22836f1dbe632c40324215c5 Last modified: 2021-01-21 22:41:26 Inputs: ├───nix: github:NixOS/nix/6254b1f5d298ff73127d7b0f0da48f142bdc753c │ ├───lowdown-src: github:kristapsdz/lowdown/1705b4a26fbf065d9574dce47a94e8c7c79e052f │ └───nixpkgs: github:NixOS/nixpkgs/ad0d20345219790533ebe06571f82ed6b034db31 └───nixpkgs follows input 'nix/nixpkgs'
#! nix-shell -i bash -p nixUnstable
nix --experimental-features 'nix-command flakes' shell github:edolstra/dwarffs/f691e2c991e75edb22836f1dbe632c40324215c5 --command dwarffs --version
fusermount version: 2.9.9