From 717a65f00c0c812590a98e0b5f3fb419819763a4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 7 Jul 2023 23:08:26 +0300 Subject: [PATCH] oh my god --- hosts/sakotop/configuration.nix | 42 ++++++++++++++++++++++++++++- modules/default.nix | 7 ----- modules/desktop/bspwm.nix | 30 --------------------- modules/desktop/kitty.nix | 20 -------------- modules/desktop/web/qutebrowser.nix | 31 --------------------- modules/dev/README.md | 14 ---------- modules/dev/cpp.nix | 15 ----------- modules/dev/default.nix | 6 ----- modules/hardware/default.nix | 6 ----- modules/hardware/nvidia/default.nix | 30 --------------------- 10 files changed, 41 insertions(+), 160 deletions(-) delete mode 100644 modules/desktop/bspwm.nix delete mode 100644 modules/desktop/kitty.nix delete mode 100644 modules/desktop/web/qutebrowser.nix delete mode 100644 modules/dev/README.md delete mode 100644 modules/dev/cpp.nix delete mode 100644 modules/dev/default.nix delete mode 100644 modules/hardware/default.nix delete mode 100644 modules/hardware/nvidia/default.nix diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index 3f8ac078..afdc6c51 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -8,7 +8,6 @@ ./hardware-configuration.nix inputs.home-manager.nixosModules.home-manager # TODO(sako):: make this better - ../../modules ]; # grub (mount efi partition to /boot/efi) @@ -74,6 +73,32 @@ driSupport32Bit = true; }; + # tell xserver i want this driver + services.xserver.videoDrivers = ["nvidia"]; + + hardware.nvidia = { + # wayland support cause why not + modesetting.enable = true; + + # TODO(sako):: add this as a cfg option for hosts + open = false; + + # settings + nvidiaSettings = true; + + # Package + package = config.boot.kernelPackages.nvidiaPackages.stable; + + prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + }; + # packages that are unfree because they want to or need to #nixpkgs.config.allowUnfreePredicate = pkg: # builtins.elem (lib.getName pkg) [ @@ -157,6 +182,21 @@ ]; }; +# mpd + services.mpd = { + enable = true; + # pipewire fix + user = "sako"; + musicDirectory = "/home/sako/music"; + extraConfig = builtins.readFile ../../config/mpd/mpd.conf; + startWhenNeeded = true; + }; + + # systemd fix pipewire + systemd.services.mpd.environment = { + XDG_RUNTIME_DIR = "/run/user/1000"; + }; + # TODO(sako):: make overlays in different folder nixpkgs.overlays = [ (final: prev: { qutebrowser = prev.qutebrowser.override { enableWideVine = true; }; }) diff --git a/modules/default.nix b/modules/default.nix index 8cc120ce..e69de29b 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,7 +0,0 @@ -{ config, pkgs, lib, ...}: -{ - imports = [ - ./media/mpd - ./hardware - ]; -} diff --git a/modules/desktop/bspwm.nix b/modules/desktop/bspwm.nix deleted file mode 100644 index 4f5e015c..00000000 --- a/modules/desktop/bspwm.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ options, config, lib, pkgs, ...}: -with lib; -let cfg = config.modules.desktop.bspwm; -in { - options.modules.desktop.bspwm = { - enable = mkBoolOpt false; - }; - - config = mkIf cfg.enable { - services.xserver = { - enable = true; - windowManager.bspwm.enable = true; - layout = "us"; - }; - xdg.configFile = { - bspwm = { - source = ../../../config/bspwm; - }; - sxhkd = { - source = ../../../config/sxhkd; - }; - }; - users.users.sako.packages = with pkgs; [ - rofi - (polybar.override { - pulseSupport = true; - }) - ]; - }; -} diff --git a/modules/desktop/kitty.nix b/modules/desktop/kitty.nix deleted file mode 100644 index 5cc26915..00000000 --- a/modules/desktop/kitty.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ options, config, lib, pkgs, ...}: -with lib; -let cfg = config.modules.desktop.kitty; -in { - options.modules.desktop.kitty = { - enable = mkBoolOpt false; - }; - - config = mkIf cfg.enable { - users.users.sako.packages = with pkgs; [ - kitty - ]; - fonts.fonts = with pkgs; [ - jetbrains-mono - (nerdfonts.override { fonts = [ - "JetBrainsMono" - ];}) - ]; - }; -} diff --git a/modules/desktop/web/qutebrowser.nix b/modules/desktop/web/qutebrowser.nix deleted file mode 100644 index 443b1d63..00000000 --- a/modules/desktop/web/qutebrowser.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ options, config, lib, pkgs, ...}: -with lib; -let cfg = config.modules.web.qutebrowser; -in { - options.modules.web.qutebrowser = { - enable = mkBoolOpt false; - }; - - config = mkIf cfg.enable { - users.users.sako = { - packages = with pkgs; [ - qutebrowser-qt6 - python310Packages.pynacl - python310Packages.adblock - ]; - }; - - nixpkgs.overlays = [ - (final: prev: { qutebrowser = prev.qutebrowser.override { enableWideVine = true; }; }) - ]; - xdg.configFile = { - "qutebrowser/config.py" = { - source = ../../../config/qutebrowser/config.py; - }; - "qutebrowser/greasemonkey" = { - source = ../../../config/qutebrowser/greasemonkey; - recursive = true; - }; - }; - }; -} diff --git a/modules/dev/README.md b/modules/dev/README.md deleted file mode 100644 index 5e2f0bab..00000000 --- a/modules/dev/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# What is this for? - -Because bloatware sucks and nix sometimes leaves alot of garbage, I decided to make each project a -seperate nix file. - -# How do I use this? - -- copy project-template.nix -- add package dependencies to it - - when you dont maintain that project anymore you can delete the file and rebuild - -# Add language? - -- just make a nix file and add that yeah diff --git a/modules/dev/cpp.nix b/modules/dev/cpp.nix deleted file mode 100644 index 3505c38e..00000000 --- a/modules/dev/cpp.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, lib, pkgs, ...}: -with lib; -let cfg = config.modules.dev.cpp; -in { - options.modules.dev.cpp = { - enable = mkBoolOpt false; - }; - - config = mkIf cfg.enable { - users.users.sako.packages = with pkgs; [ - cmake - gcc - ]; - }; -} diff --git a/modules/dev/default.nix b/modules/dev/default.nix deleted file mode 100644 index 6b4561e9..00000000 --- a/modules/dev/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, pkgs, lib, ...}: -{ - imports = [ - ./cpp.nix - ]; -} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix deleted file mode 100644 index da5304eb..00000000 --- a/modules/hardware/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, pkgs, lib, ...}: -{ - imports = [ - ./nvidia - ]; -} diff --git a/modules/hardware/nvidia/default.nix b/modules/hardware/nvidia/default.nix deleted file mode 100644 index f8b0561b..00000000 --- a/modules/hardware/nvidia/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ config, pkgs, lib, ...}: -{ - - # tell xserver i want this driver - services.xserver.videoDrivers = ["nvidia"]; - - hardware.nvidia = { - # wayland support cause why not - modesetting.enable = true; - - # TODO(sako):: add this as a cfg option for hosts - open = false; - - # settings - nvidiaSettings = true; - - # Package - package = config.boot.kernelPackages.nvidiaPackages.stable; - - prime = { - offload = { - enable = true; - enableOffloadCmd = true; - }; - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - }; - -}