2025-07-31 22:25:48 +02:00
|
|
|
---
|
|
|
|
author: Birk
|
|
|
|
---
|
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
# Nix(OS)
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
a introduction
|
2025-07-31 22:25:48 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
## What is Nix?
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
* a domain specific language
|
|
|
|
* a package manager
|
|
|
|
* a Linux distribution
|
2025-07-31 22:25:48 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
```mermaid
|
|
|
|
%%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true }}}%%
|
|
|
|
flowchart LR
|
|
|
|
A(Nix language)
|
|
|
|
B(Nix package manager)
|
|
|
|
C(NixOS)
|
|
|
|
D(macOS)
|
|
|
|
E(Debian)
|
|
|
|
F(Software/User config)
|
|
|
|
G(Git)
|
|
|
|
H(File)
|
|
|
|
A-->B--->C & D & E---->F --> G & H
|
2025-07-31 22:25:48 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2025-08-10 21:37:01 +02:00
|
|
|
## Demo
|
|
|
|
|
|
|
|
```mermaid
|
|
|
|
%%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true }}}%%
|
|
|
|
flowchart TD
|
|
|
|
B(<b>Disk & OS Installation)
|
|
|
|
C(<b>Desktop)
|
|
|
|
D(Nextcloud server)
|
|
|
|
E(nspawn container)
|
|
|
|
F(Gitlab server)
|
|
|
|
G(Podman container)
|
|
|
|
H(Forgejo)
|
|
|
|
I(MicroVM)
|
|
|
|
J(Kubernetes)
|
|
|
|
K(Splunk)
|
|
|
|
B--> D & E & G & I
|
|
|
|
B-->C
|
|
|
|
E-->F
|
|
|
|
G-->H
|
|
|
|
I-->J-->K
|
|
|
|
```
|
|
|
|
|
2025-08-10 23:50:11 +02:00
|
|
|
```nix
|
|
|
|
beancloud.software.desktop = true;
|
|
|
|
```
|
|
|
|
|
2025-08-10 21:37:01 +02:00
|
|
|
---
|
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
## History
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-10 21:37:01 +02:00
|
|
|
- 2003: [a declarative programming language](https://www.youtube.com/watch?v=fsgYVi2PQr0)
|
2025-08-09 02:16:31 +02:00
|
|
|
- 2008: first stable NixOS version
|
|
|
|
- 2014: 10.000 packages
|
|
|
|
- 2019: Flakes
|
|
|
|
- 2025: [120.000 packages](https://repology.org/repositories/graphs)
|
2025-07-31 22:25:48 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
## Features
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
- [declarative configuration](https://search.nixos.org/options?) (20.000 options)
|
|
|
|
- [package](https://search.nixos.org/packages) count (120.000 + third party)
|
2025-08-10 23:50:11 +02:00
|
|
|
- versioned config in Git and on the installed NixOS
|
|
|
|
- development community on Github and others
|
2025-07-31 22:25:48 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
## Infrastructure
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
- [nixpkgs](https://github.com/NixOS/nixpkgs) on Github
|
|
|
|
- [nix language](https://github.com/NixOS/nix) on Github
|
|
|
|
- [Binary cache](https://cache.nixos.org/) for built packages
|
|
|
|
- [CI server](https://hydra.nixos.org/)
|
|
|
|
- [Build status](https://status.nixos.org/) page
|
2025-08-10 21:37:01 +02:00
|
|
|
- ...
|
2025-07-31 22:25:48 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
## Nextcloud
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
```mermaid
|
|
|
|
%%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true }}}%%
|
|
|
|
flowchart TD
|
2025-08-10 23:59:46 +02:00
|
|
|
A(<b>Disk & OS Installation)
|
2025-08-10 23:50:11 +02:00
|
|
|
B(<b>Nextcloud server)
|
|
|
|
C(MariaDB)
|
|
|
|
D(nginx)
|
|
|
|
E(php-fm)
|
|
|
|
F(Redis)
|
|
|
|
A--> C & D & E & F --> B
|
|
|
|
```
|
|
|
|
|
|
|
|
```nix
|
|
|
|
beancloud.software.nextcloud.server.enable = true;
|
2025-07-31 22:25:48 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
## Gitlab
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
```mermaid
|
|
|
|
%%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true }}}%%
|
2025-08-10 23:50:11 +02:00
|
|
|
flowchart LR
|
|
|
|
A(<b>Disk & OS Installation)
|
|
|
|
B(nspawn container)
|
|
|
|
C(NixOS)
|
|
|
|
D(<b>Gitlab server)
|
|
|
|
E[Postgres]
|
|
|
|
F[nginx]
|
|
|
|
A --> B --> C --> E & F --> D
|
|
|
|
```
|
|
|
|
|
|
|
|
```nix
|
|
|
|
beancloud.software.gitlab = true;
|
2025-08-09 02:16:31 +02:00
|
|
|
```
|
2025-07-31 22:25:48 +02:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
## Forgejo
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
```mermaid
|
|
|
|
%%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true }}}%%
|
|
|
|
flowchart LR
|
2025-08-10 23:50:11 +02:00
|
|
|
A(<b>Disk & OS Installation)
|
|
|
|
B(Podman container)
|
|
|
|
C(<b>Forgejo)
|
|
|
|
D[virtualisation.oci-containers.containers.forgejo-frontend.image=codeberg.org/forgejo/forgejo:11.0.3-rootless]
|
|
|
|
E[forgejo-backend.image=docker.io/library/mariadb:11.8.2]
|
|
|
|
A --> B --> D & E --> C
|
|
|
|
```
|
|
|
|
|
|
|
|
```nix
|
|
|
|
beancloud.software.forgejo = true;
|
2025-08-09 02:16:31 +02:00
|
|
|
```
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
---
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
## Splunk
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-09 02:16:31 +02:00
|
|
|
```mermaid
|
|
|
|
%%{init: {'theme': 'dark', 'themeVariables': { 'darkMode': true }}}%%
|
|
|
|
flowchart LR
|
|
|
|
subgraph pc-demo1
|
|
|
|
direction LR
|
2025-08-10 23:59:46 +02:00
|
|
|
A(<b>Disk & OS Installation)
|
|
|
|
subgraph MicroVM
|
2025-08-09 02:16:31 +02:00
|
|
|
direction LR
|
2025-08-10 23:59:46 +02:00
|
|
|
B(NixOS)
|
|
|
|
C(Kubernetes)
|
|
|
|
subgraph Container
|
2025-08-09 02:16:31 +02:00
|
|
|
direction LR
|
2025-08-10 23:59:46 +02:00
|
|
|
D(<b>Splunk)
|
2025-08-09 02:16:31 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2025-08-10 23:59:46 +02:00
|
|
|
A--> B --> C --> D
|
2025-08-09 02:16:31 +02:00
|
|
|
```
|
2025-07-31 22:25:48 +02:00
|
|
|
|
2025-08-10 23:50:11 +02:00
|
|
|
```nix
|
|
|
|
beancloud.software.splunk = true;
|
|
|
|
```
|
|
|
|
|
2025-08-10 21:37:01 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
## Unexpected stuff
|
|
|
|
|
|
|
|
- Flakes are not stable yet, but everybody uses them
|
|
|
|
- Documentation quality has room for improvement
|
|
|
|
- Additional efforts for secrets management
|
|
|
|
- Does not follow Linux Filesystem Hierarchy Standard
|
|
|
|
- Commercial software usage can be tricky or impossible
|
2025-07-31 22:25:48 +02:00
|
|
|
|
|
|
|
|