base configuration

This commit is contained in:
Dennis Wuitz
2023-12-23 06:49:01 +01:00
commit 75405396d2
33 changed files with 2420 additions and 0 deletions

9
lib/ldap.nix Normal file
View File

@ -0,0 +1,9 @@
{ lib, ... }:
{
mkUserGroupOption = lib.mkOption {
type = with lib.types; nullOr str;
default = null;
description = lib.mdDoc "Restrict logins to users in this group";
};
}

11
lib/modules.nix Normal file
View File

@ -0,0 +1,11 @@
{ config, lib, ... }:
{
mkOpinionatedOption = text: lib.mkOption {
type = lib.types.bool;
default = config.opinionatedDefaults;
description = lib.mdDoc "Whether to ${text}.";
};
mkRecursiveDefault = lib.mapAttrsRecursive (_: lib.mkDefault);
}

8
lib/nix.nix Normal file
View File

@ -0,0 +1,8 @@
{ lib, ... }:
{
# taken from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/nix-daemon.nix#L828-L832
# a builder can run code for `gcc.arch` and inferior architectures
gcc-system-features = arch: [ "gccarch-${arch}" ]
++ map (x: "gccarch-${x}") lib.systems.architectures.inferiors.${arch};
}

10
lib/ssh.nix Normal file
View File

@ -0,0 +1,10 @@
_:
{
mkPubKey = name: type: publicKey: {
"${name}-${type}" = {
extraHostNames = [ name ];
publicKey = "${type} ${publicKey}";
};
};
}