Base of Nix Configuration
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{
|
||||
boot = import ./services/boot.nix;
|
||||
graphics = import ./services/graphics.nix;
|
||||
networks = import ./services/networks.nix;
|
||||
audio = import ./services/audio.nix;
|
||||
keyboard = import ./services/keyboard.nix;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
pipewire = import ../submodules/pipewire.nix;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
systemd = import ../submodules/systemd-boot.nix;
|
||||
plymouth = import ../submodules/plymouth.nix;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
nvidia = {
|
||||
base = import ../submodules/nvidia.nix;
|
||||
prime = import ../submodules/nvidia-prime.nix;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
apple = import ../submodules/keyboard-apple.nix;
|
||||
}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
dns = import ../submodules/dns.nix;
|
||||
manager = import ../submodules/manager.nix;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.within.networks.dns;
|
||||
in
|
||||
{
|
||||
options.within.networks.dns = {
|
||||
enable = mkEnableOption "System dns service";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.resolved.enable = true;
|
||||
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.within.keyboard.apple;
|
||||
in
|
||||
{
|
||||
options.within.keyboard.apple = {
|
||||
enable = mkEnableOption "System apple locales service";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "fr_BE.UTF-8";
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "mac-fr";
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver.xkb = {
|
||||
model = "macintosh";
|
||||
layout = "fr";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.within.networks.manager;
|
||||
in
|
||||
{
|
||||
options.within.networks.manager = {
|
||||
enable = mkEnableOption "System networks manager service";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.within.graphics.nvidia.prime;
|
||||
in
|
||||
{
|
||||
options.within.graphics.nvidia.prime = {
|
||||
enable = mkEnableOption "System nvidia prime service";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.xserver.videoDrivers = [
|
||||
"modesetting"
|
||||
"nvidia"
|
||||
];
|
||||
|
||||
hardware.powerManagement.finegrained = true;
|
||||
hardware.prime = {
|
||||
offload.enable = true;
|
||||
intelBusId = "PCI:0@0:2:0";
|
||||
nvidiaBusId = "PCI:1@0:0:0";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.within.graphics.nvidia;
|
||||
in
|
||||
{
|
||||
options.within.graphics.nvidia = {
|
||||
enable = mkEnableOption "System nvidia service";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate =
|
||||
pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"nvidia-x11"
|
||||
];
|
||||
|
||||
services.xserver.enable = true;
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.graphics.enable = true;
|
||||
hardware.nvidia = {
|
||||
open = true;
|
||||
nvidiaSettings = false;
|
||||
modesetting.enable = true; # Wayland requirements
|
||||
powerManagement.enable = true;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.within.audio.pipewire;
|
||||
in
|
||||
{
|
||||
options.within.audio.pipewire = {
|
||||
enable = mkEnableOption "System pipewire service";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
security.rtkit.enable = true;
|
||||
services.pulseaudio.enable = false;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.within.boot.plymouth;
|
||||
in
|
||||
{
|
||||
options.within.boot.plymouth = {
|
||||
enable = mkEnableOption "Boot plymouth service";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
boot.consoleLogLevel = 3;
|
||||
boot.initrd.verbose = false;
|
||||
boot.kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"boot.shell_on_fail"
|
||||
];
|
||||
|
||||
boot.plymouth.enable = true;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.within.boot.systemd;
|
||||
in
|
||||
{
|
||||
options.within.boot.systemd = {
|
||||
enable = mkEnableOption "Boot systemd service";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.systemd-boot.consoleMode = "max";
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user