diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index b9ab6fe..5ba98c6 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -1,118 +1,29 @@ -{ config, inputs, pkgs, ... }: - +{ pkgs, ... }: { - imports = - [ - ./hardware-configuration.nix - inputs.home-manager.nixosModules.default - ../../modules/nixos/nvidia.nix - ../../modules/nixos/bspwm.nix - ../../modules/nixos/cups.nix - ]; + imports = [ + ./hardware-configuration.nix + ../../modules/nixos/nvidia.nix + ../../modules/nixos/common.nix + ../../modules/nixos/bspwm.nix + ../../modules/nixos/audio.nix + ../../modules/nixos/shell.nix + ../../modules/nixos/dev.nix + ../../modules/nixos/storage.nix + ../../modules/nixos/gaming.nix + ../../modules/nixos/apps.nix + ../../modules/nixos/portals.nix + ../../modules/nixos/cups.nix + ]; - # nixpkgs.overlays = [ - # (import ./ghidra-m32r-overlay.nix) - # ]; + networking.hostName = "nixos"; + home-manager.users.chris = import ./home.nix; - # Extra Nix Settings - nix.settings = { - auto-optimise-store = true; - experimental-features = [ "nix-command" "flakes" ]; - }; + users.users.chris.extraGroups = [ "dialout" "storage" ]; - programs.nix-ld.enable = true; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "nixos"; - networking.networkmanager.enable = true; - time.timeZone = "America/Chicago"; - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - - # Enable sound with pipewire. - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - # Enable Direnv - programs.direnv.enable = true; - - # User Account - users.users.chris = { - isNormalUser = true; - description = "chris"; - extraGroups = [ "networkmanager" "wheel" "dialout" "storage" ]; - shell = pkgs.zsh; - packages = with pkgs; [ - telegram-desktop - discord - ungoogled-chromium - inkscape - obsidian - sourcegit - obs-studio - r2modman - signal-desktop - kdePackages.dolphin - flameshot - vscodium - nautilus - onlyoffice-desktopeditors - vlc - orca-slicer - blender - grayjay - vlc - kdePackages.kdenlive - kicad - # ghidra - ]; - }; - - home-manager = { - useUserPackages = true; - extraSpecialArgs = { inherit inputs; }; - users."chris" = import ./home.nix; - }; - - - # services.freenet = { - # enable = true; - # }; - - # Garbage Collection - nix.gc = { - automatic = true; - dates = "weekly"; - persistent = true; - options = ""; - }; + environment.systemPackages = with pkgs; []; + # Aliases + programs.zsh.shellAliases.ssh-server = "ssh braincell@192.168.1.3"; # Mount the data drive fileSystems."/data" = { @@ -121,113 +32,36 @@ options = [ "nofail" ]; }; - # ZSH - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestions.enable = true; - syntaxHighlighting.enable = true; - interactiveShellInit = '' - fastfetch - ''; - - shellAliases = { - ll = "ls -l"; - edit = "hx ~/dotfiles"; - update = "sh ~/dotfiles/rebuild.sh"; - ssh-server = "ssh braincell@192.168.1.3"; - calc = "kalker"; - n = "nvim ."; - # ssh-pihole = "ssh bell@192.168.1.23"; - }; - - histSize = 10000; - histFile = "$HOME/.zsh_history"; - setOptions = [ - "HIST_IGNORE_ALL_DUPS" - ]; - - oh-my-zsh = { - enable = true; - theme = "clean"; - plugins = ["git" "sudo" "direnv"]; - }; - }; - - # Steam - programs.steam.enable = true; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # System Packages - environment.systemPackages = with pkgs; [ - vim - wget - git - file - helix - lazygit - nixd - fastfetch - disktui - busybox - kalker - nmap - screen - btop - udiskie - ]; - - # extra filesystems - boot.supportedFilesystems = { - exfat = true; - ntfs = true; - }; - - - # Enable Virtualization - virtualisation.libvirtd.enable = true; - programs.virt-manager.enable = true; - virtualisation.podman = { - enable = true; - dockerCompat = true; - }; - - # Enable Flatpacks - services.flatpak.enable = true; - - # Xdg portal - xdg.portal = { - enable = true; - extraPortals = [pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gnome]; - # config.common.default = ""; - }; - - # OpenSSH - services.openssh.enable = true; - - # UDisks (for auto mounting) - services.udisks2 = { - enable = true; - }; - - services.gvfs.enable = true; - - systemd.user.services.udiskie = { - description = "udiskie automount daemon"; - wantedBy = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; - serviceConfig = { - ExecStart = "${pkgs.udiskie}/bin/udiskie --automount --notify --tray"; - Restart = "always"; - }; - }; - - - # Firewall + # Firewall stuff networking.firewall.allowedTCPPorts = [ 9999 ]; networking.firewall.allowedUDPPorts = [ 9999 ]; - - system.stateVersion = "25.11"; # Did you read the comment? DONT TOUCH :) + + # Enable Pipewire && + # Disocrd OBS virtual mic audio sync + services.pipewire = { + enable = true; + pulse.enable = true; + extraConfig.pipewire."99-obs-virtual-mic" = { + "context.modules" = [ + { + name = "libpipewire-module-loopback"; + args = { + "node.description" = "OBS Virtual Mic"; + "capture.props" = { + "node.name" = "obs_capture"; + "media.class" = "Audio/Sink"; + "audio.position" = [ "FL" "FR" ]; + }; + "playback.props" = { + "node.name" = "obs_mic"; + "media.class" = "Audio/Source"; + "audio.position" = [ "FL" "FR" ]; + }; + }; + } + ]; + }; +}; + + system.stateVersion = "25.11"; # don't change } diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index f7fee8c..5c4d53e 100644 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -15,6 +15,8 @@ ../../modules/home-manager/bspwm.nix ../../modules/home-manager/polybar.nix ../../modules/home-manager/browsers/zen.nix + ../../modules/home-manager/picom.nix + ../../modules/home-manager/syncplay.nix # ../../modules/home-manager/editors/helix.nix ]; @@ -27,13 +29,13 @@ my.bspwm.monitors = [ { name = "DP-0"; - xrandr = "--primary --auto --pos 1080x0"; - desktops = [ "1" "2" "3" "4" "5" "6" ]; + xrandr = "--primary --mode 2560x1440 --pos 1080x0"; + desktops = [ "4" "5" "6" "7" "8" "9" ]; } { name = "DP-2"; xrandr = "--auto --rotate left --pos 0x0"; - desktops = [ "7" "8" "9" ]; + desktops = [ "1" "2" "3" ]; } ]; diff --git a/hosts/p50/configuration.nix b/hosts/p50/configuration.nix index 1a0ff9f..8a47b62 100644 --- a/hosts/p50/configuration.nix +++ b/hosts/p50/configuration.nix @@ -1,88 +1,29 @@ -{ config, pkgs, inputs, ... }: +{ pkgs, ... }: { - imports = - [ - ./hardware-configuration.nix - inputs.home-manager.nixosModules.default - ../../modules/nixos/bspwm.nix - ../../modules/nixos/quadro-m1000m.nix - ]; - - # Nix options - nix.settings = { - experimental-features = ["nix-command" "flakes"]; - }; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # Use latest kernel. - boot.kernelPackages = pkgs.linuxPackages_latest; - - networking.hostName = "p50"; # Define your hostname. - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "America/Chicago"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users."chris" = { - isNormalUser = true; - description = "chris"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; []; - }; - - - home-manager = { - useUserPackages = true; - extraSpecialArgs = { inherit inputs; }; - users."chris" = import ./home.nix; - }; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - environment.systemPackages = with pkgs; [ - vim - wget - helix - nixd - git - fastfetch - btop + imports = [ + ./hardware-configuration.nix + ../../modules/nixos/quadro-m1000m.nix + ../../modules/nixos/common.nix + ../../modules/nixos/gnome.nix + ../../modules/nixos/audio.nix + ../../modules/nixos/shell.nix + ../../modules/nixos/dev.nix + ../../modules/nixos/storage.nix + ../../modules/nixos/apps.nix + ../../modules/nixos/portals.nix + ../../modules/nixos/cups.nix ]; - # Enable the OpenSSH daemon. - services.openssh.enable = true; + networking.hostName = "p50"; + home-manager.users.chris = import ./home.nix; - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - system.stateVersion = "26.05"; # Did you read the comment? + boot.kernelPackages = pkgs.linuxPackages_latest; + users.users.chris.extraGroups = [ "dialout" "storage" ]; + + # Aliases + programs.zsh.shellAliases.ssh-server = "ssh braincell@192.168.1.3"; + + system.stateVersion = "26.05"; # don't change } diff --git a/hosts/p50/home.nix b/hosts/p50/home.nix index 6917cbd..6e78d91 100644 --- a/hosts/p50/home.nix +++ b/hosts/p50/home.nix @@ -8,17 +8,19 @@ imports = [ ../../modules/home-manager/defaults.nix - ../../modules/home-manager/sxhkd.nix + # ../../modules/home-manager/bspwm.nix + # ../../modules/home-manager/wallpaper.nix + # ../../modules/home-manager/polybar.nix + # ../../modules/home-manager/sxhkd.nix ../../modules/home-manager/terminals/alacritty.nix + ../../modules/home-manager/browsers/zen.nix ../../modules/home-manager/browsers/ugc.nix - ../../modules/home-manager/bspwm.nix - ../../modules/home-manager/polybar.nix # ../../modules/home-manager/editors/helix.nix ]; my.defaults = { terminal = "alacritty"; editor = "hx"; - browser = "chromium"; + browser = "zen"; }; } diff --git a/modules/home-manager/bspwm.nix b/modules/home-manager/bspwm.nix index c70f8c8..1601100 100644 --- a/modules/home-manager/bspwm.nix +++ b/modules/home-manager/bspwm.nix @@ -52,6 +52,9 @@ in # Wallpapers [ -x ~/.config/wallpaper/set.sh ] && ~/.config/wallpaper/set.sh + + # Picom + ${pkgs.procps}/bin/pgrep -x picom >/dev/null || ${pkgs.picom}/bin/picom -b --config $HOME/.config/picom/picom.conf ''; }; diff --git a/modules/home-manager/picom.nix b/modules/home-manager/picom.nix new file mode 100644 index 0000000..98714ea --- /dev/null +++ b/modules/home-manager/picom.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: + +{ + home.packages = [ pkgs.picom ]; + + xdg.configFile."picom/picom.conf".text = '' + backend = "glx"; + vsync = true; + + unredir-if-possible = false; + + shadow = false; + fade-in-step = 1; + fade-out-step = 1; + ''; +} diff --git a/modules/home-manager/sxhkd.nix b/modules/home-manager/sxhkd.nix index d0b30ed..22e6549 100644 --- a/modules/home-manager/sxhkd.nix +++ b/modules/home-manager/sxhkd.nix @@ -39,6 +39,13 @@ bspc node -t "~fullscreen" super + shift + f bspc node -t "~floating" + + # screenshots + Print + scrot 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/screenshots && mv $f ~/screenshots && xclip -selection clipboard -t image/png -i ~/screenshots/`ls -1 -t ~/screenshots | head -1`' + + super + shift + s + scrot -s 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/screenshots && mv $f ~/screenshots && xclip -selection clipboard -t image/png -i ~/screenshots/`ls -1 -t ~/screenshots | head -1`' ''; home.activation.reloadSxhkd = lib.hm.dag.entryAfter [ "linkGeneration" ] '' diff --git a/modules/home-manager/syncplay.nix b/modules/home-manager/syncplay.nix new file mode 100644 index 0000000..215c7e3 --- /dev/null +++ b/modules/home-manager/syncplay.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + home.packages = [ + pkgs.syncplay + pkgs.mpv + ]; +} diff --git a/modules/home-manager/terminals/alacritty.nix b/modules/home-manager/terminals/alacritty.nix index 64f9c8d..e7ae838 100644 --- a/modules/home-manager/terminals/alacritty.nix +++ b/modules/home-manager/terminals/alacritty.nix @@ -5,7 +5,7 @@ enable = true; settings = { font.size = 11; - window.opacity = 0.95; + window.opacity = 0.85; }; }; } diff --git a/modules/nixos/apps.nix b/modules/nixos/apps.nix new file mode 100644 index 0000000..e35671a --- /dev/null +++ b/modules/nixos/apps.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +{ + users.users.chris.packages = with pkgs; [ + telegram-desktop discord inkscape obsidian obs-studio + r2modman signal-desktop flameshot vscodium spotify + nautilus onlyoffice-desktopeditors vlc orca-slicer blender grayjay + kdePackages.kdenlive gimp nextcloud-client + ]; +} diff --git a/modules/nixos/audio.nix b/modules/nixos/audio.nix new file mode 100644 index 0000000..021af23 --- /dev/null +++ b/modules/nixos/audio.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} \ No newline at end of file diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix new file mode 100644 index 0000000..0471f96 --- /dev/null +++ b/modules/nixos/common.nix @@ -0,0 +1,52 @@ +{ pkgs, inputs, ... }: +{ + imports = [ inputs.home-manager.nixosModules.default ]; + + nix.settings = { + auto-optimise-store = true; + experimental-features = [ "nix-command" "flakes" ]; + }; + nix.gc = { + automatic = true; + dates = "weekly"; + persistent = true; + options = ""; + }; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.networkmanager.enable = true; + time.timeZone = "America/Chicago"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + services.xserver.xkb = { layout = "us"; variant = ""; }; + + users.users.chris = { + isNormalUser = true; + description = "chris"; + extraGroups = [ "networkmanager" "wheel" ]; + }; + + home-manager = { + useUserPackages = true; + extraSpecialArgs = { inherit inputs; }; + }; + + nixpkgs.config.allowUnfree = true; + services.openssh.enable = true; + + environment.systemPackages = with pkgs; [ + vim wget git helix nixd nixfmt btop fastfetch lazygit file disktui busybox nmap screen scrot xclip + ]; +} diff --git a/modules/nixos/dev.nix b/modules/nixos/dev.nix new file mode 100644 index 0000000..23cbf84 --- /dev/null +++ b/modules/nixos/dev.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + programs.nix-ld.enable = true; + + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; + virtualisation.podman = { + enable = true; + dockerCompat = true; + }; +} \ No newline at end of file diff --git a/modules/nixos/gaming.nix b/modules/nixos/gaming.nix new file mode 100644 index 0000000..ceaf5f6 --- /dev/null +++ b/modules/nixos/gaming.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + programs.steam.enable = true; + + users.users.chris.packages = with pkgs; [ + # lutris + ]; +} diff --git a/modules/nixos/gnome.nix b/modules/nixos/gnome.nix new file mode 100644 index 0000000..d35215b --- /dev/null +++ b/modules/nixos/gnome.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; + + # To disable installing GNOME's suite of applications + # and only be left with GNOME shell. + # services.gnome.core-apps.enable = false; + services.gnome.core-developer-tools.enable = false; + services.gnome.games.enable = false; + environment.gnome.excludePackages = with pkgs; [ gnome-tour gnome-user-docs ]; + +} diff --git a/modules/nixos/portals.nix b/modules/nixos/portals.nix new file mode 100644 index 0000000..d367358 --- /dev/null +++ b/modules/nixos/portals.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + services.flatpak.enable = true; + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gnome ]; + }; +} \ No newline at end of file diff --git a/modules/nixos/shell.nix b/modules/nixos/shell.nix new file mode 100644 index 0000000..a88ff2f --- /dev/null +++ b/modules/nixos/shell.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +{ + programs.direnv.enable = true; + users.users.chris.shell = pkgs.zsh; + + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestions.enable = true; + syntaxHighlighting.enable = true; + interactiveShellInit = "fastfetch"; + shellAliases = { + ll = "ls -l"; + calc = "kalker"; + n = "nvim ."; + }; + histSize = 10000; + histFile = "$HOME/.zsh_history"; + setOptions = [ "HIST_IGNORE_ALL_DUPS" ]; + oh-my-zsh = { + enable = true; + theme = "clean"; + plugins = [ "git" "sudo" "direnv" ]; + }; + }; + + environment.systemPackages = [ pkgs.kalker ]; +} \ No newline at end of file diff --git a/modules/nixos/storage.nix b/modules/nixos/storage.nix new file mode 100644 index 0000000..268746d --- /dev/null +++ b/modules/nixos/storage.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: +{ + boot.supportedFilesystems = { exfat = true; ntfs = true; }; + services.udisks2.enable = true; + services.gvfs.enable = true; + + environment.systemPackages = [ pkgs.udiskie ]; + systemd.user.services.udiskie = { + description = "udiskie automount daemon"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${pkgs.udiskie}/bin/udiskie --automount --notify --tray"; + Restart = "always"; + }; + }; +} \ No newline at end of file