Asserted formatting fixes

This commit is contained in:
Sandro - 2024-01-08 14:47:38 +01:00
parent a3ccbc1f17
commit 63ad42397e
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
8 changed files with 51 additions and 52 deletions

View File

@ -22,16 +22,14 @@
); );
in in
{ {
lib = args: lib = args: let
let lib' = importDirToKey "lib" args;
lib' = importDirToKey "lib" args; in lib' // {
in # some functions get promoted to be directly under libS
lib' // { inherit (lib'.doc) mkModuleDoc mkMdBook;
# some functions get promoted to be directly under libS inherit (lib'.modules) mkOpinionatedOption mkRecursiveDefault;
inherit (lib'.doc) mkModuleDoc mkMdBook; inherit (lib'.ssh) mkPubKey;
inherit (lib'.modules) mkOpinionatedOption mkRecursiveDefault; };
inherit (lib'.ssh) mkPubKey;
};
# NOTE: requires libS to be imported once which can be done like: # NOTE: requires libS to be imported once which can be done like:
# _module.args.libS = lib.mkOverride 1001 (nixos-modules.lib { inherit lib config; }); # _module.args.libS = lib.mkOverride 1001 (nixos-modules.lib { inherit lib config; });
@ -53,25 +51,24 @@
_module.args.libS = lib.mkOverride 1000 (self.lib { inherit lib config; }); _module.args.libS = lib.mkOverride 1000 (self.lib { inherit lib config; });
imports = fileList "modules"; imports = fileList "modules";
}; };
} // flake-utils.lib.eachDefaultSystem (system: } // flake-utils.lib.eachDefaultSystem (system: let
let libS = self.lib { config = { }; inherit lib; pkgs = nixpkgs.legacyPackages.${system}; };
libS = self.lib { config = { }; inherit lib; pkgs = nixpkgs.legacyPackages.${system}; }; in {
in packages = rec {
{ options-doc-md = libS.mkModuleDoc {
packages = rec { modules = [
options-doc-md = libS.mkModuleDoc { ({ config, lib, ... }: {
modules = [ _module.args.libS = self.lib { inherit config lib; };
({ config, lib, ... }: { })
_module.args.libS = self.lib { inherit config lib; }; self.nixosModule
}) ];
self.nixosModule urlPrefix = "https://github.com/SuperSandro2000/nixos-modules/tree/master/";
];
urlPrefix = "https://github.com/SuperSandro2000/nixos-modules/tree/master/";
};
options-doc = libS.mkMdBook {
projectName = "nixos-modules";
moduleDoc = options-doc-md;
};
}; };
});
options-doc = libS.mkMdBook {
projectName = "nixos-modules";
moduleDoc = options-doc-md;
};
};
});
} }

View File

@ -95,7 +95,7 @@ in
}; };
config.services.nginx = lib.mkIf (cfg.enable && cfg.configureNginx) { config.services.nginx = lib.mkIf (cfg.enable && cfg.configureNginx) {
upstreams.grafana.servers."unix:${cfg.settings.server.socket}" = {}; upstreams.grafana.servers."unix:${cfg.settings.server.socket}" = { };
virtualHosts = { virtualHosts = {
"${cfg.settings.server.domain}".locations = { "${cfg.settings.server.domain}".locations = {
"/".proxyPass = "http://grafana"; "/".proxyPass = "http://grafana";

View File

@ -29,6 +29,6 @@ in
config.services.portunus.seedSettings.groups = lib.optional (cfg.userGroup != null) { config.services.portunus.seedSettings.groups = lib.optional (cfg.userGroup != null) {
long_name = "Hedgedoc Users"; long_name = "Hedgedoc Users";
name = cfg.userGroup; name = cfg.userGroup;
permissions = {}; permissions = { };
}; };
} }

View File

@ -83,9 +83,11 @@ in
name = cfg.userGroup; name = cfg.userGroup;
permissions = { }; permissions = { };
}) })
] ++ lib.flatten (map lib.attrValues (map (lib.mapAttrs (ldapGroup: _: { ] ++ lib.flatten (map lib.attrValues (map
long_name = "Hydra Role ${ldapGroup}"; (lib.mapAttrs (ldapGroup: _: {
name = ldapGroup; long_name = "Hydra Role ${ldapGroup}";
permissions = { }; name = ldapGroup;
})) cfg.roleMappings)); permissions = { };
}))
cfg.roleMappings));
} }

View File

@ -7,7 +7,7 @@
config = { config = {
hardware.opengl = { hardware.opengl = {
extraPackages = with pkgs; lib.mkIf config.hardware.intelGPU [ extraPackages = with pkgs; lib.mkIf config.hardware.intelGPU [
intel-compute-runtime # OpenCL library for iGPU intel-compute-runtime # OpenCL library for iGPU
# video encoding/decoding hardware acceleration # video encoding/decoding hardware acceleration
intel-media-driver # broadwell or newer intel-media-driver # broadwell or newer

View File

@ -164,10 +164,10 @@ in
# 1080 files/photos app when viewing picture # 1080 files/photos app when viewing picture
${occ} config:app:set --value="256 1080" previewgenerator heightSizes ${occ} config:app:set --value="256 1080" previewgenerator heightSizes
''; '';
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
User = "nextcloud"; User = "nextcloud";
}; };
}; };
nextcloud-setup = lib.mkIf cfg.configureRecognize { nextcloud-setup = lib.mkIf cfg.configureRecognize {

View File

@ -2,12 +2,12 @@
# this module extends the environment.noXlibs setting with yet to merge and upstream overwrites # this module extends the environment.noXlibs setting with yet to merge and upstream overwrites
{ {
config = lib.mkIf config.environment.noXlibs { config = lib.mkIf config.environment.noXlibs {
nixpkgs.overlays = lib.singleton (lib.const (super: { nixpkgs.overlays = lib.singleton (lib.const (super: {
nginx = super.nginx.override { withImageFilter = false; }; nginx = super.nginx.override { withImageFilter = false; };
# https://github.com/NixOS/nixpkgs/pull/213783 # https://github.com/NixOS/nixpkgs/pull/213783
vte = super.vte.override { gtkVersion = null; }; vte = super.vte.override { gtkVersion = null; };
})); }));
}; };
} }

View File

@ -22,16 +22,16 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions = [ { assertions = [{
assertion = cfg.configureNginx -> cfg.domain != null; assertion = cfg.configureNginx -> cfg.domain != null;
message = '' message = ''
Setting services.vaultwarden.configureNginx to true requires configuring services.vaultwarden.domain! Setting services.vaultwarden.configureNginx to true requires configuring services.vaultwarden.domain!
''; '';
} ]; }];
nixpkgs.overlays = lib.mkIf cfg.recommendedDefaults [ nixpkgs.overlays = lib.mkIf cfg.recommendedDefaults [
(final: prev: { (final: prev: {
vaultwarden = prev.vaultwarden.overrideAttrs ({ patches ? [], ... }: { vaultwarden = prev.vaultwarden.overrideAttrs ({ patches ? [ ], ... }: {
patches = patches ++ [ patches = patches ++ [
# add eu region push support # add eu region push support
(final.fetchpatch { (final.fetchpatch {