From aa0272b6e0a96987885bb3738a43c02bfdeba1d5 Mon Sep 17 00:00:00 2001 From: jamie Date: Thu, 5 Feb 2026 16:29:11 +0000 Subject: [PATCH] dank-material-shell: init (#2177) Closes: https://github.com/nix-community/stylix/issues/1924 Link: https://github.com/nix-community/stylix/pull/1932 Link: https://github.com/nix-community/stylix/pull/2177 Reviewed-by: 0xda157 Co-authored-by: khas-amir Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- flake/dev/flake.lock | 44 +++++++++++++++++ flake/dev/flake.nix | 5 ++ modules/dank-material-shell/hm.nix | 47 +++++++++++++++++++ modules/dank-material-shell/meta.nix | 9 ++++ .../testbeds/dank-material-shell.nix | 11 +++++ stylix/testbed/default.nix | 4 ++ 6 files changed, 120 insertions(+) create mode 100644 modules/dank-material-shell/hm.nix create mode 100644 modules/dank-material-shell/meta.nix create mode 100644 modules/dank-material-shell/testbeds/dank-material-shell.nix diff --git a/flake/dev/flake.lock b/flake/dev/flake.lock index 25c8b62e..4c40dd47 100644 --- a/flake/dev/flake.lock +++ b/flake/dev/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "dankMaterialShell": { + "inputs": { + "nixpkgs": [ + "dev-nixpkgs" + ], + "quickshell": "quickshell" + }, + "locked": { + "lastModified": 1769830502, + "narHash": "sha256-Z/6ttgM5CCsgIhdPb7ZO20uQ6vgFeFs6lr2AlD+RWLM=", + "owner": "AvengeMedia", + "repo": "DankMaterialShell", + "rev": "4602442feb7b9de19b92a762b440b895edb8a39a", + "type": "github" + }, + "original": { + "owner": "AvengeMedia", + "repo": "DankMaterialShell", + "type": "github" + } + }, "dev-flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -221,8 +242,31 @@ "type": "github" } }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "dankMaterialShell", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1766725085, + "narHash": "sha256-O2aMFdDUYJazFrlwL7aSIHbUSEm3ADVZjmf41uBJfHs=", + "ref": "refs/heads/master", + "rev": "41828c4180fb921df7992a5405f5ff05d2ac2fff", + "revCount": 715, + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + }, + "original": { + "rev": "41828c4180fb921df7992a5405f5ff05d2ac2fff", + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + } + }, "root": { "inputs": { + "dankMaterialShell": "dankMaterialShell", "dev-flake-parts": "dev-flake-parts", "dev-nixpkgs": "dev-nixpkgs", "dev-systems": "dev-systems", diff --git a/flake/dev/flake.nix b/flake/dev/flake.nix index af987f3b..5bffdd01 100644 --- a/flake/dev/flake.nix +++ b/flake/dev/flake.nix @@ -130,6 +130,11 @@ dev-systems.url = "github:nix-systems/default"; # keep-sorted start block=yes newline_separated=yes + dankMaterialShell = { + url = "github:AvengeMedia/DankMaterialShell"; + inputs.nixpkgs.follows = "dev-nixpkgs"; + }; + flake-compat.url = "github:NixOS/flake-compat"; git-hooks = { diff --git a/modules/dank-material-shell/hm.nix b/modules/dank-material-shell/hm.nix new file mode 100644 index 00000000..c8e8d148 --- /dev/null +++ b/modules/dank-material-shell/hm.nix @@ -0,0 +1,47 @@ +{ + mkTarget, + lib, + options, + pkgs, + ... +}: +mkTarget { + config = lib.optionals (options.programs ? dank-material-shell) ( + { colors }: + { + programs.dank-material-shell.settings = { + currentThemeName = "custom"; + customThemeFile = + let + theme = with colors.withHashtag; { + name = "Stylix"; + primary = base0D; + primaryText = base00; + primaryContainer = base0C; + secondary = base0E; + surface = base01; + surfaceText = base05; + surfaceVariant = base02; + surfaceVariantText = base04; + surfaceTint = base0D; + background = base00; + backgroundText = base05; + outline = base03; + surfaceContainer = base01; + surfaceContainerHigh = base02; + surfaceContainerHighest = base03; + error = base08; + warning = base0A; + info = base0C; + }; + in + pkgs.writeText "dankMaterialShell-stylix-color-theme.json" ( + builtins.toJSON { + dark = theme; + light = theme; + } + ); + }; + } + ); +} diff --git a/modules/dank-material-shell/meta.nix b/modules/dank-material-shell/meta.nix new file mode 100644 index 00000000..e81796fb --- /dev/null +++ b/modules/dank-material-shell/meta.nix @@ -0,0 +1,9 @@ +{ lib, ... }: +{ + name = "DankMaterialShell"; + homepage = "https://github.com/AvengeMedia/DankMaterialShell"; + maintainers = with lib.maintainers; [ + khas-amir + skiletro + ]; +} diff --git a/modules/dank-material-shell/testbeds/dank-material-shell.nix b/modules/dank-material-shell/testbeds/dank-material-shell.nix new file mode 100644 index 00000000..284f8790 --- /dev/null +++ b/modules/dank-material-shell/testbeds/dank-material-shell.nix @@ -0,0 +1,11 @@ +{ lib, ... }: +{ + stylix.testbed.ui = { + graphicalEnvironment = "hyprland"; + command.text = "dms run"; + }; + + home-manager.sharedModules = lib.singleton { + programs.dank-material-shell.enable = true; + }; +} diff --git a/stylix/testbed/default.nix b/stylix/testbed/default.nix index 510f0109..3e92c4be 100644 --- a/stylix/testbed/default.nix +++ b/stylix/testbed/default.nix @@ -35,6 +35,10 @@ let { inherit (inputs.spicetify-nix.nixosModules) spicetify; + dank-material-shell.home-manager.sharedModules = [ + inputs.dankMaterialShell.homeModules.dank-material-shell + ]; + nixvim-integrated = inputs.nixvim.nixosModules.nixvim; nixvim-standalone.lib.stylix.testbed = {