chore: initial commit

This commit is contained in:
Glen Goodwin 2023-06-06 23:58:36 -04:00
commit cc4f3398ff
37 changed files with 2210 additions and 0 deletions

119
hosts/configuration.nix Normal file
View file

@ -0,0 +1,119 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports = (import ../modules/editors) ++
(import ../modules/shell);
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
};
# Define a user account. Don't forget to set a password with passwd.
users.users.glen = {
isNormalUser = true;
description = "Glen";
extraGroups = [ "networkmanager" "wheel" "video" "docker" ];
shell = pkgs.zsh; # Default shell
packages = with pkgs; [ ];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = 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
# neovim
# kitty
# ];
environment = {
variables = {
TERMINAL = "kitty";
EDITOR = "nvim";
VISUAL = "nvim";
};
systemPackages = with pkgs; [
# Default packages installed system-wide
vim
git
killall
nano
pciutils
usbutils
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;
# };
programs.hyprland.enable = true;
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.pipewire = {
# Sound
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
nix = {
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
};
}

37
hosts/default.nix Normal file
View file

@ -0,0 +1,37 @@
{ lib, inputs, system, home-manager, user, hyprland, ... }:
{
thinkpad = lib.nixosSystem {
inherit system;
specialArgs = {
inherit user inputs hyprland system;
host = {
hostName = "thinkpad";
mainMonitor = "eDP-1";
# secondMonitor = "DP-1";
};
};
modules = [
./thinkpad
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; };
home-manager.users.${user} = {
imports = [ (import ./home.nix) ] ++ [ (import ./thinkpad/home.nix) ];
};
}
];
};
}

153
hosts/home.nix Normal file
View file

@ -0,0 +1,153 @@
{ config, lib, pkgs, stable, user, ... }:
{
imports = # Home Manager Modules
[ (import ../modules/shell/git/home.nix) ] ++
[ (import ../modules/programs/wofi.nix) ] ++
[ (import ../modules/editors/nvim/home.nix) ] ++
[ (import ../modules/shell/zsh/home.nix) ];
home = {
username = "${user}";
homeDirectory = "/home/${user}";
packages = with pkgs; [
# Terminal
btop # Resource Manager
nitch # Minimal fetch
tldr # Helper
zellij # multiplexer
dog # dns tool
exa # better ls
bat # better cap
sd # simpler sed
fd # simpler find
xh
ncdu
duf
atuin
xplr
thefuck
hyperfine
procs
ripgrep
nerdfonts
pfetch
dbeaver
ansible
nixpkgs-fmt
# Video/Audio
feh # Image Viewer
#mpv # Media Player
pavucontrol # Audio Control
#plex-media-player # Media Player
vlc # Media Player
stremio # Media Streamer
# Apps
appimage-run # Runs AppImages on NixOS
firefox # Browser
google-chrome # Browser
remmina # XRDP & VNC Client
# File Management
gnome.file-roller # Archive Manager
okular # PDF Viewer
#pcmanfm # File Manager
xfce.thunar # File Manager
p7zip # Zip Encryption
rsync # Syncer - $ rsync -r dir1/ dir2/
unzip # Zip Files
unrar # Rar Files
zip # Zip
# General configuration
#git # Repositories
#killall # Stop Applications
#nano # Text Editor
#pciutils # Computer Utility Info
#pipewire # Sound
#usbutils # USB Utility Info
#wacomtablet # Wacom Tablet
#wget # Downloader
#zsh # Shell
#
# General home-manager
#alacritty # Terminal Emulator
#dunst # Notifications
#doom emacs # Text Editor
#libnotify # Dependency for Dunst
#neovim # Text Editor
#rofi # Menu
#rofi-power-menu # Power Menu
#udiskie # Auto Mounting
#vim # Text Editor
#
# Xorg configuration
#xclip # Console Clipboard
#xorg.xev # Input Viewer
#xorg.xkill # Kill Applications
#xorg.xrandr # Screen Settings
#xterm # Terminal
#
# Xorg home-manager
#flameshot # Screenshot
#picom # Compositer
#sxhkd # Shortcuts
#
# Wayland configuration
#autotiling # Tiling Script
#grim # Image Grabber
#slurp # Region Selector
#swappy # Screenshot Editor
#swayidle # Idle Management Daemon
#wev # Input Viewer
#wl-clipboard # Console Clipboard
#wlr-randr # Screen Settings
#xwayland # X for Wayland
#
# Wayland home-manager
#mpvpaper # Video Wallpaper
#pamixer # Pulse Audio Mixer
swaybg # Background
#swaylock-fancy # Screen Locker
#waybar # Bar
#
# Desktop
#ansible # Automation
#blueman # Bluetooth
#deluge # Torrents
discord # Chat
#ffmpeg # Video Support (dslr)
#gmtp # Mount MTP (GoPro)
#gphoto2 # Digital Photography
#handbrake # Encoder
#heroic # Game Launcher
#hugo # Static Website Builder
#lutris # Game Launcher
#mkvtoolnix # Matroska Tool
#plex-media-player# Media Player
#prismlauncher # MC Launcher
#steam # Games
#simple-scan # Scanning
#sshpass # Ansible dependency
#
# Laptop
#cbatticon # Battery Notifications
#blueman # Bluetooth
#light # Display Brightness
#libreoffice # Office Tools
#simple-scan # Scanning
#
# Flatpak
#obs-studio # Recording/Live Streaming
];
stateVersion = "22.05";
};
programs = {
home-manager.enable = true;
};
}

View file

@ -0,0 +1,41 @@
{ config, pkgs, user, ... }:
{
imports = # For now, if applying to other system, swap files
[ (import ./hardware-configuration.nix) ] ++ # Current system hardware config @ /etc/nixos/hardware-configuration.nix
(import ../../modules/desktop/virtualisation/default.nix) ++
(import ../../modules/hardware/default.nix) ++
[ (import ../../modules/desktop/hyprland/default.nix) ]; # Window Manager
hardware.sane = {
# Used for scanning with Xsane
enable = true;
extraBackends = [ pkgs.sane-airscan ];
};
environment = {
systemPackages = with pkgs; [
simple-scan
];
};
programs = {
# No xbacklight, this is the alterantive
dconf.enable = true;
light.enable = true;
};
services = {
tlp.enable = true; # TLP and auto-cpufreq for power management
#logind.lidSwitch = "ignore"; # Laptop does not go to sleep when lid is closed
auto-cpufreq.enable = true;
blueman.enable = true;
};
#temporary bluetooth fix
systemd.tmpfiles.rules = [
"d /var/lib/bluetooth 700 root root - -"
];
systemd.targets."bluetooth".after = [ "systemd-tmpfiles-setup.service" ];
}

View file

@ -0,0 +1,43 @@
# 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" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/88ae54e9-a47f-4ef0-acae-256803662304";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-9d4b251f-b7d5-4a28-8e5d-6df09b434e47".device = "/dev/disk/by-uuid/9d4b251f-b7d5-4a28-8e5d-6df09b434e47";
fileSystems."/boot/efi" =
{
device = "/dev/disk/by-uuid/C3A8-F13F";
fsType = "vfat";
};
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.enp2s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

40
hosts/thinkpad/home.nix Normal file
View file

@ -0,0 +1,40 @@
{ pkgs, ... }:
{
imports =
[
../../modules/shell/git/home.nix
../../modules/desktop/hyprland/home.nix
];
home = {
# Specific packages for laptop
packages = with pkgs; [
# Applications
libreoffice # Office packages
# Display
#light # xorg.xbacklight not supported. Other option is just use xrandr.
# Power Management
#auto-cpufreq # Power management
#tlp # Power management
];
};
# programs = {
# alacritty.settings.font.size = 11;
# };
services = {
# Applets
blueman-applet.enable = true; # Bluetooth
network-manager-applet.enable = true; # Network
# cbatticon = {
# enable = true;
# criticalLevelPercent = 10;
# lowLevelPercent = 20;
# iconType = null;
# };
};
}