mirror of
https://github.com/Jokiller230/puzzlevision.git
synced 2025-09-10 04:40:05 +00:00
✨ Add tons of missing system, desktop and home modules
This commit is contained in:
parent
01367c4222
commit
fa3bbb2f6f
15 changed files with 453 additions and 7 deletions
24
modules/nixos/archetypes/laptop/default.nix
Normal file
24
modules/nixos/archetypes/laptop/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.archetypes.laptop;
|
||||
in {
|
||||
options.${namespace}.archetypes.laptop = {
|
||||
enable = mkEnableOption "the laptop archetype.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
${namespace} = {
|
||||
# Inherit from workstation archetype
|
||||
archetypes.workstation.enable = true;
|
||||
};
|
||||
|
||||
hardware.sensor.iio.enable = true; # Enable iio-sensor for automatic screen rotation and similar features.
|
||||
};
|
||||
}
|
|
@ -16,9 +16,20 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
${namespace} = {
|
||||
# Basic system functionality
|
||||
system.grub.enable = true;
|
||||
system.networking.enable = true;
|
||||
system.kernel.enable = true;
|
||||
system = {
|
||||
networking.enable = true;
|
||||
grub.enable = true;
|
||||
shell.enable = true;
|
||||
locale.enable = true;
|
||||
fonts.enable = true;
|
||||
bluetooth.enable = true;
|
||||
audio.enable = true;
|
||||
kernel.enable = true;
|
||||
nix = {
|
||||
enable = true;
|
||||
use-lix = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Services
|
||||
services.docker.enable = true;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
|
@ -17,5 +18,29 @@ in {
|
|||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
gnome-tour
|
||||
gedit
|
||||
cheese
|
||||
geary
|
||||
yelp # Help view
|
||||
epiphany # Gnome web
|
||||
gnome-console
|
||||
gnome-terminal
|
||||
gnome-music
|
||||
hitori # Sudoku game
|
||||
gnome-contacts
|
||||
gnome-initial-setup
|
||||
gnome-system-monitor
|
||||
];
|
||||
|
||||
programs.dconf.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnome-tweaks
|
||||
resources
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
27
modules/nixos/system/audio/default.nix
Normal file
27
modules/nixos/system/audio/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.audio;
|
||||
in {
|
||||
options.${namespace}.system.audio = {
|
||||
enable = mkEnableOption "system audio support.";
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
36
modules/nixos/system/bluetooth/default.nix
Normal file
36
modules/nixos/system/bluetooth/default.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.bluetooth;
|
||||
in {
|
||||
options.${namespace}.system.bluetooth = {
|
||||
enable = mkEnableOption "bluetooth support.";
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
28
modules/nixos/system/fonts/default.nix
Normal file
28
modules/nixos/system/fonts/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkOption;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.fonts;
|
||||
in {
|
||||
options.${namespace}.system.fonts = with lib.types; {
|
||||
enable = mkEnableOption "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.systemPackages = with pkgs; [font-manager];
|
||||
|
||||
fonts.packages = cfg.fonts;
|
||||
};
|
||||
}
|
58
modules/nixos/system/locale/default.nix
Normal file
58
modules/nixos/system/locale/default.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkOption;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.locale;
|
||||
in {
|
||||
options.${namespace}.system.locale = {
|
||||
enable = mkEnableOption "system locale tweaks.";
|
||||
|
||||
language = mkOption {
|
||||
type = lib.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 = lib.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 = lib.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;
|
||||
};
|
||||
};
|
||||
}
|
50
modules/nixos/system/nix/default.nix
Normal file
50
modules/nixos/system/nix/default.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.system.nix;
|
||||
in {
|
||||
options.${namespace}.system.nix = {
|
||||
enable = mkEnableOption "Nix configuration overrides.";
|
||||
use-lix = mkEnableOption "Lix as an alternative to CppNix.";
|
||||
use-nixld = mkEnableOption "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";
|
||||
};
|
||||
|
||||
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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
25
modules/nixos/system/shell/default.nix
Normal file
25
modules/nixos/system/shell/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf types;
|
||||
inherit (self) namespace;
|
||||
inherit (self.lib) mkOpt;
|
||||
|
||||
cfg = config.${namespace}.system.shell;
|
||||
in {
|
||||
options.${namespace}.system.shell = {
|
||||
enable = mkEnableOption "custom user shells.";
|
||||
installed = mkOpt types.listOf types.package [pkgs.fish] "List of shell packages to install";
|
||||
default = mkOpt types.str "fish" "Set a custom shell as the default for all users.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.shells = cfg.installed;
|
||||
users.defaultUserShell = pkgs.${cfg.shell.type};
|
||||
programs.${cfg.shell.type}.enable = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue