🎉📝 initialize v2

This commit is contained in:
Jo 2025-01-13 18:54:17 +01:00
parent 5087472710
commit 5abbdd12fb
95 changed files with 38 additions and 2693 deletions

View file

@ -1,23 +0,0 @@
{
lib,
namespace,
config,
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.common.audio;
in {
options.${namespace}.common.audio = { enable = mkEnableOption "whether to enable common audio support and tweaks"; };
config = mkIf cfg.enable {
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
}

View file

@ -1,32 +0,0 @@
{
lib,
pkgs,
namespace,
config,
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.common.bluetooth;
in {
options.${namespace}.common.bluetooth = { enable = mkEnableOption "Enable bluetooth support on your current system"; };
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ bluez ];
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
package = pkgs.bluez;
settings = {
General = {
ControllerMode = "dual";
FastConnectable = "true";
Experimental = "true";
KernelExperimental = "true";
Disable= "Handsfree";
};
};
};
};
}

View file

@ -1,30 +0,0 @@
{
lib,
pkgs,
namespace,
config,
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.common.fonts;
in {
options.${namespace}.common.fonts = with types; {
enable = mkEnableOption "Enable system font management";
fonts = mkOption {
type = listOf package;
default = with pkgs; [ noto-fonts noto-fonts-cjk-sans noto-fonts-cjk-serif noto-fonts-emoji nerd-fonts.bigblue-terminal nerd-fonts.zed-mono monocraft ];
example = [ noto-fonts noto-fonts-emoji ];
description = "Install additional font packages";
};
};
config = mkIf cfg.enable {
environment.variables = {
LOG_ICONS = "true"; # Enable icons in tooling (requires nerdfonts)
};
environment.systemPackages = with pkgs; [ font-manager ];
fonts.packages = cfg.fonts;
};
}

View file

@ -1,31 +0,0 @@
{
lib,
namespace,
config,
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.common.grub;
in {
options.${namespace}.common.grub = { enable = mkEnableOption "grub"; };
config = mkIf cfg.enable {
boot.loader.systemd-boot.enable = false;
boot.loader.grub = {
enable = true;
devices = [ "nodev" ];
efiInstallAsRemovable = true;
efiSupport = true;
extraEntries = ''
menuentry "Reboot" {
reboot
}
menuentry "Poweroff" {
halt
}
'';
};
};
}

View file

@ -1,16 +0,0 @@
{
lib,
namespace,
config,
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.common.hardware;
in {
options.${namespace}.common.hardware = { enable = mkEnableOption "whether to enable common hardware support"; };
config = mkIf cfg.enable {
hardware.sensor.iio.enable = true; # Enable iio-sensor for automatic screen rotation and similar features.
hardware.flipperzero.enable = true; # Enable support for the flipperzero device.
};
}

View file

@ -1,24 +0,0 @@
{
lib,
pkgs,
namespace,
config,
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.common.kernel;
in {
options.${namespace}.common.kernel = {
enable = mkEnableOption "Modify the standard kernel settings";
version = mkOption {
type = types.str;
default = "linuxPackages_latest";
example = "linuxPackages_latest";
description = "Set the kernel version to be used by your system";
};
};
config = mkIf cfg.enable {
boot.kernelPackages = pkgs.${cfg.version};
};
}

View file

@ -1,56 +0,0 @@
{
lib,
namespace,
config,
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.common.locale;
in {
options.${namespace}.common.locale = {
enable = mkEnableOption "whether to enable common locale tweaks";
language = mkOption {
type = types.str;
default = "en_US";
example = "en_US";
description = "Sets the language for most text, doesn't include monetary or measurement settings";
};
country = mkOption {
type = types.str;
default = "de_DE";
example = "de_DE";
description = "Sets the language used for monetary or measurement settings (USD vs Euro, etc...)";
};
keymap = mkOption {
type = types.str;
default = "de";
example = "de";
description = "Sets the keymap to be used by the system";
};
};
config = mkIf cfg.enable {
# Internationalisation properties.
i18n.defaultLocale = "${cfg.language}.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "${cfg.country}.UTF-8";
LC_IDENTIFICATION = "${cfg.country}.UTF-8";
LC_MEASUREMENT = "${cfg.country}.UTF-8";
LC_MONETARY = "${cfg.country}.UTF-8";
LC_NAME = "${cfg.country}.UTF-8";
LC_NUMERIC = "${cfg.country}.UTF-8";
LC_PAPER = "${cfg.country}.UTF-8";
LC_TELEPHONE = "${cfg.country}.UTF-8";
LC_TIME = "${cfg.country}.UTF-8";
};
# Set console keymap.
console.keyMap = cfg.keymap;
services.xserver = {
xkb.layout = cfg.keymap;
};
};
}

View file

@ -1,20 +0,0 @@
{
lib,
namespace,
config,
...
}:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.common.networking;
in {
options.${namespace}.common.networking = {
enable = mkEnableOption "Whether to enable networking through NetworkManager.";
};
config = mkIf cfg.enable {
networking.networkmanager = {
enable = true;
};
};
}

View file

@ -1,53 +0,0 @@
{
lib,
pkgs,
namespace,
config,
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.common.nix;
in {
options.${namespace}.common.nix = {
enable = mkEnableOption "Overwrite the default Nix configuration.";
use-lix = mkEnableOption "Enable Lix as an alternative to CppNix.";
use-nixld = mkEnableOption "Enable the use of dynamically linked executables on nix based systems.";
};
config = mkIf cfg.enable {
nix = {
settings = {
auto-optimise-store = true;
builders-use-substitutes = true;
experimental-features = [ "nix-command" "flakes" ];
keep-derivations = true;
keep-outputs = true;
max-jobs = "auto";
warn-dirty = false;
};
# Garbage collection configuration.
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 3d";
};
extraOptions = ''
extra-substituters = https://devenv.cachix.org
extra-trusted-public-keys = devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=
'';
package = mkIf cfg.use-lix pkgs.lix; # Enable LIX
};
# Dynamic libraries for unpackaged programs
programs.nix-ld = mkIf cfg.use-nixld {
enable = true;
libraries = with pkgs; [
glibc
libcxx
];
};
};
}

View file

@ -1,20 +0,0 @@
{
lib,
namespace,
config,
pkgs,
...
}: with lib; with lib.${namespace};
let
cfg = config.${namespace}.common.shell;
in {
options.${namespace}.common.shell = {
enable = mkEnableOption "Modify the standard shell options";
};
config = mkIf cfg.enable {
environment.shells = with pkgs; [ fish ];
users.defaultUserShell = pkgs.fish;
programs.fish.enable = true;
};
}