diff --git a/configs/all-configurations.nix b/configs/all-configurations.nix index 5a404aae9..56fa61143 100644 --- a/configs/all-configurations.nix +++ b/configs/all-configurations.nix @@ -1,3 +1,3 @@ -{ pkgs }: { +{pkgs}: { liberaforms-container = import ./liberaforms/container.nix; } diff --git a/flake.nix b/flake.nix index a8f3004c7..0584c0620 100644 --- a/flake.nix +++ b/flake.nix @@ -9,58 +9,64 @@ inputs.treefmt-nix.url = "github:numtide/treefmt-nix"; inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; - outputs = inputs@{ self, nixpkgs, flake-utils, treefmt-nix, ... }: - let - buildOutputs = system: - let - pkgs = nixpkgs.legacyPackages.${system}; - treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; - in { - packages = import ./all-packages.nix { inherit (pkgs) newScope; }; - nixosModules = { - modules = import ./modules/all-modules.nix; - ngipkgs = { ... }: { - # Inject an additional argument into the module system evaluation. - # This way our package set can be accessed separately and we don't have - # to muck around with overlays (which don't work with flakes as you'd expect) - _module.args.ngipkgs = self.packages.${system}; - }; - }; - - formatter = treefmtEval.config.build.wrapper; + outputs = { + self, + nixpkgs, + flake-utils, + treefmt-nix, + ... + }: let + buildOutputs = system: let + pkgs = nixpkgs.legacyPackages.${system}; + treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; + in { + packages = import ./all-packages.nix {inherit (pkgs) newScope;}; + nixosModules = { + modules = import ./modules/all-modules.nix; + ngipkgs = {...}: { + # Inject an additional argument into the module system evaluation. + # This way our package set can be accessed separately and we don't have + # to muck around with overlays (which don't work with flakes as you'd expect) + _module.args.ngipkgs = self.packages.${system}; }; + }; - checkOutputs = system: - let - pkgs = nixpkgs.legacyPackages.${system}; - treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; - inject-ngipkgs = k: v: - pkgs.nixos - ({ ... }: { imports = [ self.nixosModules.${system}.ngipkgs v ]; }); - - ngipkgsModule = self.nixosModules.${system}.ngipkgs; - in { - # Configurations have to go in checkOutputs (ie, avoid `eachDefaultSystem`) to generate - # a single attribute name for nixos-container deployments (``), because - # nixos-container can't parse dot-separated sequence attribute paths (`x86_64-linux.`). - nixosConfigurations = let - all-configurations = - import ./configs/all-configurations.nix { inherit pkgs; }; - in builtins.mapAttrs inject-ngipkgs all-configurations; + formatter = treefmtEval.config.build.wrapper; + }; - # To generate a Hydra jobset for CI builds of all packages - # https://hydra.ngi0.nixos.org/jobset/ngipkgs/main - hydraJobs = { packages.${system} = self.packages.${system}; }; + checkOutputs = system: let + pkgs = nixpkgs.legacyPackages.${system}; + treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; + ngipkgsModule = self.nixosModules.${system}.ngipkgs; + in { + # Configurations have to go in checkOutputs (ie, avoid `eachDefaultSystem`) to generate + # a single attribute name for nixos-container deployments (``), because + # nixos-container can't parse dot-separated sequence attribute paths (`x86_64-linux.`). + nixosConfigurations = let + all-configurations = import ./configs/all-configurations.nix {inherit pkgs;}; + inject-ngipkgs = k: v: pkgs.nixos ({...}: {imports = [ngipkgsModule v];}); + in + builtins.mapAttrs inject-ngipkgs all-configurations; - test-pretalx = pkgs.nixosTest - (import ./tests/pretalx/pretalx.nix { inherit ngipkgsModule;}); + # To generate a Hydra jobset for CI builds of all packages + # https://hydra.ngi0.nixos.org/jobset/ngipkgs/main + hydraJobs = { + packages.${system} = self.packages.${system}; + }; - # For .github/workflows/ci.yaml to *build* all packages, because - # `nix flake check` only evaluates packages, but it builds checks. - checks.${system} = self.packages.${system} // { - formatting = treefmtEval.config.build.check self; - }; + # For .github/workflows/ci.yaml to *build* all packages, because + # `nix flake check` only evaluates packages, but it builds checks. + checks.${system} = + self.packages.${system} + // { + formatting = treefmtEval.config.build.check self; + test-pretalx = + pkgs.nixosTest + (import ./tests/pretalx/pretalx.nix { + inherit ngipkgsModule; + }); }; - in (flake-utils.lib.eachDefaultSystem buildOutputs) - // (checkOutputs "x86_64-linux"); + }; + in + (flake-utils.lib.eachDefaultSystem buildOutputs) // (checkOutputs "x86_64-linux"); } diff --git a/modules/pretalx.nix b/modules/pretalx.nix index ebee1de91..559947ac6 100644 --- a/modules/pretalx.nix +++ b/modules/pretalx.nix @@ -1,6 +1,11 @@ -{ config, lib, pkgs, ngipkgs, ... }: -with lib; -let +{ + config, + lib, + pkgs, + ngipkgs, + ... +}: +with lib; let cfg = config.services.pretalx; group = "pretalx"; default_home = "/var/lib/pretalx"; @@ -20,26 +25,30 @@ let port = "8001"; }; - environmentFile = pkgs.runCommand "pretalx-environ" { - buildInputs = [ pretalx gunicorn ]; # Sets PYTHONPATH in derivation - } '' - cat > $out < $out <