modularized into machine

This commit is contained in:
2024-10-30 22:41:37 -04:00
parent 33876f6bc9
commit fbaa38c1a5
11 changed files with 85 additions and 9 deletions

View 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.

View 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";
}

View 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;
}

View File

@ -0,0 +1,9 @@
# Machine specific configuration - ixion
Designed and developed by Wyatt J. Miller, 2024
Licensed by the Mozilla Public License v2
## Synopsis
This directory is currently empty so, currently, there's nothing to see! However, this is where the machine-specific configuration files for hostname `ixion` live, my storage, status, game, and media server. These files get called by the root `flake.nix` file.

View File

@ -0,0 +1,9 @@
# Machine specific configuration - sephiroth
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 `sephiroth` live, my primary laptop. These files get called by the root `flake.nix` file.

View File

@ -0,0 +1,40 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
neovim
git
];
environment.variables.EDITOR = "nvim";
homebrew = {
enable = true;
onActivation = {
autoUpdate = false;
# 'zap': uninstalls all formulae(and related files) not listed here.
cleanup = "zap";
};
# Applications to install from Mac App Store using mas.
# You need to install all these Apps manually first so that your apple account have records for them.
# otherwise Apple Store will refuse to install them.
# For details, see https://github.com/mas-cli/mas
masApps = {
Xcode = 497799835;
"Reeder 5." = 1529448980;
Wireguard = 1451685025;
Bitwarden = 1352778147;
"AdGuard for Safari" = 1440147259;
};
taps = [
];
brews = [
];
casks = [
];
};
}

View File

