added nixos configuration and home mananger stuff

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

234
defaults/sway/config Normal file
View File

@ -0,0 +1,234 @@
### Variables
# Logo key
set $mod Mod4
# Direction keys
set $left h
set $down j
set $up k
set $right l
# Alacritty
set $term alacritty
# Menu (rofi)
set $rofi_cmd rofi -terminal '$term'
set $menu $rofi_cmd -show combi -combi-modes drun#run -modes combi
### Output configuration
output DP-3 pos 3840 0 res 1920x1080@59Hz
output HDMI-A-1 pos 0 0 res 1920x1080@59Hz
output DP-2 pos 1920 0 res 1920x1080@60Hz
### Wallpaper
output HDMI-A-1 bg ~/.wallpaper/.wallpaper.png fill
output DP-2 bg ~/.wallpaper/.wallpaper.png fill
output DP-3 bg ~/.wallpaper/.wallpaper.png fill
### Workspace binding
## DP-3 bindings
workspace 1 output DP-2
workspace 2 output DP-2
## HDMI-A-1 bindings
workspace 3 output HDMI-A-1
## DP-2 bindings
workspace 6 output DP-3
workspace 7 output DP-3
### Colour options
set $bg #24283b
set $bg-inactive #323232
set $bg-urgent #000000
set $text #eeeeec
set $text-inactive #babdb6
set $bar #323232
set $statusline #e0e0e0
client.focused $bg $bg $text $bg $bg
client.unfocused $bg-inactive $bg-inactive $text-inactive $bar $bar
client.focused_inactive $bg-inactive $bg-inactive $text-inactive $bar $bar
client.urgent $bg-urgent $bg-urgent $text $bar $bar
### Idle configuration
# exec swayidle -w \
# timeout 600 'swaylock -f -i /home/wyatt/.wallpaper_lock.jpeg' \
# timeout 1200 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000'
# Workspaces
set $workspace_www 1
set $workspace_editor 2
set $workspace_terminals 3
set $workspace_documents 4
set $workspace_multimedia 5
# Gaps
floating_modifier $mod normal
### Key bindings
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+Shift+q kill
# Start your launcher
bindsym $mod+d exec $menu
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
### Navigation
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
### Workspaces
# Switch to workspace
bindsym $mod+1 workspace $workspace_www
bindsym $mod+2 workspace $workspace_editor
bindsym $mod+3 workspace $workspace_terminals
bindsym $mod+4 workspace $workspace_documents
bindsym $mod+5 workspace $workspace_multimedia
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $workspace_www
bindsym $mod+Shift+2 move container to workspace $workspace_editor
bindsym $mod+Shift+3 move container to workspace $workspace_terminals
bindsym $mod+Shift+4 move container to workspace $workspace_documents
bindsym $mod+Shift+5 move container to workspace $workspace_multimedia
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
### Layout
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
### Taking screenshots
# Take a screenshot of all monitors
bindsym Print exec grim -t jpeg ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg
# Take a screenshot of a given selection
bindsym $mod+Print exec grim -t jpeg -g "$(slurp)" ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpeg
### Resizing containers
mode "resize" {
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
### Audio and brightness keybinds
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86MonBrightnessUp exec light -A 5
bindsym XF86MonBrightnessDown exec light -U 5
### Lock the screen so my brother
### won't dick with my computer
bindsym $mod+Ctrl+l 'swaylock -f -i /home/wyatt/.wallpaper_lock.jpeg'
### Status Bar:
bar {
swaybar_command waybar
}
### Font settings:
font pango:FiraCode: 14px
### Window formatting
default_border none
default_border pixel 2
gaps inner 10px
# Applications
exec_always /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
exec mako
#exec swww init
#exec bash /home/wyatt/.wallpaper/wallpaper.sh /home/wyatt/.wallpaper
set $opacity 1.00
for_window [class=".*"] opacity $opacity
for_window [app_id=".*"] opacity $opacity
# Disable locking when conditions are met
for_window [class="streaming_client"] inhibit_idle fullscreen
for_window [app_id="firefox"] inhibit_idle fullscreen
for_window [app_id="neovide"] inhibit_idle fullscreen
for_window [title="Beyond All Reason"] inhibit_idle fullscreen
include /etc/sway/config.d/*

64
defaults/waybar/config Normal file
View File

@ -0,0 +1,64 @@
{
"layer": "top",
"modules-left": ["sway/workspaces"],
"modules-center": ["clock"],
"modules-right": ["custom/playerctl", "custom/weather", "pulseaudio", "network", "tray"],
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{name}: {icon}",
"format-icons": {
"1":"",
"2":"",
"3":"",
"4":"",
"5":"",
"6":"",
"urgent": "",
"focused": "",
"default": ""
}
},
"sway/window": {
"max-length": 50,
"tooltip": false
},
"clock": {
"format-alt": "{:%m-%d-%Y}",
"tooltip": false
},
"custom/weather": {
"format": "{} °",
"tooltip": true,
"interval": 3600,
"exec": "wttrbar --fahrenheit --main-indicator 'temp_F' --location 'Grand Rapids'",
"return-type": "json"
},
"network": {
"format-wifi": " {essid} ({signalStrength}%)",
"format-ethernet": " {ipaddr}",
"format-disconnected": "⚠ Disconnected",
"interval": 5,
"tooltip": false
},
"pulseaudio": {
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}%",
"format-muted": "",
"format-icons": {
"headphones": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"tooltip": false
},
"custom/playerctl": {
"format": "♬ {}",
"max-length": 40,
"interval": 5,
"exec": "playerctl metadata --format '{{ artist }} - {{ title }}'",
"tooltip": false
},
}

74
defaults/waybar/style.css Normal file
View File

@ -0,0 +1,74 @@
* {
border: none;
border-radius: 0;
font-family: "Monaspace Krypton";
font-size: 13px;
min-height: 0;
}
window#waybar {
background: #1f2335;
border-bottom: 1px solid #24283b;
color: #c0caf5;
opacity: 0.808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808;
}
#workspaces button {
padding: 5px;
padding-left: 12px;
padding-right: 12px;
background: transparent;
color: #c0caf5;
border-bottom: 1px solid transparent;
}
#workspaces button.focused {
background: #c0caf5;
color: #1d2021;
border-bottom: 1px solid #c0caf5;
}
#cpu,
#memory,
#pulseaudio,
#network,
#battery,
#clock,
#custom-playerctl {
padding: 0 10px;
margin: 0 5px;
}
#battery.charging {
color: #9ece6a;
}
#battery.warning:not(.charging) {
color: #ff9e64;
}
@keyframes blink {
to {
background-color: #1d2021;
color: #ebdbb2;
}
}
#battery.critical:not(.charging) {
background: #f7768e;
color: #ebdbb2;
border-bottom: 1px solid #ebdbb2;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#network.disconnected {
color: #cc241d;
}
#pulseaudio.muted {
color: #cc241d;
}

View File

@ -33,11 +33,10 @@
inherit userName userEmail;
hostname = "sephiroth";
};
# nixpkgs = inputs.nixpkgs-darwin;
modules = [
./modules/nix-core.nix
./modules/darwinSystem.nix
./modules/apps.nix
./modules/darwin/configuration.nix
./modules/darwin/apps.nix
./modules/host-users.nix
home-manager.darwinModules.home-manager
@ -60,7 +59,7 @@
modules = [
/etc/nixos/configuration.nix
./modules/nix-core.nix
# ./modules/linuxSystem.nix
./modules/nixos/configuration.nix
./modules/host-users.nix
home-manager.nixosModules.home-manager

View File

@ -9,6 +9,8 @@
p7zip
# utils
zellij
tmux
bat
lazygit
bottom
@ -27,7 +29,6 @@
tree
gnutar
gnupg
tmux
nerdfonts
zoxide
babelfish

View File

@ -13,6 +13,8 @@
./eza.nix
./neovim.nix
./direnv.nix
./sway.nix
./terminal.nix
];
# Home Manager needs a bit of information about you and the

10
home/hyprland.nix Normal file
View File

@ -0,0 +1,10 @@
{pkgs, ...}: {
wayland.windowManager.hyprland = {
enable = false; # TODO: to enable later
plugins = with pkgs; [
hyprtrails
hy3
];
xwayland = false; # TODO: to enable later
};
}

41
home/sway.nix Normal file
View File

@ -0,0 +1,41 @@
{pkgs, ...}: let
dirs = {
defaults = ../../defaults;
};
in {
wayland.windowManager.sway = {
enable = pkgs.stdenv.isLinux;
extraOptions = []; # Extra arguments to pass into sway. If sway goes haywire, we might need something in here
xwayland = true;
systemd = true;
# Install packages that will be installed with sway
extraPackages = with pkgs; [
wl-clipboard
wofi
mako
wttrbar
light
brightnessctl
playerctl
grim
slurp
cliphist
];
wrapperFeatures = {
gtk = true;
};
};
xdg.configFile."sway/config".source = dirs.defaults + /sway/config;
programs.wofi.enable = pkgs.stdenv.isLinux;
programs.waybar = {
enable = pkgs.stdenv.isLinux;
systemd.enable = true;
};
xdg.configFile."waybar/config".source = dirs.defaults + /waybar/config.json;
xdg.configFile."waybar/style.css".source = dirs.defaults + /waybar/style.css;
}

10
home/terminal.nix Normal file
View File

@ -0,0 +1,10 @@
{pkgs, ...}: {
programs.alacritty = {
enable = pkgs.stdenv.isLinux;
settings = {}; # TODO: this will be filled in the future
};
programs.kitty = {
enable = false; # TODO: to enable later
}
}

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