From eb1cb1f2974ea2b3778eac5bcd4e2c131c024737 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Sat, 9 Nov 2024 23:59:21 +0100 Subject: [PATCH] Include Hyprspace as a potential plugin --- base/common_hardware.nix | 2 +- base/env.nix | 2 +- flake.nix | 7 ++--- modules/conf.nix | 39 ++------------------------ modules/programs/fish.nix | 2 +- modules/programs/hyprland/hyprland.nix | 37 ++++++++++++++++++------ 6 files changed, 36 insertions(+), 53 deletions(-) diff --git a/base/common_hardware.nix b/base/common_hardware.nix index 101a0a7..e63eb76 100644 --- a/base/common_hardware.nix +++ b/base/common_hardware.nix @@ -41,7 +41,7 @@ in ''resume="PARTLABEL=SWAP"'' ''quiet'' ''udev.log_level=3'' - ] ++ config.conf.boot_params; + ] ++ config.conf.bootParams; }; # Enable networking diff --git a/base/env.nix b/base/env.nix index 9a62d7e..f4de6c3 100644 --- a/base/env.nix +++ b/base/env.nix @@ -12,7 +12,7 @@ sessionVariables = { NIXOS_OZONE_WL = "1"; GOPATH = "$HOME/.go"; - FLAKE = config.conf.nix_path; + FLAKE = config.conf.nixosConfigPath; }; }; } diff --git a/flake.nix b/flake.nix index 810f010..daa994d 100644 --- a/flake.nix +++ b/flake.nix @@ -16,10 +16,9 @@ sops-nix.url = "github:Mic92/sops-nix"; - # Hyprspace = { - # url = "github:KZDKM/Hyprspace"; - # inputs.hyprland.follows = "nixpkgs"; - # }; + Hyprspace = { + url = "github:KZDKM/Hyprspace"; + }; nur.url = "github:nix-community/nur"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; diff --git a/modules/conf.nix b/modules/conf.nix index 2c3236f..9d6a162 100644 --- a/modules/conf.nix +++ b/modules/conf.nix @@ -93,7 +93,7 @@ }; }; - boot_params = lib.mkOption { + bootParams = lib.mkOption { default = [ ]; example = [ "resume=something" ]; type = with lib.types; listOf str; @@ -150,7 +150,7 @@ ''; }; - nixos-config-path = lib.mkOption { + nixosConfigPath = lib.mkOption { default = "/home/${config.conf.username}/gits/nixos/."; example = "yourpath/."; type = lib.types.str; @@ -159,41 +159,6 @@ ''; }; - nvim-colorscheme = lib.mkOption { - default = { - tokyonight = { - enable = true; - }; - }; - example = { - catppuccin = { - enable = true; - }; - }; - type = lib.types.attrs; - description = '' - nixvim colorscheme. - ''; - }; - - nix_path = lib.mkOption { - default = "/home/${config.conf.username}/gits/nixos"; - example = "yourpath"; - type = lib.types.str; - description = '' - The default path for your configuration. - ''; - }; - - kb_layout = lib.mkOption { - default = "dashie"; - example = "us"; - type = lib.types.str; - description = '' - The layout used in services. - ''; - }; - systemStateVersion = lib.mkOption { example = "24.05"; default = "23.05"; diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 6cfebc0..b45ec5a 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -41,7 +41,7 @@ # Utility functions for zoxide. # - export NIX_PATH="$NIX_PATH:${config.conf.nixos-config-path}" + export NIX_PATH="$NIX_PATH:${config.conf.nixosConfigPath}" set EDITOR "neovide --no-fork" diff --git a/modules/programs/hyprland/hyprland.nix b/modules/programs/hyprland/hyprland.nix index f132ef5..ab23b34 100644 --- a/modules/programs/hyprland/hyprland.nix +++ b/modules/programs/hyprland/hyprland.nix @@ -3,6 +3,7 @@ lib, options, pkgs, + inputs, ... }: let @@ -89,6 +90,23 @@ in Plugins to be added to Hyprland. ''; }; + pluginConfig = lib.mkOption { + default = { }; + example = { }; + type = with lib.types; attrsOf anything; + description = '' + Plugin configuration to be added to Hyprland. + ''; + }; + hyprspaceEnable = lib.mkOption { + default = false; + type = lib.types.bool; + example = true; + description = '' + Enables Hyprspace plugin for hyprland. + Please note, plugins tend to break VERY often. + ''; + }; }; }; @@ -362,19 +380,20 @@ in "oxinoti" ] ++ config.mods.hyprland.extraAutostart; - # plugin = { - # hyprspace = { - # bind = [ - # "SUPER, W, overview:toggle, toggle" - # ]; - # }; - # }; + plugin = { + hyprspace = lib.mkIf config.mods.hyprland.hyprspaceEnable { + bind = [ + "SUPER, W, overview:toggle, toggle" + ]; + }; + } // config.mods.hyprland.pluginConfig; } // config.mods.hyprland.customConfig else lib.mkForce config.mods.hyprland.customConfig; - plugins = config.mods.hyprland.plugins; - #inputs.Hyprspace.packages.${pkgs.system}.Hyprspace + plugins = [ + (lib.mkIf config.mods.hyprland.hyprspaceEnable inputs.Hyprspace.packages.${pkgs.system}.Hyprspace) + ] ++ config.mods.hyprland.plugins; }; } );