From c5778513e2d19421d29291692f5a9d13a9dc1550 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Tue, 20 Jun 2023 14:26:40 -0700 Subject: [PATCH] Pass flake into module again There doesn't seem to be a better way at present to get the overlay to the module --- flake.nix | 8 +------- module.nix | 5 ++++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 9306191..909bdf5 100644 --- a/flake.nix +++ b/flake.nix @@ -59,19 +59,13 @@ description = "A basic intake source config"; }; - nixosModules.default = { - options = {}; - config.nixpkgs.overlays = [ self.overlays.default ]; - }; - - nixosModules.intake = import ./module.nix; + nixosModules.default = import ./module.nix self; nixosConfigurations."demo" = makeOverridable nixosSystem { inherit system; modules = [ nixos-shell.nixosModules.nixos-shell self.nixosModules.default - self.nixosModules.intake ./demo ]; }; diff --git a/module.nix b/module.nix index 7b92bfa..b9fdcc4 100644 --- a/module.nix +++ b/module.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +flake: { config, lib, pkgs, ... }: let inherit (lib) filterAttrs foldl imap1 mapAttrsToList mkEnableOption mkIf mkMerge mkOption mkPackageOption types; @@ -68,6 +68,9 @@ in { intakeDir = "/etc/intake"; intakePwd = "${intakeDir}/htpasswd"; in { + # Apply the overlay so intake is included inpkgs. + nixpkgs.overlays = [ flake.overlays.default ]; + # Define a user group for access to the htpasswd file. users.groups.intake.members = mkIf (enabledUsers != {}) (enabledUserNames ++ [ "nginx" ]);