From 90efd89ba49867831d004271c0b3e1990b8d2a6b Mon Sep 17 00:00:00 2001 From: blue linden Date: Tue, 5 Aug 2025 23:26:32 -0400 Subject: [PATCH] Create package and (untested) Home Manager module --- .gitignore | 4 +- flake.lock | 61 +++++++++++++++++++++++++++++ flake.nix | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index 60f81cf8..47d2ccf6 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,6 @@ CLAUDE-temp.md # Auto-generated theme files *.generated.* niri-colors.generated.kdl -ghostty-colors.generated.conf \ No newline at end of file +ghostty-colors.generated.conf + +result \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..e38c44e5 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1754444017, + "narHash": "sha256-PyxmeamNheSNZICr8vvanf0F3YQf9DPCu2qErVC2A7k=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "a3790776751d1a6365aa0717f509d05adee90734", + "type": "github" + }, + "original": { + "id": "home-manager", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1753939845, + "narHash": "sha256-K2ViRJfdVGE8tpJejs8Qpvvejks1+A4GQej/lBk5y7I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "94def634a20494ee057c76998843c015909d6311", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1754214453, + "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..793eee7c --- /dev/null +++ b/flake.nix @@ -0,0 +1,113 @@ +{ + description = "Dank material shell."; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + # home-manager.url = "github:nix-community/home-manager"; + }; + + outputs = { self, nixpkgs, home-manager }: + let pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + + packages.x86_64-linux.dankMaterialShell = pkgs.stdenvNoCC.mkDerivation { + name = "dankMaterialShell"; + src = ./.; + buildInputs = with pkgs; [ + material-symbols + inter + fira-code + cava + wl-clipboard + cliphist + ddcutil + libsForQt5.qt5ct + kdePackages.qt6ct + matugen + ]; + installPhase = '' + mkdir -p $out/etc/xdg/quickshell/DankMaterialShell + cp -r . $out/etc/xdg/quickshell/DankMaterialShell + ''; + }; + + packages.x86_64-linux.default = + self.packages.x86_64-linux.dankMaterialShell; + + homeModules.dankMaterialShell = { config, options, pkgs, outputs, ... }: + let cfg = config.programs.dankMaterialShell; + in { + options.programs.dankMaterialShell = { + enable = pkgs.lib.mkEnableOption "DankMaterialShell"; + enableKeybinds = + pkgs.lib.mkEnableOption "DankMaterialShell Niri keybinds"; + }; + + programs.quickshell.enable = pkgs.lib.mkIf cfg.enable true; + + programs.quickshell.configs.DankMaterialShell = + pkgs.lib.mkIf cfg.enableKeybinds + "${outputs.packages.x86_64-linux.dankMaterialShell}/etc/xdg/quickshell/DankMaterialShell"; + + programs.quickshell.activeConfig = + pkgs.lib.mkIf cfg.enable "DankMaterialShell"; + + programs.niri.settings.input.binds = pkgs.lib.mkIf cfg.enableKeybinds + (with config.lib.niri.actions; { + "Mod+Space" = { + hotkey-overlay-title = "Application Launcher"; + action = + spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "spotlight" + "toggle"; + }; + "Mod+V" = { + hotkey-overlay-title = "Clipboard Manager"; + action = + spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "clipboard" + "toggle"; + }; + "Mod+M" = { + hotkey-overlay-title = "Task Manager"; + action = + spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "processlist" + "toggle"; + }; + "Mod+Comma" = { + hotkey-overlay-title = "Settings"; + action = + spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "settings" + "toggle"; + }; + "Super+Alt+L" = { + hotkey-overlay-title = "Lock Screen"; + action = spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "lock" + "lock"; + }; + "XF86AudioRaiseVolume" = { + allow-when-locked = true; + action = + spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" + "increment" "3"; + }; + "XF86AudioLowerVolume" = { + allow-when-locked = true; + action = + spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" + "decrement" "3"; + }; + "XF86AudioMute" = { + allow-when-locked = true; + action = + spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" + "mute"; + }; + "XF86AudioMicMute" = { + allow-when-locked = true; + action = + spawn "qs" "-c" "DankMaterialShell" "ipc" "call" "audio" + "micmute"; + }; + }); + }; + }; +}