Switch to snowfall flake configuration

This commit is contained in:
jopejoe1 2023-02-23 20:34:35 +01:00
parent bc0766220d
commit d322a4f0a8
26 changed files with 1042 additions and 465 deletions

View file

@ -0,0 +1,23 @@
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
let cfg = config.custom.system.boot.uboot;
in
{
options.custom.system.boot.uboot = with types; {
enable = mkBoolOpt false "Whether or not to enable booting on uboot system.";
};
config = mkIf cfg.enable {
boot = {
# Boot loader configutation
loader = {
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
generic-extlinux-compatible.enable = true;
};
};
};
}

View file

@ -0,0 +1,22 @@
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
let cfg = config.custom.system.boot.uefi;
in
{
options.custom.system.boot.uefi = with types; {
enable = mkBoolOpt false "Whether or not to enable booting on a uefi system.";
};
config = mkIf cfg.enable {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.systemd-boot.configurationLimit = 10;
# https://github.com/NixOS/nixpkgs/blob/c32c39d6f3b1fe6514598fa40ad2cf9ce22c3fb7/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix#L66
boot.loader.systemd-boot.editor = false;
};
}

View file

@ -0,0 +1,30 @@
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
let cfg = config.custom.system.fonts;
in
{
options.custom.system.fonts = with types; {
enable = mkBoolOpt false "Whether or not to manage fonts.";
fonts = mkOpt (listOf package) [ ] "Custom font packages to install.";
};
config = mkIf cfg.enable {
environment.variables = {
# Enable icons in tooling since we have nerdfonts.
LOG_ICONS = "true";
};
fonts.fontDir.enable = true;
fonts.fonts = with pkgs;
[
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji
(nerdfonts.override { fonts = [ "Hack" ]; })
] ++ cfg.fonts;
};
}

View file

@ -0,0 +1,40 @@
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
let cfg = config.custom.system.locale;
in
{
options.custom.system.locale = with types; {
enable = mkBoolOpt false "Whether or not to manage locale settings.";
layout = mkOpt str "de" "The Keyboard layout to use.";
};
config = mkIf cfg.enable {
i18n = {
defaultLocale = "en_NZ.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
LC_CTYPE = "de_DE.UTF-8";
LC_COLLATE = "de_DE.UTF-8";
LC_MESSAGES = "en_NZ.UTF-8";
};
};
console = {
enable = true;
keyMap = mkForce cfg.layout;
};
services.xserver = {
layout = cfg.layout;
};
};
}

View file

@ -0,0 +1,25 @@
{ options, config, pkgs, lib, ... }:
with lib;
#with lib.internal;
let cfg = config.custom.system.xdg;
in
{
options.custom.system.xdg = with types; {
enable = mkBoolOpt false "Whether or not to enable xdg.";
};
config = mkIf cfg.enable {
xdg = {
sounds.enable = true;
mime.enable = true;
menus.enable = true;
icons.enable = true;
autostart.enable = true;
portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal ];
};
};
};
}