added nixos configuration and home mananger stuff

This commit is contained in:
2024-09-07 22:22:12 -04:00
parent cfa75cb28a
commit e0daf1276c
14 changed files with 605 additions and 53 deletions

View File

@ -1,7 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
system = {
# activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`.
activationScripts.postUserActivation.text = ''
@ -11,29 +8,29 @@
'';
defaults = {
menuExtraClock.Show24Hour = true; # show 24 hour clock
# customize dock
# dock = {
# autohide = true;
# show-recents = false; # disable recent apps
menuExtraClock.Show24Hour = true; # show 24 hour clock
# # 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 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
# };
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 = {
@ -56,9 +53,9 @@
# # 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)
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
@ -72,7 +69,7 @@
# # 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 = {
@ -133,19 +130,19 @@
# 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`
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
# # 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;
# };
# # swap left command and left alt
# # so it matches common keyboard layout: `ctrl | command | alt`
# #
# # disabled, caused only problems!
# swapLeftCommandAndLeftAlt = false;
};
};
# Add ability to used TouchID for sudo authentication

View File

@ -1,27 +1,30 @@
{
lib,
pkgs,
userName,
hostname,
...
} @ args:
#############################################################
#
# Host & Users configuration
#
#############################################################
{
} @ args: {
# Set up networking configuration
networking.hostName = hostname;
networking.computerName = hostname;
networking.firewall.enable = true; # VERY important, do not touch
# networking.firewall.allowedTCPPorts = [];
# networking.firewall.allowedUDPPorts = [];
networking.networkmanager.enable = pkgs.stdenv.isLinux; # Linux tool for managing network connections
system.defaults.smb.NetBIOSName = hostname;
# Define a user account. Don't forget to set a password with passwd.
# Set up user accounts
# Don't forget to set a password with passwd!
users.users."${userName}" = {
home =
if pkgs.stdenv.isDarwin
then "/Users/${userName}"
else "/home/${userName}";
description = userName;
extraGroups =
if pkgs.stdenv.isLinux
then ["wheel" "video"]
else [];
};
nix.settings.trusted-users = [userName];

View File

@ -0,0 +1,117 @@
{
inputs,
config,
lib,
pkgs,
...
}: {
# Bring in the hardware configuration
imports = [
/etc/nixos/hardware-configuration.nix
];
# 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_drivers
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.hardware = {
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
toolbox
];
# 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 = true;
};
}