@ -0,0 +1,170 @@
{pkgs, hostname, ...}: {
system = {
# activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`.
activationScripts.postUserActivation.text = ''
# activateSettings -u will reload the settings from the database and apply them to the current session,
# so we do not need to logout and login again to make the changes take effect.
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
'';
defaults = {
menuExtraClock.Show24Hour = true; # show 24 hour clock
# customize dock
dock = {
autohide = true;
# show-recents = false; # disable recent apps
# # customize Hot Corners
# wvous-tl-corner = 2; # top-left - Mission Control
# wvous-tr-corner = 13; # top-right - Lock Screen
# wvous-bl-corner = 3; # bottom-left - Application Windows
# wvous-br-corner = 4; # bottom-right - Desktop
};
# # customize finder
finder = {
_FXShowPosixPathInTitle = true; # show full path in finder title
AppleShowAllExtensions = true; # show all file extensions
FXEnableExtensionChangeWarning = false; # disable warning when changing file extension
QuitMenuItem = true; # enable quit menu item
ShowPathbar = true; # show path bar
ShowStatusBar = true; # show status bar
};
# # customize trackpad
# trackpad = {
# Clicking = true; # enable tap to click
# TrackpadRightClick = true; # enable two finger right click
# TrackpadThreeFingerDrag = true; # enable three finger drag
# };
# # customize settings that not supported by nix-darwin directly
# # Incomplete list of macOS `defaults` commands :
# # https://github.com/yannbertrand/macos-defaults
# NSGlobalDomain = {
# # `defaults read NSGlobalDomain "xxx"`
# "com.apple.swipescrolldirection" = true; # enable natural scrolling(default to true)
# "com.apple.sound.beep.feedback" = 0; # disable beep sound when pressing volume up/down key
# AppleInterfaceStyle = "Dark"; # dark mode
# AppleKeyboardUIMode = 3; # Mode 3 enables full keyboard control.
# ApplePressAndHoldEnabled = true; # enable press and hold
# # If you press and hold certain keyboard keys when in a text area, the keys character begins to repeat.
# # This is very useful for vim users, they use `hjkl` to move cursor.
# # sets how long it takes before it starts repeating.
# InitialKeyRepeat = 15; # normal minimum is 15 (225 ms), maximum is 120 (1800 ms)
# # sets how fast it repeats once it starts.
# KeyRepeat = 3; # normal minimum is 2 (30 ms), maximum is 120 (1800 ms)
# NSAutomaticCapitalizationEnabled = false; # disable auto capitalization
# NSAutomaticDashSubstitutionEnabled = false; # disable auto dash substitution
# NSAutomaticPeriodSubstitutionEnabled = false; # disable auto period substitution
# NSAutomaticQuoteSubstitutionEnabled = false; # disable auto quote substitution
# NSAutomaticSpellingCorrectionEnabled = false; # disable auto spelling correction
# NSNavPanelExpandedStateForSaveMode = true; # expand save panel by default
# NSNavPanelExpandedStateForSaveMode2 = true;
# };
# # Customize settings that not supported by nix-darwin directly
# # see the source code of this project to get more undocumented options:
# # https://github.com/rgcr/m-cli
# #
# # All custom entries can be found by running `defaults read` command.
# # or `defaults read xxx` to read a specific domain.
# CustomUserPreferences = {
# ".GlobalPreferences" = {
# # automatically switch to a new space when switching to the application
# AppleSpacesSwitchOnActivate = true;
# };
# NSGlobalDomain = {
# # Add a context menu item for showing the Web Inspector in web views
# WebKitDeveloperExtras = true;
# };
# "com.apple.finder" = {
# ShowExternalHardDrivesOnDesktop = true;
# ShowHardDrivesOnDesktop = true;
# ShowMountedServersOnDesktop = true;
# ShowRemovableMediaOnDesktop = true;
# _FXSortFoldersFirst = true;
# # When performing a search, search the current folder by default
# FXDefaultSearchScope = "SCcf";
# };
# "com.apple.desktopservices" = {
# # Avoid creating .DS_Store files on network or USB volumes
# DSDontWriteNetworkStores = true;
# DSDontWriteUSBStores = true;
# };
# "com.apple.spaces" = {
# "spans-displays" = 0; # Display have seperate spaces
# };
# "com.apple.WindowManager" = {
# EnableStandardClickToShowDesktop = 0; # Click wallpaper to reveal desktop
# StandardHideDesktopIcons = 0; # Show items on desktop
# HideDesktop = 0; # Do not hide items on desktop & stage manager
# StageManagerHideWidgets = 0;
# StandardHideWidgets = 0;
# };
# "com.apple.screensaver" = {
# # Require password immediately after sleep or screen saver begins
# askForPassword = 1;
# askForPasswordDelay = 0;
# };
# "com.apple.screencapture" = {
# location = "~/Desktop";
# type = "png";
# };
# "com.apple.AdLib" = {
# allowApplePersonalizedAdvertising = false;
# };
# # Prevent Photos from opening automatically when devices are plugged in
# "com.apple.ImageCapture".disableHotPlug = true;
# };
# loginwindow = {
# GuestEnabled = false; # disable guest user
# SHOWFULLNAME = true; # show full name in login window
# };
};
# keyboard settings is not very useful on macOS
# the most important thing is to remap option key to alt key globally,
# but it's not supported by macOS yet.
# keyboard = {
# enableKeyMapping = true; # enable key mapping so that we can use `option` as `control`
# # NOTE: do NOT support remap capslock to both control and escape at the same time
# remapCapsLockToControl = false; # remap caps lock to control, useful for emac users
# remapCapsLockToEscape = true; # remap caps lock to escape, useful for vim users
# # swap left command and left alt
# # so it matches common keyboard layout: `ctrl | command | alt`
# #
# # disabled, caused only problems!
# swapLeftCommandAndLeftAlt = false;
# };
};
networking.hostName = hostname;
networking.computerName = hostname;
networking.firewall.enable = true; # VERY important, do not touch
networking.firewall.allowedTCPPorts = [];
networking.firewall.allowedUDPPorts = [];
system.defaults.smb.NetBIOSName = hostname;
# Add ability to used TouchID for sudo authentication
security.pam.enableSudoTouchIdAuth = true;
# Create /etc/zshrc that loads the nix-darwin environment.
# this is required if you want to use darwin's default shell - zsh
programs.zsh.enable = true;
environment.shells = [
pkgs.zsh
pkgs.fish
pkgs.bash
];
# Set your time zone.
time.timeZone = "America/Detroit";
}

View File

@ -0,0 +1,9 @@
# Machine specific configuration - valefor
Designed and developed by Wyatt J. Miller, 2024
Licensed by the Mozilla Public License v2
## Synopsis
This directory is currently empty so, currently, there's nothing to see! However, this is where the machine-specific configuration files for hostname `valefor` live, my apartment appliance server. These files get called by the root `flake.nix` file.