modularized into machine
This commit is contained in:
9
modules/machine/cloud/README.md
Normal file
9
modules/machine/cloud/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Machine specific configuration - cloud
|
||||
|
||||
Designed and developed by Wyatt J. Miller, 2024
|
||||
|
||||
Licensed by the Mozilla Public License v2
|
||||
|
||||
## Synopsis
|
||||
|
||||
This directory is where the machine-specific configuration files for hostname `cloud` live, my primary desktop. These files get called by the root `flake.nix` file.
|
204
modules/machine/cloud/configuration.nix
Normal file
204
modules/machine/cloud/configuration.nix
Normal file
@ -0,0 +1,204 @@
|
||||
{
|
||||
pkgs,
|
||||
userName,
|
||||
...
|
||||
}: {
|
||||
# Enable flakes for NixOS
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
# Utilize systemd-boot
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Install and enable common graphics drivers
|
||||
hardware.opengl = {
|
||||
# driSupport = true;
|
||||
extraPackages = with pkgs; [
|
||||
mesa
|
||||
libvdpau-va-gl
|
||||
libva
|
||||
libva-utils
|
||||
intel-vaapi-driver # for Intel
|
||||
intel-media-driver # for Intel
|
||||
rocm-opencl-icd # for AMD
|
||||
];
|
||||
};
|
||||
|
||||
# For systems with AMD graphics, this enables Vulkan on 32-bit applications
|
||||
# For 64-bit application, however, Vulkan is enabled by default
|
||||
# hardware.graphics.driSupport32Bit = true;
|
||||
|
||||
# For systems with AMD graphics, enable AMDVLK
|
||||
#hardware.graphics = {
|
||||
# extraPackages = with pkgs; [
|
||||
# amdvlk
|
||||
# ];
|
||||
# extraPackages32 = with pkgs; [
|
||||
# driversi686Linux
|
||||
# ];
|
||||
#};
|
||||
|
||||
# Enable Bluetooth if present
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
# Set your timezone
|
||||
time.timeZone = "America/Detroit";
|
||||
|
||||
# Enable Pipewire (sound)
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# Enable touchpad
|
||||
services.libinput.enable = true;
|
||||
|
||||
# Install packages to be installed system-wide
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
neovim
|
||||
git
|
||||
wireguard-tools
|
||||
podman
|
||||
buildah
|
||||
podman-tui
|
||||
podman-compose
|
||||
podman-desktop
|
||||
toolbox
|
||||
grim
|
||||
slurp
|
||||
playerctl
|
||||
light
|
||||
brightnessctl
|
||||
firefox
|
||||
wttrbar
|
||||
cliphist
|
||||
xivlauncher
|
||||
patchelf
|
||||
];
|
||||
|
||||
# Install system-wide fonts
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-emoji
|
||||
liberation_ttf
|
||||
monaspace
|
||||
nerdfonts
|
||||
];
|
||||
|
||||
# Set the EDITOR global environment variable to neovim
|
||||
environment.variables.EDITOR = "nvim";
|
||||
|
||||
# Enable OpenSSH
|
||||
services.openssh.enable = true;
|
||||
|
||||
# Enable keyring
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
# Enable GnuPG
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
# Enable SUID wrappers (some programs need them)
|
||||
programs.mtr.enable = true;
|
||||
|
||||
# Enable Polkit
|
||||
security.polkit.enable = true;
|
||||
|
||||
# Enable power management
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
powertop.enable = false; # TODO: to be enabled on laptops
|
||||
cpuFreqGovernor = "performace";
|
||||
};
|
||||
|
||||
# Enable Steam and open various firewall ports when applicable
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
};
|
||||
|
||||
# Enable gamemode (gamemode, gamemoded, gamemoderun) when needed
|
||||
programs.gamemode.enable = true;
|
||||
|
||||
# Enable gamescope (compositor) when needed
|
||||
programs.gamescope.enable = true;
|
||||
|
||||
# Add username to groups "wheel" and "video" - more may be added here later
|
||||
users.users.${userName}.extraGroups = ["wheel" "video" "gamemode" "podman" "network"];
|
||||
|
||||
# XDG stuff
|
||||
xdg = {
|
||||
portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
config = {
|
||||
common = {
|
||||
default = [
|
||||
"wlr"
|
||||
];
|
||||
};
|
||||
};
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# environment.
|
||||
|
||||
# Firewall stuff not allowed in common user and network creation
|
||||
networking.firewall.enable = true; # VERY important, do not touch
|
||||
# networking.firewall.allowedTCPPorts = [];
|
||||
# networking.firewall.allowedUDPPorts = [];
|
||||
networking.networkmanager.enable = true; # Linux tool for managing network connections
|
||||
|
||||
# Enable Flatpak (app containerization)
|
||||
# services.flatpak.enable = true;
|
||||
services.flatpak = {
|
||||
enable = true;
|
||||
remotes = [
|
||||
{
|
||||
name = "flathub";
|
||||
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
|
||||
}
|
||||
];
|
||||
packages = [
|
||||
"com.github.tchx84.Flatseal"
|
||||
"com.slack.Slack"
|
||||
"info.beyondallreason.bar"
|
||||
"io.dbeaver.DBeaverCommunity"
|
||||
"io.openrct2.OpenRCT2"
|
||||
"md.obsidian.Obsidian"
|
||||
"org.prismlauncher.PrismLauncher"
|
||||
"sh.cider.Cider"
|
||||
];
|
||||
update = {
|
||||
auto = {
|
||||
enable = true;
|
||||
onCalendar = "weekly";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Enable Podman (OCI containers)
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerSocket.enable = true;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
|
||||
services.shairport-sync = {
|
||||
enable = pkgs.stdenv.isLinux;
|
||||
openFirewall = pkgs.stdenv.isLinux;
|
||||
arguments = "-v -o pw";
|
||||
};
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
45
modules/machine/cloud/hardware-configuration.nix
Normal file
45
modules/machine/cloud/hardware-configuration.nix
Normal file
@ -0,0 +1,45 @@
|
||||
# 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 = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/COMPUTER";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/BOOT";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0022" "dmask=0022"];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-label/SWAP";}
|
||||
];
|
||||
|
||||
# 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.enp9s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp8s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
Reference in New Issue
Block a user