Skip to content

Commit 6684949

Browse files
committed
add wiki page for nix
1 parent 5255ae4 commit 6684949

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

docs/wiki/Home.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ Welcome to the onefetch's wiki!
44
- **General**
55
- [Installation](https://github.com/o2sh/onefetch/wiki/installation)
66
- [Getting started](https://github.com/o2sh/onefetch/wiki/getting-started)
7+
- [Nix local setup](https://github.com/o2sh/onefetch/wiki/nix-local-setup)
78
- **Options**
89
- [Command-line options](https://github.com/o2sh/onefetch/wiki/command-line-options)
910
- **Images**
10-
- [Images in the terminal](https://github.com/o2sh/onefetch/wiki/Images-in-the-terminal)
11+
- [Images in the terminal](https://github.com/o2sh/onefetch/wiki/images-in-the-terminal)
1112
- **Ascii**
1213
- [Ascii art](https://github.com/o2sh/onefetch/wiki/ascii-art)

docs/wiki/_Sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- **General**
33
- [Installation](https://github.com/o2sh/onefetch/wiki/installation)
44
- [Getting started](https://github.com/o2sh/onefetch/wiki/getting-started)
5+
- [Nix local setup](https://github.com/o2sh/onefetch/wiki/nix-local-setup)
56
- **Options**
67
- [Command-line options](https://github.com/o2sh/onefetch/wiki/command-line-options)
78
- **Images**

docs/wiki/nix-local-setup.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Nix as a Development Environment
2+
3+
[Nix](https://nixos.org/) is a package manager that uses a purely functional approach to dependency management. Packages in Nix are built and run in isolated, reproducible environments. This tutorial walks you through setting up a development environment for [Onefetch](https://github.com/o2sh/onefetch) using Nix.
4+
5+
> This guide assumes you already have Nix [installed](https://nixos.org/download.html#nix-quick-install) on your system.
6+
7+
## Setup
8+
9+
To begin, create a `flake.nix` file with the following content:
10+
11+
```nix
12+
{
13+
description = "onefetch";
14+
15+
inputs = {
16+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
17+
};
18+
19+
outputs = {
20+
self,
21+
nixpkgs,
22+
...
23+
}: let
24+
forAllSystems = fn: nixpkgs.lib.genAttrs [
25+
"aarch64-darwin"
26+
"aarch64-linux"
27+
"i686-linux"
28+
"x86_64-linux"
29+
"x86_64-darwin"
30+
] (system: fn nixpkgs.legacyPackages.${system});
31+
in {
32+
devShells = forAllSystems (pkgs: {
33+
default = pkgs.mkShell {
34+
name = "onefetch";
35+
packages = with pkgs; [
36+
cargo
37+
rustc
38+
clippy
39+
rustfmt
40+
rust-analyzer
41+
cmake
42+
];
43+
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
44+
};
45+
});
46+
};
47+
}
48+
```
49+
50+
then enter the development shell:
51+
52+
```bash
53+
nix develop
54+
```

0 commit comments

Comments
 (0)