diff --git a/packages/bookwyrm/package.nix b/bookwyrm.nix similarity index 100% rename from packages/bookwyrm/package.nix rename to bookwyrm.nix diff --git a/nixos-module.nix b/nixos-module.nix index 461ee5f..88e7329 100644 --- a/nixos-module.nix +++ b/nixos-module.nix @@ -1,56 +1,70 @@ -{ pkgs } : +{ pkgs , ... } : with pkgs ; +with pkgs . kernelmaft ; { - imports = [ - packages/bookwyrm/nixos-module.nix - ] ; - nixpkgs = { overlays = [ - ( self : super : { - kernelmaft = { + ( self : super : + { + kernelmaft = { - bookwyrm = callPackage ( - import ./bookwyrm.nix - ) {} ; - - python = { - - bw-file-resubmit = callPackage ( - import ./python3.11-bw-file-resubmit.nix + bookwyrm = callPackage ( + import ./bookwyrm.nix ) {} ; - django-imagekit = callPackage ( - import ./python3.11-django-imagekit.nix - ) {} ; + python = { - django-pgtrigger = callPackage ( - import ./python3.11-django-pgtrigger.nix - ) {} ; + bw-file-resubmit = callPackage ( + import ./python3.11-bw-file-resubmit.nix + ) {} ; - django-sass-processor = callPackage ( - import ./python3.11-django-sass-processor.nix - ) {} ; + django-imagekit = callPackage ( + import ./python3.11-django-imagekit.nix + ) {} ; - s3-tar = callPackage ( - import ./python3.11-s3-tar.nix - ) {} ; + django-pgtrigger = callPackage ( + import ./python3.11-django-pgtrigger.nix + ) {} ; + + django-sass-processor = callPackage ( + import ./python3.11-django-sass-processor.nix + ) {} ; + + s3-tar = callPackage ( + import ./python3.11-s3-tar.nix + ) {} ; + + } ; } ; - } ; + # TODO: Use the following template once the custom Python packages have been converted to use `buildPythonPackage` + # + # python311 = super . python311 . override { + # packageOverrides = python-self : python-super : { + # package-name = super . callPackage ( import ./package-file.nix ) {} ; + # } ; + # } ; - # TODO: Use the following template once the custom Python packages have been converted to use `buildPythonPackage` - # - # python311 = super . python311 . override { - # packageOverrides = python-self : python-super : { - # package-name = super . callPackage ( import ./package-file.nix ) {} ; - # } ; - # } ; - - } ) + } + ) ] ; } ; + + systemd = { + units = { + "bookwyrm.service" = { + text = '' + [Unit] + After=network.target + + [Service] + ExecStart=${bookwyrm}/bin/bookwyrm + WorkingDirectory=/var/lib/bookwyrm + '' ; + } ; + } ; + } ; } diff --git a/packages/bookwyrm/nixos-module.nix b/packages/bookwyrm/nixos-module.nix deleted file mode 100644 index bb92e4e..0000000 --- a/packages/bookwyrm/nixos-module.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs } : - -with pkgs . kernelmaft ; - -{ - systemd = { - units = { - "bookwyrm.service" = { - text = '' - [Unit] - After=network.target - - [Service] - ExecStart=${bookwyrm}/bin/bookwyrm - WorkingDirectory=/var/lib/bookwyrm - '' ; - } ; - } ; - } ; -} diff --git a/packages/python3.11-bw-file-resubmit/package.nix b/python3.11-bw-file-resubmit.nix similarity index 100% rename from packages/python3.11-bw-file-resubmit/package.nix rename to python3.11-bw-file-resubmit.nix diff --git a/packages/python3.11-django-imagekit/package.nix b/python3.11-django-imagekit.nix similarity index 100% rename from packages/python3.11-django-imagekit/package.nix rename to python3.11-django-imagekit.nix diff --git a/packages/python3.11-django-pgtrigger/package.nix b/python3.11-django-pgtrigger.nix similarity index 100% rename from packages/python3.11-django-pgtrigger/package.nix rename to python3.11-django-pgtrigger.nix diff --git a/packages/python3.11-django-sass-processor/package.nix b/python3.11-django-sass-processor.nix similarity index 100% rename from packages/python3.11-django-sass-processor/package.nix rename to python3.11-django-sass-processor.nix diff --git a/packages/python3.11-s3-tar/package.nix b/python3.11-s3-tar.nix similarity index 100% rename from packages/python3.11-s3-tar/package.nix rename to python3.11-s3-tar.nix diff --git a/readme.md b/readme.md index a43d834..d6bec7c 100644 --- a/readme.md +++ b/readme.md @@ -3,28 +3,11 @@ ## Description An assortment of Nix packages not in the official collection. -They can either be used individually or, if you're on NixOS, imported wholesale using the top-level module. +They can either be imported individually or using the module if you're on NixOS. 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. -## 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.nix` - -A Nix package expression. - -### `packages//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 > **Note:** @@ -35,8 +18,8 @@ Using a specific package: ```nix pkgs . callPackage ( import ( pkgs . fetchurl { - url = "https://kernelmaft.com/forgejo/zedfrigg/nix-packages/raw/commit/c45884c66f31f8d8d80866bebc13e9e963e02a70/packages/python3.11-django-imagekit/package.nix" ; - hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" ; + url = "https://kernelmaft.com/forgejo/zedfrigg/nix-packages/raw/commit/c45884c66f31f8d8d80866bebc13e9e963e02a70/python3.11-django-imagekit.nix" ; + hash = "sha256-E4mo2JvK5SuxC6SQ7O5ZjhzehmxEThNJ7F6gBnil8ho=" ; } ) ) {} ```