Restructure packages into subdirectories

This commit is contained in:
Reinout Meliesie 2025-03-04 13:13:22 +01:00
parent 3961e33ca1
commit f91196c8a4
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
9 changed files with 45 additions and 20 deletions

View file

@ -1,9 +1,12 @@
{ pkgs , ... } : { pkgs } :
with pkgs ; with pkgs ;
with pkgs . kernelmaft ;
{ {
imports = [
packages/bookwyrm/nixos-module.nix
] ;
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
( self : super : { ( self : super : {
@ -50,19 +53,4 @@ with pkgs . kernelmaft ;
} ) } )
] ; ] ;
} ; } ;
systemd = {
units = {
"bookwyrm.service" = {
text = ''
[Unit]
After=network.target
[Service]
ExecStart=${bookwyrm}/bin/bookwyrm
WorkingDirectory=/var/lib/bookwyrm
'' ;
} ;
} ;
} ;
} }

View file

@ -0,0 +1,20 @@
{ pkgs } :
with pkgs . kernelmaft ;
{
systemd = {
units = {
"bookwyrm.service" = {
text = ''
[Unit]
After=network.target
[Service]
ExecStart=${bookwyrm}/bin/bookwyrm
WorkingDirectory=/var/lib/bookwyrm
'' ;
} ;
} ;
} ;
}

View file

@ -3,11 +3,28 @@
## Description ## Description
An assortment of Nix packages not in the official collection. An assortment of Nix packages not in the official collection.
They can either be imported individually or using the module if you're on NixOS. They can either be used individually or, if you're on NixOS, imported wholesale using the top-level module.
These are purposefully written without support for [overriding](https://nixos.org/guides/nix-pills/17-nixpkgs-overriding-packages) in order to minimise complexity. These are purposefully written without support for [overriding](https://nixos.org/guides/nix-pills/17-nixpkgs-overriding-packages) in order to minimise complexity.
If you want to build upon them I encourage you to fork this repository. If you want to build upon them I encourage you to fork this repository.
## Structure
### `nixos-module.nix`
The top-level NixOS module containing all package expressions as an overlay, and all package modules.
Once imported the overlay contents can be found under `pkgs . kernelmaft`.
### `packages/<package-name>/package.nix`
A Nix package expression.
### `packages/<package-name>/nixos-module.nix`
NixOS module providing additional features for the package in question, such as for example systemd units.
Can be imported directly, but is also imported by the top-level module.
Not present for all packages.
## Examples ## Examples
> **Note:** > **Note:**
@ -18,8 +35,8 @@ Using a specific package:
```nix ```nix
pkgs . callPackage ( import ( pkgs . fetchurl { pkgs . callPackage ( import ( pkgs . fetchurl {
url = "https://kernelmaft.com/forgejo/zedfrigg/nix-packages/raw/commit/c45884c66f31f8d8d80866bebc13e9e963e02a70/python3.11-django-imagekit.nix" ; url = "https://kernelmaft.com/forgejo/zedfrigg/nix-packages/raw/commit/c45884c66f31f8d8d80866bebc13e9e963e02a70/packages/python3.11-django-imagekit/package.nix" ;
hash = "sha256-E4mo2JvK5SuxC6SQ7O5ZjhzehmxEThNJ7F6gBnil8ho=" ; hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" ;
} ) ) {} } ) ) {}
``` ```