Add darwin configuration into

This commit is contained in:
Laurent Gueret
2026-02-11 13:15:26 +01:00
parent 80e5d0b8b5
commit e75b09a750
71 changed files with 562 additions and 151 deletions
+35
View File
@@ -0,0 +1,35 @@
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.os.gnome.apps;
in
{
options.os.gnome.apps = {
enable = mkEnableOption "System gnome apps service";
};
config = mkIf cfg.enable {
environment = {
systemPackages =
with pkgs;
[
# Gnome media apps
papers
celluloid
resources
]
++ [
# Gnome files explorer
nautilus
];
};
services.gvfs.enable = true; # SMB, FTP, ... access
};
}
+49
View File
@@ -0,0 +1,49 @@
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.os.gnome.shell;
in
{
options.os.gnome.shell = {
enable = mkEnableOption "System gnome shell service";
};
config = mkIf cfg.enable {
services.displayManager.gdm.enable = true;
services.desktopManager.gnome.enable = true;
services.gnome.games.enable = false;
services.gnome.core-apps.enable = false;
services.gnome.core-developer-tools.enable = false;
environment = {
gnome.excludePackages = with pkgs; [
gnome-tour
gnome-user-docs
];
systemPackages = with pkgs; [
# Gnome terminal
ghostty
# Gnome icons
papirus-icon-theme
# Gnome Extensions
gnomeExtensions.vitals
gnomeExtensions.paperwm
gnomeExtensions.app-hider
gnomeExtensions.dash-to-panel
];
};
};
}
@@ -0,0 +1,18 @@
{ lib, config, ... }:
with lib;
let
cfg = config.os.virtualisation.docker;
in
{
options.os.virtualisation.docker = {
enable = mkEnableOption "System docker service";
};
config = mkIf cfg.enable {
virtualisation.docker = {
enable = true;
daemon.settings.features.cdi = true;
};
};
}
@@ -0,0 +1,35 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.os.virtualisation.podman;
in
{
options.os.virtualisation.podman = {
enable = mkEnableOption "System docker service";
};
config = mkIf cfg.enable {
virtualisation = {
containers.enable = true;
podman = {
enable = true;
dockerCompat = true;
dockerSocket.enable = true;
defaultNetwork.settings.dns_enabled = true; # Required for containers under podman-compose to be able to talk to each other.
};
};
environment = {
systemPackages = with pkgs; [
pods
podman-compose
];
};
};
}
+23
View File
@@ -0,0 +1,23 @@
{ lib, config, ... }:
with lib;
let
cfg = config.os.boot.plymouth;
in
{
options.os.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.os.boot.systemd;
in
{
options.os.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";
};
}
+36
View File
@@ -0,0 +1,36 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.os.virtualisation.cuda;
in
{
options.os.virtualisation.cuda = {
enable = mkEnableOption "System CUDA service";
};
config = mkIf cfg.enable {
hardware.nvidia-container-toolkit.enable = true;
environment.systemPackages = with pkgs.cudaPackages; [
cudatoolkit
cudnn
libcublas
libcufile
libcusparse
nccl
];
environment.variables = {
CUDA_PATH = "${pkgs.cudatoolkit}";
LD_LIBRARY_PATH = "${pkgs.linuxPackages.nvidia_x11}/lib:$LD_LIBRARY_PATH";
EXTRA_LDFLAGS = "-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib";
EXTRA_CCFLAGS = "-I/usr/include";
};
};
}
+24
View File
@@ -0,0 +1,24 @@
{ lib, config, ... }:
with lib;
let
cfg = config.os.graphics.nvidia;
in
{
options.os.graphics.nvidia = {
enable = mkEnableOption "System nvidia service";
};
config = mkIf cfg.enable {
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;
};
};
}
+25
View File
@@ -0,0 +1,25 @@
{ lib, config, ... }:
with lib;
let
cfg = config.os.keyboard.apple;
in
{
options.os.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";
};
};
}
+21
View File
@@ -0,0 +1,21 @@
{ lib, config, ... }:
with lib;
let
cfg = config.os.networks.dns;
in
{
options.os.networks.dns = {
enable = mkEnableOption "System dns service";
};
config = mkIf cfg.enable {
services.resolved.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
};
}
+15
View File
@@ -0,0 +1,15 @@
{ lib, config, ... }:
with lib;
let
cfg = config.os.networks.manager;
in
{
options.os.networks.manager = {
enable = mkEnableOption "System networks manager service";
};
config = mkIf cfg.enable {
networking.networkmanager.enable = true;
};
}
+26
View File
@@ -0,0 +1,26 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.os.networks.printing;
in
{
options.os.networks.printing = {
enable = mkEnableOption "System printing service";
};
config = mkIf cfg.enable {
services.printing = {
enable = true;
drivers = with pkgs; [
cups-filters
cups-browsed
];
};
};
}
+30
View File
@@ -0,0 +1,30 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.os.networks.samba;
in
{
options.os.networks.samba = {
enable = mkEnableOption "System pipewire service";
};
config = mkIf cfg.enable {
services.samba = {
enable = true;
openFirewall = true;
usershares.enable = true;
package = pkgs.samba4Full;
};
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
};
}
+23
View File
@@ -0,0 +1,23 @@
{ lib, config, ... }:
with lib;
let
cfg = config.os.audio.pipewire;
in
{
options.os.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;
};
};
}