From da25566c342a33db139f8ce084152529df58ed7a Mon Sep 17 00:00:00 2001 From: System administrator Date: Thu, 13 Jan 2022 16:13:25 +0000 Subject: [PATCH] Added nwggrid --- flake.lock | 62 +++++++-------- hosts/subsurface/default.nix | 4 +- hosts/subsurface/hardware-configuration.nix | 39 ++++++++-- .../subsurface/hardware-configuration.nix.bak | 78 +++++++++++++++++++ modules/desktop/apps/menus/nwggrid.nix | 21 +++++ modules/desktop/apps/nwg-launchers.nix | 17 ++++ modules/desktop/sway.nix | 11 ++- modules/dev/c.nix | 2 +- modules/dev/llvm.nix | 2 +- modules/theme/still/config/nwggrid/style.css | 39 ++++++++++ modules/theme/still/default.nix | 4 + overlays/wofi.nix | 7 ++ 12 files changed, 243 insertions(+), 43 deletions(-) create mode 100644 hosts/subsurface/hardware-configuration.nix.bak create mode 100644 modules/desktop/apps/menus/nwggrid.nix create mode 100644 modules/desktop/apps/nwg-launchers.nix create mode 100644 modules/theme/still/config/nwggrid/style.css create mode 100644 overlays/wofi.nix diff --git a/flake.lock b/flake.lock index f6fd0af..1e1c46d 100755 --- a/flake.lock +++ b/flake.lock @@ -105,28 +105,6 @@ "type": "github" } }, - "multimc": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "libnbtplusplus": "libnbtplusplus", - "nixpkgs": "nixpkgs", - "quazip": "quazip" - }, - "locked": { - "lastModified": 1641769038, - "narHash": "sha256-IGk8n00m7riuYLnR+3Nbo70YHJBOQv+nakynN/gtoY0=", - "owner": "PolyMC", - "repo": "PolyMC", - "rev": "3fa6e2243047005505a3de6f133feaa2f2eeb10a", - "type": "github" - }, - "original": { - "owner": "PolyMC", - "repo": "PolyMC", - "type": "github" - } - }, "nixos-hardware": { "locked": { "lastModified": 1639986101, @@ -146,16 +124,15 @@ "locked": { "lastModified": 1641528457, "narHash": "sha256-FyU9E63n1W7Ql4pMnhW2/rO9OftWZ37pLppn/c1aisY=", - "owner": "nixos", + "owner": "NixOS", "repo": "nixpkgs", "rev": "ff377a78794d412a35245e05428c8f95fef3951f", "type": "github" }, "original": { - "owner": "nixos", + "id": "nixpkgs", "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "indirect" } }, "nixpkgs-unstable": { @@ -177,15 +154,38 @@ "locked": { "lastModified": 1641528457, "narHash": "sha256-FyU9E63n1W7Ql4pMnhW2/rO9OftWZ37pLppn/c1aisY=", - "owner": "NixOS", + "owner": "nixos", "repo": "nixpkgs", "rev": "ff377a78794d412a35245e05428c8f95fef3951f", "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "nixos", "ref": "nixos-unstable", - "type": "indirect" + "repo": "nixpkgs", + "type": "github" + } + }, + "polymc": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "libnbtplusplus": "libnbtplusplus", + "nixpkgs": "nixpkgs_2", + "quazip": "quazip" + }, + "locked": { + "lastModified": 1641930261, + "narHash": "sha256-3RR/rjMFDYoA7qJHXLHdw1sauBCdO9kqMEGUpuxB1Sw=", + "owner": "PolyMC", + "repo": "PolyMC", + "rev": "3b524e99cceb734fa9f2433e3738ce0d185a75aa", + "type": "github" + }, + "original": { + "owner": "PolyMC", + "repo": "PolyMC", + "type": "github" } }, "quazip": { @@ -209,10 +209,10 @@ "agenix": "agenix", "home-manager": "home-manager", "meson": "meson", - "multimc": "multimc", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", + "polymc": "polymc", "sway-borders": "sway-borders" } }, diff --git a/hosts/subsurface/default.nix b/hosts/subsurface/default.nix index 35d98c3..7e7509b 100644 --- a/hosts/subsurface/default.nix +++ b/hosts/subsurface/default.nix @@ -10,7 +10,6 @@ curl dolphin discord - firefox-wayland wl-clipboard inkscape blender @@ -48,6 +47,9 @@ alacritty.enable = true; obs.enable = true; firefox.enable = true; + menus = { + nwggrid.enable = true; + }; }; editors = { neovim.enable = true; diff --git a/hosts/subsurface/hardware-configuration.nix b/hosts/subsurface/hardware-configuration.nix index 66738fd..c038f31 100644 --- a/hosts/subsurface/hardware-configuration.nix +++ b/hosts/subsurface/hardware-configuration.nix @@ -6,14 +6,14 @@ { imports = [ (modulesPath + "/installer/scan/not-detected.nix") - inputs.nixos-hardware.nixosModules.microsoft-surface +# inputs.nixos-hardware.nixosModules.microsoft-surface ]; # Kernel Modules boot = { initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; initrd.kernelModules = [ ]; -# kernelPackages = pkgs.linuxPackages_zen; + kernelPackages = pkgs.linuxPackages_zen; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; kernelModules = [ "kvm-intel" "v4l2loopback" ]; loader = { @@ -58,21 +58,48 @@ # Filesystems fileSystems = { "/" = { - device = "/dev/disk/by-uuid/eb56fb0a-a35d-472c-8704-6eec5ceea999"; + device = "/dev/disk/by-uuid/e1416adb-648e-4b34-b665-8305b7a765f8"; fsType = "f2fs"; + options = [ "defaults" "noatime" "noadirtime" ]; }; "/boot" = { - device = "/dev/disk/by-uuid/4669-2B0A"; + device = "/dev/disk/by-uuid/EB60-12E5"; fsType = "vfat"; }; -/* "/home/aether/Downloads" = { + device = "none"; fsType = "tmpfs"; }; + + "/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56" = { + device = "/dev/disk/by-uuid/bf2d91f1-a6b3-4629-8755-76301b3f6f56"; +# fsType = "ext4"; + options = [ "defaults" "noatime" "nodiratime" "user" "nofail" ]; + }; + +/* + "/home/aether/Videos" = { + device = "/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56/home delta/home delta delta/Videos"; + options = [ "bind" ]; + }; + + "/home/aether/Pictures" = { + device = "/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56/home delta/Pictures"; + options = [ "bind" ]; + }; + + "/home/aether/Documents" = { + device = "/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56/home delta/Documents"; + options = [ "bind" ]; + }; */ + "/home/aether/Music" = { + device = "/run/media/aether/bf2d91f1-a6b3-4629-8755-76301b3f6f56/home delta/home delta delta/Music"; + options = [ "bind" ]; + }; }; - swapDevices = [{ device = "/dev/disk/by-uuid/74226c30-e72f-4576-8349-8e77e844e875"; }]; + swapDevices = [{ device = "/dev/disk/by-uuid/537cffdc-a67d-4b25-a649-32455cec4661"; }]; } diff --git a/hosts/subsurface/hardware-configuration.nix.bak b/hosts/subsurface/hardware-configuration.nix.bak new file mode 100644 index 0000000..5749e7f --- /dev/null +++ b/hosts/subsurface/hardware-configuration.nix.bak @@ -0,0 +1,78 @@ +# 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, inputs, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") +# inputs.nixos-hardware.nixosModules.microsoft-surface + ]; + + # Kernel Modules + boot = { + initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + initrd.kernelModules = [ ]; + kernelPackages = pkgs.linuxPackages_zen; + extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; + kernelModules = [ "kvm-intel" "v4l2loopback" ]; + loader = { + systemd-boot = { + enable = true; + configurationLimit = 10; + }; + efi.canTouchEfiVariables = true; + }; + }; + + # Modules + modules.hardware = { + audio = { + enable = true; + enableExtraCompat = true; + }; + graphics.enable = true; + fs = { + enable = true; + ssd.enable = true; + }; + }; + + # HiDPI + hardware.video.hidpi.enable = true; + + # CPU + nix.maxJobs = lib.mkDefault 4; + hardware.cpu.intel.updateMicrocode = true; + + # Power Management + powerManagement = { + powertop.enable = true; + cpuFreqGovernor = lib.mkDefault "powersave"; + }; + + environment.systemPackages = with pkgs; [ + brightnessctl + ]; + + # Filesystems + fileSystems = { + "/" = { + device = "/dev/disk/by-lable/nixos"; + fsType = "f2fs"; + }; + + "/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; + +/* + "/home/aether/Downloads" = { + fsType = "tmpfs"; + }; +*/ + }; + + swapDevices = [{ device = "/dev/disk/by-label/swap"; }]; +} diff --git a/modules/desktop/apps/menus/nwggrid.nix b/modules/desktop/apps/menus/nwggrid.nix new file mode 100644 index 0000000..eeb6b25 --- /dev/null +++ b/modules/desktop/apps/menus/nwggrid.nix @@ -0,0 +1,21 @@ +{ config, pkgs, inputs, lib, ... }: + +with lib; +let + cfg = config.modules.desktop.apps.menus.nwggrid; +in { + options.modules.desktop.apps.menus.nwggrid = { + enable = mkOption { + type = types.bool; + default = false; + }; + executable = mkOption { + type = types.str; + default = "${pkgs.nwg-launchers}/bin/nwggrid"; + }; + }; + + config = mkIf cfg.enable { + config.modules.desktop.apps.nwg-launchers.enale = true; + }; +} diff --git a/modules/desktop/apps/nwg-launchers.nix b/modules/desktop/apps/nwg-launchers.nix new file mode 100644 index 0000000..f5045e0 --- /dev/null +++ b/modules/desktop/apps/nwg-launchers.nix @@ -0,0 +1,17 @@ +{ pkgs, lib, options, config, ... }: + +with lib; +let + cfg = config.modules.desktop.nwg-launchers; +in { + options.modules.desktop.nwg-launchers = { + enable = mkOptions { + type = types.bool; + default = false; + }; + }; + + config = mkIf cfg.enable { + user.packages = [ nwg-launchers ]; + }; +} diff --git a/modules/desktop/sway.nix b/modules/desktop/sway.nix index 01abeb8..19b4df9 100644 --- a/modules/desktop/sway.nix +++ b/modules/desktop/sway.nix @@ -11,6 +11,11 @@ in { default = false; description = "Enables the sway window manager for Wayland."; }; + menu = mkOption { + type = types.str; + default = "nwggrid"; + description = ""; + }; term = mkOption { type = types.str; default = "alacritty"; @@ -60,7 +65,7 @@ in { }; modules.desktop.apps."${cfg.term}".enable = true; - modules.desktop.apps.wofi.enable = true; + modules.desktop.apps.menus.${cfg.menu}.enable = true; # modules.desktop.services.swaylock.enable = true; modules.desktop.services.swayidle.enable = true; @@ -89,7 +94,7 @@ in { # { command = "mako"; } ]; terminal = config.modules.desktop.apps.${cfg.term}.executable; - menu = config.modules.desktop.apps.wofi.executable; + menu = config.modules.desktop.apps.menus.${cfg.menu}.executable; output."eDP-1" = { bg = "${config.modules.theme.wallpaper} fill"; scale = "1.5"; @@ -98,7 +103,7 @@ in { # "${mod}+l" = "exec lock"; "${mod}+q" = "reload"; "${mod}+Shift+c" = "kill"; - "${mod}+p" = "exec ${config.home._.wayland.windowManager.sway.config.menu} --show=drun"; + "${mod}+p" = "exec ${config.home._.wayland.windowManager.sway.config.menu}"; "${mod}+Shift+Return" = "exec ${config.home._.wayland.windowManager.sway.config.terminal}"; "${mod}+Shift+e" = "exit"; diff --git a/modules/dev/c.nix b/modules/dev/c.nix index 0090356..070271d 100644 --- a/modules/dev/c.nix +++ b/modules/dev/c.nix @@ -16,7 +16,7 @@ in { environment.systemPackages = if !withLLVM then with pkgs; [ gcc ] else with pkgs; [ - clang + clang_12 # clang-utils ]; }; diff --git a/modules/dev/llvm.nix b/modules/dev/llvm.nix index a1a5ef5..ab9e409 100644 --- a/modules/dev/llvm.nix +++ b/modules/dev/llvm.nix @@ -13,7 +13,7 @@ in { config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ - llvm + llvm_12 ]; }; } diff --git a/modules/theme/still/config/nwggrid/style.css b/modules/theme/still/config/nwggrid/style.css new file mode 100644 index 0000000..305e0ce --- /dev/null +++ b/modules/theme/still/config/nwggrid/style.css @@ -0,0 +1,39 @@ +button, label, image { + background: none; + border-style: none; + box-shadow: none; + color: #999999; +} + +button { + padding: 5px; + margin: 5px +} + +button:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +button:focus { + box-shadow: 0 0 2px; +} + +#searchbox { + background: none; + border-color: #999999; + color: #cccccc; + margin-top: 20px; + margin-bottom: 20px +} + +#separator { + background-color: rgba(200, 200, 200, 0.5); + margin-left: 500px; + margin-right: 500px; + margin-top: 10px; + margin-bottom: 10px +} + +#description { + margin-bottom: 20px +} diff --git a/modules/theme/still/default.nix b/modules/theme/still/default.nix index b374bd2..6fb0b0e 100644 --- a/modules/theme/still/default.nix +++ b/modules/theme/still/default.nix @@ -22,6 +22,10 @@ in { (mkIf desktop.sway.enable { "sway" = { source = ./config/sway; target = "$HOME.config/sway"; recursive = true; }; }) + + (mkIf desktop.nwg-launchers.enable { + "nwg-launchers/nwggrid/style.css" = { source = ./config/nwggrid/style.css; }; + }) ]; } ]); diff --git a/overlays/wofi.nix b/overlays/wofi.nix new file mode 100644 index 0000000..cd13ded --- /dev/null +++ b/overlays/wofi.nix @@ -0,0 +1,7 @@ +final: prev: { + wofi = (prev.wofi.override { + stdenv = prev.clang12Stdenv; + }).overrideAttrs (old: { + "NIX_CFLAGS_COMPILE" = "-Os -march=native"; + }); +}