Make use of overlay in service module

This commit is contained in:
Tim Van Baak 2023-06-20 14:06:24 -07:00
parent b68b7b75fa
commit 7b7936cabc
2 changed files with 6 additions and 4 deletions

View File

@ -64,7 +64,7 @@
config.nixpkgs.overlays = [ self.overlays.default ];
};
nixosModules.intake = import ./module.nix self;
nixosModules.intake = import ./module.nix;
nixosConfigurations."demo" = makeOverridable nixosSystem {
inherit system;

View File

@ -1,7 +1,7 @@
flake: { config, lib, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
inherit (lib) filterAttrs foldl imap1 mapAttrsToList mkEnableOption mkIf mkMerge mkOption types;
inherit (lib) filterAttrs foldl imap1 mapAttrsToList mkEnableOption mkIf mkMerge mkOption mkPackageOption types;
intakeCfg = config.services.intake;
in {
options = {
@ -20,6 +20,8 @@ in {
"port based on the request's HTTP Basic Auth credentials.";
};
package = mkPackageOption pkgs "intake" {};
internalPortStart = mkOption {
type = types.port;
default = 24130;
@ -48,7 +50,7 @@ in {
config =
let
# Define the intake package and a python environment to run it from
intake = flake.packages.${pkgs.stdenv.hostPlatform.system}.default;
intake = intakeCfg.package;
pythonEnv = pkgs.python38.withPackages (pypkgs: [ intake ]);
# Assign each user an internal port for their personal intake instance