diff --git a/config/files.nix b/config/files.nix deleted file mode 100644 index 8dfd696..0000000 --- a/config/files.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, config, ... }: - -{ - # Place Files Inside Home Directory - home.file.".config/zaney-stinger.mov".source = ./files/media/zaney-stinger.mov; - home.file.".emoji".source = ./files/emoji; - home.file.".base16-themes".source = ./files/base16-themes; - home.file.".face".source = ./files/face.jpg; - home.file.".local/share/fonts" = { - source = ./files/fonts; - recursive = true; - }; -} diff --git a/config/home/files.nix b/config/home/files.nix new file mode 100644 index 0000000..0231c83 --- /dev/null +++ b/config/home/files.nix @@ -0,0 +1,13 @@ +{ pkgs, config, ... }: + +{ + # Place Files Inside Home Directory + home.file.".config/zaney-stinger.mov".source = ../files/media/zaney-stinger.mov; + home.file.".emoji".source = ../files/emoji; + home.file.".base16-themes".source = ../files/base16-themes; + home.file.".face".source = ../files/face.jpg; + home.file.".local/share/fonts" = { + source = ../files/fonts; + recursive = true; + }; +} diff --git a/config/hyprland.nix b/config/home/hyprland.nix similarity index 99% rename from config/hyprland.nix rename to config/home/hyprland.nix index 8ee160a..a7a83ab 100644 --- a/config/hyprland.nix +++ b/config/home/hyprland.nix @@ -79,6 +79,7 @@ env = MOZ_ENABLE_WAYLAND, 1 #env = WLR_NO_HARDWARE_CURSORS,1 #env = WLR_RENDERER_ALLOW_SOFTWARE,1 +exec-once = $POLKIT_BIN exec-once = dbus-update-activation-environment --systemd --all exec-once = systemctl --user import-environment QT_QPA_PLATFORMTHEME WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = hyprctl setcursor Bibata-Modern-Ice 24 diff --git a/config/kitty.nix b/config/home/kitty.nix similarity index 100% rename from config/kitty.nix rename to config/home/kitty.nix diff --git a/config/neofetch.nix b/config/home/neofetch.nix similarity index 100% rename from config/neofetch.nix rename to config/home/neofetch.nix diff --git a/config/rofi.nix b/config/home/rofi.nix similarity index 100% rename from config/rofi.nix rename to config/home/rofi.nix diff --git a/config/swaylock.nix b/config/home/swaylock.nix similarity index 100% rename from config/swaylock.nix rename to config/home/swaylock.nix diff --git a/config/swaync.nix b/config/home/swaync.nix similarity index 100% rename from config/swaync.nix rename to config/home/swaync.nix diff --git a/config/vim.nix b/config/home/vim.nix similarity index 100% rename from config/vim.nix rename to config/home/vim.nix diff --git a/config/waybar.nix b/config/home/waybar.nix similarity index 100% rename from config/waybar.nix rename to config/home/waybar.nix diff --git a/config/system/amd-opengl.nix b/config/system/amd-opengl.nix new file mode 100644 index 0000000..dee3381 --- /dev/null +++ b/config/system/amd-opengl.nix @@ -0,0 +1,10 @@ +{ pkgs, config, lib, ... }: + +libmkIf (${deviceProfile} == "amd-desktop") { + # OpenGL + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; +} diff --git a/config/system/boot.nix b/config/system/boot.nix new file mode 100644 index 0000000..5766f74 --- /dev/null +++ b/config/system/boot.nix @@ -0,0 +1,11 @@ +{ pkgs, config, ... }: + +{ + # Bootloader + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # This is for OBS Virtual Cam Support - v4l2loopback setup + boot.kernelModules = [ "v4l2loopback" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; +} diff --git a/config/system/intel-opengl.nix b/config/system/intel-opengl.nix new file mode 100644 index 0000000..8505922 --- /dev/null +++ b/config/system/intel-opengl.nix @@ -0,0 +1,20 @@ +{ pkgs, config, lib, ... }: + +libmkIf (${deviceProfile} == "intel-laptop") { + nixpkgs.config.packageOverrides = pkgs: { + vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; + }; + + # OpenGL + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + ]; + driSupport = true; + driSupport32Bit = true; + }; +} diff --git a/config/system/programs.nix b/config/system/programs.nix new file mode 100644 index 0000000..a0fd608 --- /dev/null +++ b/config/system/programs.nix @@ -0,0 +1,7 @@ +{ pkgs, config, ... }: + +{ + # List System Programs + environment.systemPackages = with pkgs; [ + ]; +} diff --git a/workstation/configuration.nix b/default.nix similarity index 71% rename from workstation/configuration.nix rename to default.nix index 7247228..5d451c1 100644 --- a/workstation/configuration.nix +++ b/default.nix @@ -4,18 +4,13 @@ { imports = - [ # Include the results of the hardware scan - ./hardware-configuration.nix + [ + ./hardware.nix + ./config/system/boot.nix + ./config/system/intel-opengl.nix + ./config/system/amd-opengl.nix ]; - # Bootloader - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # This is for OBS Virtual Cam Support - v4l2loopback setup - boot.kernelModules = [ "v4l2loopback" ]; - boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; - # Enable networking networking.hostName = "${hostname}"; # Define your hostname networking.networkmanager.enable = true; @@ -49,16 +44,6 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - vim wget curl - ]; - - fonts.packages = with pkgs; [ - (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) - ]; - # Steam Configuration programs.steam = { enable = true; @@ -66,28 +51,11 @@ dedicatedServer.openFirewall = true; }; - # OpenGL - hardware.opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - programs.hyprland = { enable = true; package = inputs.hyprland.packages.${pkgs.system}.hyprland; }; - system.activationScripts = { - installwallpapers.text = '' - if [ -d "${wallpaperDir}" ]; then - cd "${wallpaperDir}" && ${pkgs.git}/bin/git pull - else - ${pkgs.git}/bin/git clone "${wallpaperGit}" "${wallpaperDir}" - fi - ''; - }; - # Some programs need SUID wrappers, can be configured further or are # started in user sessions. programs.mtr.enable = true; @@ -96,6 +64,10 @@ enableSSHSupport = true; }; + environment.variables = { + POLKIT_BIN = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + }; + # List services that you want to enable: services.openssh.enable = true; services.fstrim.enable = true; diff --git a/flake.nix b/flake.nix index aaf9a19..b10aaf7 100644 --- a/flake.nix +++ b/flake.nix @@ -20,50 +20,41 @@ gitEmail = "tylerzanekelley@gmail.com"; theLocale = "en_US.UTF-8"; theTimezone = "America/Chicago"; - theme = "grayscale-light"; + theme = "tokyo-night-storm"; browser = "firefox"; wallpaperGit = "https://gitlab.com/Zaney/my-wallpapers.git"; wallpaperDir = "/home/${username}/Pictures/Wallpapers"; - flakeDir = "/home/zaney/zaneyos"; + flakeDir = "/home/${username}/zaneyos"; + # Configuration option profile + # default options amd-desktop, intel-laptop, vm (WIP) + deviceProfile = "amd-desktop"; pkgs = import nixpkgs { inherit system; config = { - allowUnfree = true; + allowUnfree = true; }; }; in { nixosConfigurations = { - laptop = nixpkgs.lib.nixosSystem { - specialArgs = { inherit system; inherit inputs; - inherit username; inherit hostname; inherit gitUsername; - inherit gitEmail; inherit theLocale; inherit theTimezone; - }; - modules = [ ./laptop/configuration.nix - home-manager.nixosModules.home-manager { - home-manager.extraSpecialArgs = { inherit username; - inherit gitUsername; inherit gitEmail; inherit theme; - inherit browser; - inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme; - }; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.${username} = import ./home.nix; - } - ]; - }; - workstation = nixpkgs.lib.nixosSystem { - specialArgs = { inherit system; inherit inputs; - inherit username; inherit hostname; inherit gitUsername; - inherit gitEmail; inherit theLocale; inherit theTimezone; - inherit wallpaperDir; inherit wallpaperGit; + "${hostname}" = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit system; inherit inputs; + inherit username; inherit hostname; + inherit gitUsername; inherit theTimezone; + inherit gitEmail; inherit theLocale; + inherit wallpaperDir; inherit wallpaperGit; + inherit deviceProfile; }; - modules = [ ./workstation/configuration.nix + modules = [ ./default.nix home-manager.nixosModules.home-manager { home-manager.extraSpecialArgs = { inherit username; - inherit gitUsername; inherit gitEmail; inherit inputs; inherit theme; - inherit browser; inherit wallpaperDir; inherit wallpaperGit; inherit flakeDir; - inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme; + inherit gitUsername; inherit gitEmail; + inherit inputs; inherit theme; + inherit browser; inherit wallpaperDir; + inherit wallpaperGit; inherit flakeDir; + inherit deviceProfile; + inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme; }; home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; diff --git a/workstation/hardware-configuration.nix b/hardware.nix similarity index 100% rename from workstation/hardware-configuration.nix rename to hardware.nix diff --git a/home.nix b/home.nix index eacdf0f..4aeb882 100644 --- a/home.nix +++ b/home.nix @@ -15,15 +15,15 @@ # Import Program Configurations imports = [ inputs.nix-colors.homeManagerModules.default - ./config/waybar.nix - ./config/swaync.nix - ./config/swaylock.nix - ./config/neofetch.nix - ./config/hyprland.nix - ./config/kitty.nix - ./config/rofi.nix - ./config/vim.nix - ./config/files.nix + ./config/home/waybar.nix + ./config/home/swaync.nix + ./config/home/swaylock.nix + ./config/home/neofetch.nix + ./config/home/hyprland.nix + ./config/home/kitty.nix + ./config/home/rofi.nix + ./config/home/vim.nix + ./config/home/files.nix ]; # Define Settings For Xresources @@ -63,7 +63,8 @@ gimp obs-studio blender kdenlive meson hugo gnumake ninja go nodejs godot_4 rustup pavucontrol audacity zeroad xonotic openra font-awesome symbola noto-fonts-color-emoji material-icons - spotify brightnessctl swayidle + spotify brightnessctl swayidle wget curl + (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) # Import Scripts (import ./config/scripts/emopicker9000.nix { inherit pkgs; }) (import ./config/scripts/task-waybar.nix { inherit pkgs; }) @@ -125,7 +126,6 @@ }; }; - # Create XDG Dirs xdg = { userDirs = { @@ -148,8 +148,8 @@ }; shellAliases = { sv="sudo vim"; - flake-rebuild="sudo nixos-rebuild switch --flake ~/zaneyos/#workstation"; - laptop-rebuild="sudo nixos-rebuild switch --flake ~/zaneyos/#laptop"; + flake-rebuild="sudo nixos-rebuild switch --flake ${flakeDir}"; + laptop-rebuild="sudo nixos-rebuild switch --flake ${flakeDir}"; gcCleanup="nix-collect-garbage --delete-old && sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot"; v="vim"; ls="lsd"; diff --git a/laptop/configuration.nix b/laptop/configuration.nix deleted file mode 100644 index dd8ebc4..0000000 --- a/laptop/configuration.nix +++ /dev/null @@ -1,127 +0,0 @@ -# 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’). - -{ inputs, config, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.kernelModules = [ "v4l2loopback" ]; - boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; - - networking.hostName = "nixtop"; # 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"; - }; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.zaney = { - isNormalUser = true; - description = "Tyler Kelley"; - extraGroups = [ "networkmanager" "wheel" ]; - 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 wget curl - ]; - - fonts.packages = with pkgs; [ - (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) - ]; - - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - }; - - nixpkgs.config.packageOverrides = pkgs: { - vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; - }; - hardware.opengl = { - enable = true; - extraPackages = with pkgs; [ - intel-media-driver # LIBVA_DRIVER_NAME=iHD - vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) - vaapiVdpau - libvdpau-va-gl - ]; - driSupport = true; - driSupport32Bit = true; - }; - - programs.hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.system}.hyprland; - }; - - # 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; - }; - - # List services that you want to enable: - services.openssh.enable = true; - services.fstrim.enable = true; - services.xserver = { - layout = "us"; - xkbVariant = ""; - libinput.enable = true; - }; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - hardware.pulseaudio.enable = false; - sound.enable = true; - security.rtkit.enable = true; - - - system.stateVersion = "23.11"; - nix = { - settings.auto-optimise-store = true; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; -} diff --git a/laptop/hardware-configuration.nix b/laptop/hardware-configuration.nix deleted file mode 100644 index cce5fe1..0000000 --- a/laptop/hardware-configuration.nix +++ /dev/null @@ -1,47 +0,0 @@ -# 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 = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/8f47c564-523f-4eca-9644-69d2bed92f0a"; - fsType = "ext4"; - }; - - boot.initrd.luks.devices."luks-4f3ec042-9a98-4e10-84b3-3e081b030d6e".device = "/dev/disk/by-uuid/4f3ec042-9a98-4e10-84b3-3e081b030d6e"; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/3B15-2EB6"; - fsType = "vfat"; - }; - - fileSystems."/home" = - { device = "/dev/disk/by-uuid/cb501f9a-6814-477f-b8d5-1a8aaba243a9"; - fsType = "ext4"; - }; - - boot.initrd.luks.devices."luks-9b120c21-77b6-4291-bee0-185c5a1e3682".device = "/dev/disk/by-uuid/9b120c21-77b6-4291-bee0-185c5a1e3682"; - - 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp61s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp62s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -}