Compare commits

..

No commits in common. "4fad38afdbcfaa34cbfb9c224bc8a11f12def2a2" and "06ec1df09a1f313ce543380feeab3d8651e63a8f" have entirely different histories.

14 changed files with 285 additions and 353 deletions

244
.github/README.md vendored
View file

@ -1,33 +1,33 @@
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FSwarsel%2F.dotfiles%2Fbadge%3Fref%3Dmain&style=flat&labelColor=11111b)](https://actions-badge.atrox.dev/Swarsel/.dotfiles/goto?ref=main)
###### Disclaimer
###### Disclaimer
You probably do not want to use this setup verbatim. This is made to fit my specific use cases, and I do not guarantee best practises everywhere. Changes are made on a daily basis.
You probably do not want to use this setup verbatim. This is made to fit my specific use cases, and I do not guarantee best practises everywhere. Changes are made on a daily basis.
That being said, there is a lot of general configuration that you *probably* can use without changes; if you only want to use this repository as a starting point for your own configuration, you should be fine. See below for more information. Also, if you see something that can be done more efficiently or better in general, please let me know! :)
That being said, there is a lot of general configuration that you *probably* can use without changes; if you only want to use this repository as a starting point for your own configuration, you should be fine. See below for more information. Also, if you see something that can be done more efficiently or better in general, please let me know! :)
# \~SwarselSystems\~
# \~SwarselSystems\~
<p align="center">
<img width="49%" title="Tiling" alt="swarselsystems_preview1" src="https://github.com/user-attachments/assets/f6021ab9-6289-497d-8747-28f5d526b75a" />
<img width="49%" title="Waybar" alt="swarselsystems_preview2" src="https://github.com/user-attachments/assets/1160d9f7-710c-4046-8fcf-476bb4a0be84" />
</p>
<p align="center">
<img src="https://i.imgur.com/bmgLNcu.png" width="49%" title="Tiling">
<img src="https://i.imgur.com/0G7Be6e.png" width="49%" title="Waybar">
</p>
## Overview
## Overview
- [Literate configuration](https://swarsel.github.io/.dotfiles/) defining my entire infrastructure, including Emacs
- Configuration based on flakes for personal hosts as well as servers on:
- [Literate configuration](https://swarsel.github.io/.dotfiles/) defining my entire infrastructure, including Emacs
- Configuration based on flakes for personal hosts as well as servers on:
- [NixOS](https://github.com/NixOS/nixpkgs)
- [home-manager](https://github.com/nix-community/home-manager) only (no full NixOS) with support from [nixGL](https://github.com/nix-community/nixGL)
- [nix-darwin](https://github.com/LnL7/nix-darwin)
- [nix-on-droid](https://github.com/nix-community/nix-on-droid)
- Streamlined configuration and deployment pipeline:
- Streamlined configuration and deployment pipeline:
- Framework for [packages](https://github.com/Swarsel/.dotfiles/blob/main/pkgs/default.nix), [overlays](https://github.com/Swarsel/.dotfiles/blob/main/overlays/default.nix), [modules](https://github.com/Swarsel/.dotfiles/tree/main/modules), and [library functions](https://github.com/Swarsel/.dotfiles/tree/main/lib/default.nix)
- Dynamically generated host configurations
- Limited local installer (no secrets handling) with a supported demo build
- Fully autonomous remote deployment using [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) and [disko](https://github.com/nix-community/disko) (with secrets handling)
- Improved nix tooling
- Support for advanced features:
- Support for advanced features:
- Secrets handling using [sops-nix](https://github.com/Mic92/sops-nix) (pls no pwn ❤️)
- Management of personally identifiable information using [nix-plugins](https://github.com/shlevy/nix-plugins)
- Full Yubikey support
@ -37,140 +37,138 @@
- Configuration shared between configurations (configuration for one nixosConfiguration can be defined in another nixosConfiguration)
- Global attributes shared between all configurations to reduce attribute redeclaration
## Documentation
## Documentation
If you are mainly interested in how I configured this system, check out this page:
If you are mainly interested in how I configured this system, check out this page:
[SwarselSystems literate configuration](https://swarsel.github.io/.dotfiles/)
[SwarselSystems literate configuration](https://swarsel.github.io/.dotfiles/)
This file will take you through my design process, in varying amounts of detail.
This file will take you through my design process, in varying amounts of detail.
Otherwise, the files that are possibly of biggest interest are found here:
Otherwise, the files that are possibly of biggest interest are found here:
- [SwarselSystems.org](../SwarselSystems.org)
- [flake.nix](../flake.nix)
- [early-init.el](../files/emacs/early-init.el)
- [init.el](../files/emacs/init.el)
- [SwarselSystems.org](../SwarselSystems.org)
- [flake.nix](../flake.nix)
- [early-init.el](../files/emacs/early-init.el)
- [init.el](../files/emacs/init.el)
### Getting started
### Getting started
#### Demo configuration
#### Demo configuration
<details>
<details>
<summary>Click here for instructions on how to install the demo system</summary>
If you just want to see if this configuration is for you, run this command on any system that has `nix` installed:
If you just want to see if this configuration is for you, run this command on any system that has `nix` installed:
``` shell
nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles#swarsel-rebuild -- -u <YOUR_USERNAME>
```
``` shell
nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles#swarsel-rebuild -- -u <YOUR_USERNAME>
```
This will activate the `chaostheatre` configuration on your system, which is a de-facto mirror of my main configuration with secret-based settings removed.
Please keep in mind that this limited installer will make local changes to the cloned repository in order to be able to install it (otherwise the builder would fail at fetching my private secrets repository). As such, this should only be used to evaluate the system - if you want to use it longterm, you will need to create a fork and make some changes.
</details>
This will activate the `chaostheatre` configuration on your system, which is a de-facto mirror of my main configuration with secret-based settings removed.
Please keep in mind that this limited installer will make local changes to the cloned repository in order to be able to install it (otherwise the builder would fail at fetching my private secrets repository). As such, this should only be used to evaluate the system - if you want to use it longterm, you will need to create a fork and make some changes.
</details>
### Deployment
### Deployment
<details>
<details>
<summary>Click here for deployment instructions</summary>
The deployment process for this configuration is mostly automated, there are only a few steps that are needed to be done manually. You can choose between a remote deployment strategy that is also able to deploy new age keys for sops for you and a local installer that will only install the system without any secret handling.
The deployment process for this configuration is mostly automated, there are only a few steps that are needed to be done manually. You can choose between a remote deployment strategy that is also able to deploy new age keys for sops for you and a local installer that will only install the system without any secret handling.
#### Remote deployment (recommended if you have at least one running system)
#### Remote deployment (recommended if you have at least one running system)
0) Fork this repo, and write your own host config at `hosts/nixos/<YOUR_CONFIG_NAME>/default.nix` (you can use one of the other configurations as a template. Also see https://github.com/Swarsel/.dotfiles/tree/main/modules for a list of all additional options). At the very least, you should replace the `secrets/` directory with your own secrets and replace the SSH public keys with your own ones (otherwise I will come visit you!🔓❤️). I personally recommend to use the literate configuration and `org-babel-tangle-file` in Emacs, but you can also simply edit the separate `.nix` files.
1) Have a system with `nix` available booted (this does not need to be installed, i.e. you can use a NixOS installer image; a custom minimal installer ISO can be built by running `just iso` in the root of this repo)
2) Make sure that your Yubikey is plugged in or that you have your SSH key available (and configured)
3) Run `swarsel-bootstrap -n <CONFIGURATION_NAME> -d <TARGET_IP>` on your existing system.
0) Fork this repo, and write your own host config at `hosts/nixos/<YOUR_CONFIG_NAME>/default.nix` (you can use one of the other configurations as a template. Also see https://github.com/Swarsel/.dotfiles/tree/main/modules for a list of all additional options). At the very least, you should replace the `secrets/` directory with your own secrets and replace the SSH public keys with your own ones (otherwise I will come visit you!🔓❤️). I personally recommend to use the literate configuration and `org-babel-tangle-file` in Emacs, but you can also simply edit the separate `.nix` files.
1) Have a system with `nix` available booted (this does not need to be installed, i.e. you can use a NixOS installer image; a custom minimal installer ISO can be built by running `just iso` in the root of this repo)
2) Make sure that your Yubikey is plugged in or that you have your SSH key available (and configured)
3) Run `swarsel-bootstrap -n <CONFIGURATION_NAME> -d <TARGET_IP>` on your existing system.
- Alternatively (if you run this on a system that is not yet running this configuration), you can also run `nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles -- -n <CONFIGURATION_NAME> -d <TARGET_IP>` (this runs the same program as the command above).
4) Follow the installers instructions:
4) Follow the installers instructions:
- you will have to choose a disk encryption password (if you want that feature)
- you will have to confirm once that the target system has rebooted
- you will have to enter the root password once during the final system install
5) That should be it! The installer will take care of setting up disks, secrets, and the rest of the hardware configuration! You will still have to sign in manually to some webservices etc.
5) That should be it! The installer will take care of setting up disks, secrets, and the rest of the hardware configuration! You will still have to sign in manually to some webservices etc.
#### Local deployment (recommended for setting up the first system)
#### Local deployment (recommended for setting up the first system)
1) Boot the latest install ISO from this repository on an UEFI system.
2) Run `swarsel-install -n <CONFIGURATION_NAME>`
3) Reboot
1) Boot the latest install ISO from this repository on an UEFI system.
2) Run `swarsel-install -n <CONFIGURATION_NAME>`
3) Reboot
Alternatively, to install this from any NixOS live ISO, run `nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles#install -- -n <CONFIGURATION_NAME>` at step 2.
</details>
Alternatively, to install this from any NixOS live ISO, run `nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles#install -- -n <CONFIGURATION_NAME>` at step 2.
</details>
## Infrastructure
## Infrastructure
<details>
<details>
<summary>Click here for a summary of my infrastructure</summary>
<img width="2202" height="2947" alt="topology" src="https://github.com/user-attachments/assets/0eb37288-47a8-40e3-9211-648eee0ed408" />
### Programs
### Programs
| Topic | Program |
|---------------|---------------------------------|
|🐚 **Shell** | [zsh](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/zsh.nix) |
|🚪 **DM** | [greetd](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/common/login.nix) |
|🪟 **WM** | [SwayFX](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sway.nix) |
|⛩️ **Bar** | [Waybar](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/waybar.nix) |
|✒️ **Editor** | [Emacs](https://github.com/Swarsel/.dotfiles/tree/main/files/emacs/init.el) |
|🖥️ **Terminal**| [Kitty](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/kitty.nix) |
|🚀 **Launcher**| [Fuzzel](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/fuzzel.nix) |
|🚨 **Alerts** | [Mako](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/mako.nix) |
|🌐 **Browser** | [Firefox](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/zsh.nix) |
|🎨 **Theme** | [City-Lights (managed by stylix)](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sharedsetup.nix)|
| Topic | Program |
|---------------|---------------------------------|
|🐚 **Shell** | [zsh](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/zsh.nix) |
|🚪 **DM** | [greetd](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/common/login.nix) |
|🪟 **WM** | [SwayFX](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sway.nix) |
|⛩️ **Bar** | [Waybar](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/waybar.nix) |
|✒️ **Editor** | [Emacs](https://github.com/Swarsel/.dotfiles/tree/main/files/emacs/init.el) |
|🖥️ **Terminal**| [Kitty](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/kitty.nix) |
|🚀 **Launcher**| [Fuzzel](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/fuzzel.nix) |
|🚨 **Alerts** | [Mako](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/mako.nix) |
|🌐 **Browser** | [Firefox](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/zsh.nix) |
|🎨 **Theme** | [City-Lights (managed by stylix)](https://github.com/Swarsel/.dotfiles/tree/main/modules/home/common/sharedsetup.nix)|
### Services
### Services
| Topic | Program |
|-----------------------|---------------------------------------------------------------------------------------------------------------------|
|📖 **Books** | [Kavita](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/kavita.nix) |
|📼 **Videos** | [Jellyfin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/jellyfin.nix) |
|🎵 **Music** | [Navidrome](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/navidrome.nix) + [Spotifyd](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/spotifyd.nix) + [MPD](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/mpd.nix) |
|🗨️ **Messaging** | [Matrix](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/matrix.nix) |
|📁 **Filesharing** | [Nectcloud](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/nextcloud.nix) |
|🎞️ **Photos** | [Immich](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/immich.nix) |
|📄 **Documents** | [Paperless](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/paperless.nix) |
|🔄 **File Sync** | [Syncthing](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/syncthing.nix) |
|💾 **Backups** | [Restic](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/restic.nix) |
|👁️ **Monitoring** | [Grafana](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/monitoring.nix) |
|🍴 **RSS** | [FreshRss](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/freshrss.nix) |
|🌳 **Git** | [Forgejo](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/forgejo.nix) |
|⚓ **Anki Sync** | [Anki Sync Server](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/ankisync.nix) |
|🪪 **SSO** | [Kanidm](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/kanidm.nix) + [oauth2-proxy](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/oauth2-proxy.nix) |
|💸 **Finance** | [Firefly-III](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/firefly-iii.nix) |
|🃏 **Collections** | [Koillection](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/koillection.nix) |
|🗃️ **Shell History** | [Atuin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/atuin.nix) |
|📅 **CalDav/CardDav** | [Radicale](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/radicale.nix) |
|↔️ **P2P Filesharing** | [Croc](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/croc.nix) |
|✂️ **Paste Tool** | [Microbin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/microbin.nix) |
|📸 **Image Sharing** | [Slink](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/slink.nix) |
|🔗 **Link Shortener** | [Shlink](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/shlink.nix) |
| Topic | Program |
|-----------------------|---------------------------------------------------------------------------------------------------------------------|
|📖 **Books** | [Kavita](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/kavita.nix) |
|📼 **Videos** | [Jellyfin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/jellyfin.nix) |
|🎵 **Music** | [Navidrome](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/navidrome.nix) + [Spotifyd](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/spotifyd.nix) + [MPD](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/mpd.nix) |
|🗨️ **Messaging** | [Matrix](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/matrix.nix) |
|📁 **Filesharing** | [Nectcloud](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/nextcloud.nix) |
|🎞️ **Photos** | [Immich](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/immich.nix) |
|📄 **Documents** | [Paperless](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/paperless.nix) |
|🔄 **File Sync** | [Syncthing](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/syncthing.nix) |
|💾 **Backups** | [Restic](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/restic.nix) |
|👁️ **Monitoring** | [Grafana](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/monitoring.nix) |
|🍴 **RSS** | [FreshRss](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/freshrss.nix) |
|🌳 **Git** | [Forgejo](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/forgejo.nix) |
|⚓ **Anki Sync** | [Anki Sync Server](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/ankisync.nix) |
|🪪 **SSO** | [Kanidm](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/kanidm.nix) + [oauth2-proxy](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/oauth2-proxy.nix) |
|💸 **Finance** | [Firefly-III](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/firefly-iii.nix) |
|🃏 **Collections** | [Koillection](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/koillection.nix) |
|🗃️ **Shell History** | [Atuin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/atuin.nix) |
|📅 **CalDav/CardDav** | [Radicale](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/radicale.nix) |
|↔️ **P2P Filesharing** | [Croc](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/croc.nix) |
|✂️ **Paste Tool** | [Microbin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/microbin.nix) |
|📸 **Image Sharing** | [Slink](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/slink.nix) |
|🔗 **Link Shortener** | [Shlink](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/shlink.nix) |
### Hosts
### Hosts
| Name | Hardware | Use |
|--------------------|-----------------------------------------------------|------------------------------------------------------|
|💻 **pyramid** | Framework Laptop 16, AMD 7940HS, RX 7700S, 64GB RAM | Work laptop |
|💻 **bakery** | Lenovo Ideapad 720S-13IKB | Personal lapto |
|💻 **machpizza** | MacBook Pro 2016 | MacOS sandbox |
|🖥️ **winters** | ASRock J4105-ITX, 32GB RAM | Main homeserver and data storgae |
|🖥️ **milkywell** | Oracle Cloud: VM.Standard.E2.1.Micro | Server for lightweight synchronization tasks |
|🖥️ **moonside** | Oracle Cloud: VM.Standard.A1.Flex, 4 OCPUs, 24GB RAM| Proxy for local services, some lightweight services |
|📱 **magicant** | Samsung Galaxy Z Flip 6 | Phone |
|💿 **drugstore** | - | ISO installer configuration |
|❔ **chaotheatre** | - | Demo config for checking out my configurtion |
|❔ **toto** | - | Helper configuration for bootstrapping a new system |
|🏠 **treehouse** | - | Reference configuration for a home-manager only host |
</details>
| Name | Hardware | Use |
|--------------------|-----------------------------------------------------|------------------------------------------------------|
|💻 **pyramid** | Framework Laptop 16, AMD 7940HS, RX 7700S, 64GB RAM | Work laptop |
|💻 **bakery** | Lenovo Ideapad 720S-13IKB | Personal lapto |
|💻 **machpizza** | MacBook Pro 2016 | MacOS sandbox |
|🖥️ **winters** | ASRock J4105-ITX, 32GB RAM | Main homeserver and data storgae |
|🖥️ **milkywell** | Oracle Cloud: VM.Standard.E2.1.Micro | Server for lightweight synchronization tasks |
|🖥️ **moonside** | Oracle Cloud: VM.Standard.A1.Flex, 4 OCPUs, 24GB RAM| Proxy for local services, some lightweight services |
|📱 **magicant** | Samsung Galaxy Z Flip 6 | Phone |
|💿 **drugstore** | - | ISO installer configuration |
|❔ **chaotheatre** | - | Demo config for checking out my configurtion |
|❔ **toto** | - | Helper configuration for bootstrapping a new system |
|🏠 **treehouse** | - | Reference configuration for a home-manager only host |
</details>
## General Nix tips & useful links
## General Nix tips & useful links
<details>
<details>
<summary>Click here for a summary of nix tips & links</summary>
- Below is a small list of tips that should be helpful if you are new to the nix ecosystem:
- Below is a small list of tips that should be helpful if you are new to the nix ecosystem:
- Temporarily install any package using `nix shell nixpkgs#<PACKAGE_NAME>` - this can be e.g. useful if you accidentally removed home-manager from your packages on a non-NixOS machine. Alternatively, use [comma](https://github.com/nix-community/comma)
- More info on `nix [...]` commands: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix
@ -178,7 +176,7 @@
- getting packages at a different version than your target (or not packaged at all) can be done in most cases easily with fetchFromGithub (https://ryantm.github.io/nixpkgs/builders/fetchers/)
- you can easily install old revisions of packages using https://lazamar.co.uk/nix-versions/. You can conveniently spawn a shell with a chosen package available using `vershell <NIXPKGS_REVISION> <PACKAGE>`. Just make sure to pick a revision that has flakes enabled, otherwise you will need the legacy way of spawning the shell (see the link for more info)
- These links are your best friends:
- These links are your best friends:
- The nix documentation: https://nix.dev/
- The nixpkgs reference manual: https://nixos.org/manual/nixpkgs/unstable/#buildpythonapplication-function
- the [nixpkgs repository](https://github.com/NixOS/nixpkgs) - especially useful to look at the various READMEs that are in various places in the repository (find using GitHub code search) as well as the [issues](https://github.com/Swarsel/.dotfiles/issues) and [PRs](https://github.com/Swarsel/.dotfiles/pulls) pages
@ -192,7 +190,7 @@
- For the above, you can use the CLI tool [manix](https://github.com/mlvzk/manix)
- Nix function search: https://noogle.dev/
- Search for nix-community options: https://search.nüschtos.de/
- But that is not all:
- But that is not all:
- Some nix resources
- A tour of Nix: https://nixcloud.io/tour/
- The Nix One Pager: https://github.com/tazjin/nix-1p
@ -215,28 +213,28 @@
- Blog article about overrides: https://bobvanderlinden.me/customizing-packages-in-nix/#using-modified-packages
- Also useful is the [official NixOS Wiki](https://wiki.nixos.org/wiki/NixOS_Wiki)
- there is also the [unofficial NixOS Wiki](https://nixos.wiki/) that tends to be a bit outdated, use with care
- Some resources for specific nix tools:
- Some resources for specific nix tools:
- Flake output reference: https://nixos-and-flakes.thiscute.world/other-usage-of-flakes/outputs
- You can find public repositories with modules at https://nur.nix-community.org/ (you should check what you are installing however):
- I like to use this for rycee's firefox extensions: https://nur.nix-community.org/repos/rycee/
- List of nerdfonts: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/data/fonts/nerd-fonts/manifests/fonts.json
- Stylix configuration options: https://danth.github.io/stylix/
- nix-on-droid options: https://nix-community.github.io/nix-on-droid/nix-on-droid-options.html#sec-options
- Very useful tools that are mostly not directly used in configuration but instead called on need:
- Very useful tools that are mostly not directly used in configuration but instead called on need:
- Convert non-NixOS machines to NixOS using [nixos-infect](https://github.com/elitak/nixos-infect)
- Create various installation media with [nixos-generators](https://github.com/nix-community/nixos-generators)
- Remotely deploy NixOS using [nixos-anywhere](https://github.com/nix-community/nixos-anywhere)
- And a few links that are not directly nix-related, but may still serve you well:
- And a few links that are not directly nix-related, but may still serve you well:
- List of pre-commit-hooks: https://devenv.sh/reference/options/#pre-commithooks
- Waybar configuration: https://github.com/Alexays/Waybar/wiki
</details>
</details>
## Attributions, Acknowledgements, Inspirations, etc.
## Attributions, Acknowledgements, Inspirations, etc.
These are in random order (also known as 'the order in which I discovered them'). I would like to express my gratitude to:
These are in random order (also known as 'the order in which I discovered them'). I would like to express my gratitude to:
- All the great people who have contributed code for the nix-community, with special mentions for (this list is unfairly incomplete):
<details>
- All the great people who have contributed code for the nix-community, with special mentions for (this list is unfairly incomplete):
<details>
<summary>Click here to expand...</summary>
- [guibou](https://github.com/guibou/)
@ -260,10 +258,10 @@
- [zhaofengli](https://github.com/zhaofengli)
- [Artturin](https://github.com/Artturin)
- [oddlama](https://github.com/oddlama)
</details>
</details>
- All the people who have inspired me with their configurations (sadly also highly incomplete):
<details>
- All the people who have inspired me with their configurations (sadly also highly incomplete):
<details>
<summary>Click here to expand...</summary>
- [theSuess](https://github.com/theSuess) with their [home-manager](https://code.kulupu.party/thesuess/home-manager)
@ -278,6 +276,6 @@
- [librephoenix](https://github.com/librephoenix) with their [nixos-config](https://github.com/librephoenix/nixos-config)
- [Xe](https://github.com/Xe) with their [blog](https://xeiaso.net/blog/)
- [oddlama](https://github.com/oddlama) with their absolutely incredible [nix-config](https:/github.com/oddlama/nix-config)
</details>
</details>
If you feel that I forgot to pay you tribute for code that I used in this repository, please shoot me a message and I will fix it :)
If you feel that I forgot to pay you tribute for code that I used in this repository, please shoot me a message and I will fix it :)

BIN
.github/swarselsystems_preview.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 MiB

View file

@ -967,7 +967,6 @@ Another note concerning [[https://flake.parts/][flake-parts]]:
(mkConnection "moonside" "wan")
(mkConnection "pfsense" "wan")
(mkConnection "milkywell" "wan")
(mkConnection "magicant" "wifi")
(mkConnection "toto" "bootstrapper")
(mkConnection "chaostheatre" "demo host")
];
@ -1026,10 +1025,6 @@ Another note concerning [[https://flake.parts/][flake-parts]]:
};
winters.interfaces."eth1" = { };
bakery.interfaces = {
"eth1" = { };
"wifi" = { };
};
wifi-ap = mkSwitch "Wi-Fi AP" {
info = "Huawei";
@ -1040,9 +1035,6 @@ Another note concerning [[https://flake.parts/][flake-parts]]:
"wifi"
]
];
connections = {
wifi = mkConnection "bakery" "wifi";
};
};
switch-livingroom = mkSwitch "Switch Livingroom" {
@ -1073,19 +1065,6 @@ Another note concerning [[https://flake.parts/][flake-parts]]:
interfaces.eth1 = { };
};
magicant = mkDevice "magicant" {
icon = "${self}/files/topology-images/phone.png";
info = "Samsung Z Flip 6";
image = "${self}/files/topology-images/zflip6.png";
interfaces.wifi = { };
};
machpizza = mkDevice "machpizza" {
info = "MacBook Pro 2016";
icon = "${self}/files/topology-images/mac.png";
interfaces."eth1" = { };
};
pc = mkDevice "Windows Gaming Server" {
info = "i7-4790k, GTX970, 32GB RAM";
image = "${self}/files/topology-images/pc.png";
@ -1107,7 +1086,6 @@ Another note concerning [[https://flake.parts/][flake-parts]]:
]
];
connections.eth2 = mkConnection "printer" "eth1";
connections.eth3 = mkConnection "machpizza" "eth1";
};
printer = mkDevice "Printer" {
@ -2081,7 +2059,7 @@ My personal laptop.
lowResolution = "1280x800";
highResolution = "1920x1080";
sharescreen = "eDP-1";
info = "Lenovo Ideapad 720S-13IKB";
info = "Lenovo ThinkPad";
firewall = lib.mkForce true;
wallpaper = self + /files/wallpaper/lenovowp.png;
hasBluetooth = true;
@ -2518,10 +2496,6 @@ This machine mainly acts as an external sync helper. It manages the following th
domain = "subnet03112148.vcn03112148.oraclevcn.com";
};
topology.self = {
icon = "devices.cloud-server";
};
hardware = {
enableAllFirmware = lib.mkForce false;
};
@ -2720,15 +2694,12 @@ This machine mainly acts as an external sync helper. It manages the following th
etc."issue".text = "\4";
};
topology.self = {
icon = "devices.cloud-server";
interfaces.wg = {
topology.self.interfaces.wg = {
addresses = [ "192.168.3.4" ];
renderer.hidePhysicalConnections = true;
virtual = true;
type = "wireguard";
};
};
networking = {
nftables.enable = lib.mkForce false;
@ -11133,17 +11104,16 @@ Sets environment variables. Here I am only setting the EDITOR variable, most var
in
{
options.swarselmodules.env = lib.mkEnableOption "env settings";
config =z lib.mkIf config.swarselmodules.env {
config = lib.mkIf config.swarselmodules.env {
home.sessionVariables = {
EDITOR = "e -w";
DISPLAY = ":0";
SWARSEL_LO_RES = config.swarselsystems.lowResolution;
SWARSEL_HI_RES = config.swarselsystems.highResolution;
} // (lib.optionalAttrs (!isPublic) {
CROC_RELAY = crocDomain;
GITHUB_NOTIFICATION_TOKEN_PATH = nixosConfig.sops.secrets.github-notifications-token.path;
});
CROC_RELAY = lib.mkIf (!isPublic) crocDomain;
};
systemd.user.sessionVariables = lib.mkIf (!isPublic) {
GITHUB_NOTIFICATION_TOKEN_PATH = nixosConfig.sops.secrets.github-notifications-token.path;
SWARSEL_MAIL1 = address1;
SWARSEL_MAIL2 = address2;
SWARSEL_MAIL3 = address3;
@ -11661,8 +11631,6 @@ Currently I only use it as before with =initExtra= though.
boot-diff = "nix store diff-closures /run/*-system";
gen-diff = "nix profile diff-closures --profile /nix/var/nix/profiles/system";
cc = "wl-copy";
topology = "nix build .#topology.x86_64-linux.config.output";
iso = "nix build --print-out-paths .#live-iso";
}
config.swarselsystems.shellAliases;
autosuggestion.enable = true;
@ -22639,8 +22607,8 @@ Here lies defined the readme for GitHub and Forgejo:
# \~SwarselSystems\~
<p align="center">
<img width="49%" title="Tiling" alt="swarselsystems_preview1" src="https://github.com/user-attachments/assets/f6021ab9-6289-497d-8747-28f5d526b75a" />
<img width="49%" title="Waybar" alt="swarselsystems_preview2" src="https://github.com/user-attachments/assets/1160d9f7-710c-4046-8fcf-476bb4a0be84" />
<img src="https://i.imgur.com/bmgLNcu.png" width="49%" title="Tiling">
<img src="https://i.imgur.com/0G7Be6e.png" width="49%" title="Waybar">
</p>
## Overview
@ -22734,8 +22702,6 @@ Here lies defined the readme for GitHub and Forgejo:
<details>
<summary>Click here for a summary of my infrastructure</summary>
<img width="2202" height="2947" alt="topology" src="https://github.com/user-attachments/assets/0eb37288-47a8-40e3-9211-648eee0ed408" />
### Programs
<<programs>>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

View file

@ -27,7 +27,7 @@ in
lowResolution = "1280x800";
highResolution = "1920x1080";
sharescreen = "eDP-1";
info = "Lenovo Ideapad 720S-13IKB";
info = "Lenovo ThinkPad";
firewall = lib.mkForce true;
wallpaper = self + /files/wallpaper/lenovowp.png;
hasBluetooth = true;

View file

@ -17,10 +17,6 @@
domain = "subnet03112148.vcn03112148.oraclevcn.com";
};
topology.self = {
icon = "devices.cloud-server";
};
hardware = {
enableAllFirmware = lib.mkForce false;
};

View file

@ -26,15 +26,12 @@ in
etc."issue".text = "\4";
};
topology.self = {
icon = "devices.cloud-server";
interfaces.wg = {
topology.self.interfaces.wg = {
addresses = [ "192.168.3.4" ];
renderer.hidePhysicalConnections = true;
virtual = true;
type = "wireguard";
};
};
networking = {
nftables.enable = lib.mkForce false;

View file

@ -8,17 +8,16 @@ let
in
{
options.swarselmodules.env = lib.mkEnableOption "env settings";
config = z lib.mkIf config.swarselmodules.env {
config = lib.mkIf config.swarselmodules.env {
home.sessionVariables = {
EDITOR = "e -w";
DISPLAY = ":0";
SWARSEL_LO_RES = config.swarselsystems.lowResolution;
SWARSEL_HI_RES = config.swarselsystems.highResolution;
} // (lib.optionalAttrs (!isPublic) {
CROC_RELAY = crocDomain;
GITHUB_NOTIFICATION_TOKEN_PATH = nixosConfig.sops.secrets.github-notifications-token.path;
});
CROC_RELAY = lib.mkIf (!isPublic) crocDomain;
};
systemd.user.sessionVariables = lib.mkIf (!isPublic) {
GITHUB_NOTIFICATION_TOKEN_PATH = nixosConfig.sops.secrets.github-notifications-token.path;
SWARSEL_MAIL1 = address1;
SWARSEL_MAIL2 = address2;
SWARSEL_MAIL3 = address3;

View file

@ -49,8 +49,6 @@ in
boot-diff = "nix store diff-closures /run/*-system";
gen-diff = "nix profile diff-closures --profile /nix/var/nix/profiles/system";
cc = "wl-copy";
topology = "nix build .#topology.x86_64-linux.config.output";
iso = "nix build --print-out-paths .#live-iso";
}
config.swarselsystems.shellAliases;
autosuggestion.enable = true;

View file

@ -35,7 +35,6 @@
(mkConnection "moonside" "wan")
(mkConnection "pfsense" "wan")
(mkConnection "milkywell" "wan")
(mkConnection "magicant" "wifi")
(mkConnection "toto" "bootstrapper")
(mkConnection "chaostheatre" "demo host")
];
@ -94,10 +93,6 @@
};
winters.interfaces."eth1" = { };
bakery.interfaces = {
"eth1" = { };
"wifi" = { };
};
wifi-ap = mkSwitch "Wi-Fi AP" {
info = "Huawei";
@ -108,9 +103,6 @@
"wifi"
]
];
connections = {
wifi = mkConnection "bakery" "wifi";
};
};
switch-livingroom = mkSwitch "Switch Livingroom" {
@ -141,19 +133,6 @@
interfaces.eth1 = { };
};
magicant = mkDevice "magicant" {
icon = "${self}/files/topology-images/phone.png";
info = "Samsung Z Flip 6";
image = "${self}/files/topology-images/zflip6.png";
interfaces.wifi = { };
};
machpizza = mkDevice "machpizza" {
info = "MacBook Pro 2016";
icon = "${self}/files/topology-images/mac.png";
interfaces."eth1" = { };
};
pc = mkDevice "Windows Gaming Server" {
info = "i7-4790k, GTX970, 32GB RAM";
image = "${self}/files/topology-images/pc.png";
@ -175,7 +154,6 @@
]
];
connections.eth2 = mkConnection "printer" "eth1";
connections.eth3 = mkConnection "machpizza" "eth1";
};
printer = mkDevice "Printer" {