Machines: add initial support for iMac

This commit is contained in:
Toast 2024-09-11 14:11:37 +02:00
parent b442b1e5a9
commit b81cb471cc
4 changed files with 160 additions and 0 deletions

View file

@ -220,6 +220,9 @@
./roles/server
];
};
iMac.modules = [
./roles/desktop
];
};
};
}

View file

@ -0,0 +1,88 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{
config,
lib,
pkgs,
...
}: {
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
nixpkgs.config.allowUnfree = true;
networking.hostName = "iMac"; # Define your hostname.
# Set your time zone.
time.timeZone = "Europe/Madrid";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver.xkb.layout = "es";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
hardware.pulseaudio.enable = false;
# OR
# services.pipewire = {
# enable = true;
# pulse.enable = true;
# };
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
# environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
# ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
}

6
machines/iMac/default.nix Executable file
View file

@ -0,0 +1,6 @@
{...}: {
imports = [
./configuration.nix
./hardware-configuration.nix
];
}

View file

@ -0,0 +1,63 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel" "wl"];
boot.extraModulePackages = [config.boot.kernelPackages.broadcom_sta];
fileSystems."/" = {
device = "/dev/disk/by-uuid/6062dfe3-6e70-4f30-aa45-e81933f116fb";
fsType = "btrfs";
options = ["subvol=@" "compress=zstd"];
};
boot.initrd.luks.devices."SSD".device = "/dev/disk/by-uuid/482cd1b5-2a22-42f3-a497-4b4d7006d2e3";
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/6062dfe3-6e70-4f30-aa45-e81933f116fb";
fsType = "btrfs";
options = ["subvol=@nix" "compress=zstd"];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/6062dfe3-6e70-4f30-aa45-e81933f116fb";
fsType = "btrfs";
options = ["subvol=@home" "compress=zstd"];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/6062dfe3-6e70-4f30-aa45-e81933f116fb";
fsType = "btrfs";
options = ["subvol=@persist" "compress=zstd"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/0D30-3CEE";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0f0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}