mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
fix and cleanup flake (#178)
- switch to nixpkgs-unstable - use a more sensible set in `forEachSystem` - fix typos in options - add hotkey-overlay title for binds - use the new `dms` cli tool instead of qs ipc calls
This commit is contained in:
1
alejandra.toml
Normal file
1
alejandra.toml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
indentation = "FourSpaces"
|
||||||
43
flake.lock
generated
43
flake.lock
generated
@@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"dgop": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1757252286,
|
||||||
|
"narHash": "sha256-QwWQzlxAGvIi6VAc8DQ6ONCKKwtPyaHQW1cQyGbP7Og=",
|
||||||
|
"owner": "AvengeMedia",
|
||||||
|
"repo": "dgop",
|
||||||
|
"rev": "a65a02ddf8bade9c109d055e644e4bd851183bd5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "AvengeMedia",
|
||||||
|
"repo": "dgop",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"dms-cli": {
|
"dms-cli": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -7,11 +27,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1757112511,
|
"lastModified": 1757296630,
|
||||||
"narHash": "sha256-WE1cUTr53VJG06YAkpYG+HvdXp4fFyqZwXqsABOXYFY=",
|
"narHash": "sha256-3H236F5oIKkqpfnwrvZQs4Y5imKb6JCMFGDkHs8VDjQ=",
|
||||||
"owner": "AvengeMedia",
|
"owner": "AvengeMedia",
|
||||||
"repo": "danklinux",
|
"repo": "danklinux",
|
||||||
"rev": "563c7fdcba0e8c6ac0f4b3292308e8bcbb553da6",
|
"rev": "dac591711ab30d6b071a5cec674a3d2e04665ee1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -22,16 +42,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1754214453,
|
"lastModified": 1757034884,
|
||||||
"narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=",
|
"narHash": "sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376",
|
"rev": "ca77296380960cd497a765102eeb1356eb80fed0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixpkgs-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -43,11 +63,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1753595452,
|
"lastModified": 1756981260,
|
||||||
"narHash": "sha256-vqkSDvh7hWhPvNjMjEDV4KbSCv2jyl2Arh73ZXe274k=",
|
"narHash": "sha256-GhuD9QVimjynHI0OOyZsqJsnlXr2orowh9H+HYz4YMs=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "a5431dd02dc23d9ef1680e67777fed00fe5f7cda",
|
"rev": "6eb12551baf924f8fdecdd04113863a754259c34",
|
||||||
"revCount": 665,
|
"revCount": 672,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
||||||
},
|
},
|
||||||
@@ -58,6 +78,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"dgop": "dgop",
|
||||||
"dms-cli": "dms-cli",
|
"dms-cli": "dms-cli",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"quickshell": "quickshell"
|
"quickshell": "quickshell"
|
||||||
|
|||||||
344
flake.nix
344
flake.nix
@@ -1,170 +1,198 @@
|
|||||||
{
|
{
|
||||||
description = "Dank material shell.";
|
description = "Dank Material Shell";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
|
||||||
quickshell = {
|
quickshell = {
|
||||||
url = "git+https://git.outfoxxed.me/quickshell/quickshell";
|
url = "git+https://git.outfoxxed.me/quickshell/quickshell";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
|
||||||
dgop = {
|
|
||||||
url = "github:AvengeMedia/dgop";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
dms-cli = {
|
|
||||||
url = "github:AvengeMedia/danklinux";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, quickshell, dgop, dms-cli, ... }:
|
|
||||||
let
|
|
||||||
forEachSystem = fn:
|
|
||||||
nixpkgs.lib.genAttrs
|
|
||||||
nixpkgs.lib.platforms.linux
|
|
||||||
(system: fn system nixpkgs.legacyPackages.${system});
|
|
||||||
in {
|
|
||||||
packages = forEachSystem (system: pkgs: rec {
|
|
||||||
dankMaterialShell = pkgs.stdenvNoCC.mkDerivation {
|
|
||||||
name = "dankMaterialShell";
|
|
||||||
src = ./.;
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/etc/xdg/quickshell/DankMaterialShell
|
|
||||||
cp -r . $out/etc/xdg/quickshell/DankMaterialShell
|
|
||||||
ln -s $out/etc/xdg/quickshell/DankMaterialShell $out/etc/xdg/quickshell/dms
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
dgop = {
|
||||||
|
url = "github:AvengeMedia/dgop";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
dms-cli = {
|
||||||
|
url = "github:AvengeMedia/danklinux";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
default = self.packages.${system}.dankMaterialShell;
|
outputs = {
|
||||||
});
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
quickshell,
|
||||||
|
dgop,
|
||||||
|
dms-cli,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
forEachSystem = fn:
|
||||||
|
nixpkgs.lib.genAttrs
|
||||||
|
["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"]
|
||||||
|
(system: fn system nixpkgs.legacyPackages.${system});
|
||||||
|
in {
|
||||||
|
formatter = forEachSystem (_: pkgs: pkgs.alejandra);
|
||||||
|
|
||||||
homeModules.dankMaterialShell = { config, pkgs, lib, ... }:
|
packages = forEachSystem (system: pkgs: {
|
||||||
let cfg = config.programs.dankMaterialShell;
|
dankMaterialShell = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "dankMaterialShell";
|
||||||
|
src = ./.;
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/etc/xdg/quickshell/DankMaterialShell
|
||||||
|
cp -r . $out/etc/xdg/quickshell/DankMaterialShell
|
||||||
|
ln -s $out/etc/xdg/quickshell/DankMaterialShell $out/etc/xdg/quickshell/dms
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
quickshell = quickshell.packages.${system}.default;
|
||||||
|
|
||||||
|
default = self.packages.${system}.dankMaterialShell;
|
||||||
|
});
|
||||||
|
|
||||||
|
homeModules.dankMaterialShell = {
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.programs.dankMaterialShell;
|
||||||
|
inherit (lib.types) bool;
|
||||||
in {
|
in {
|
||||||
|
options.programs.dankMaterialShell = {
|
||||||
options.programs.dankMaterialShell = {
|
enable = lib.mkEnableOption "DankMaterialShell";
|
||||||
enable = lib.mkEnableOption "DankMaterialShell";
|
enableKeybinds = lib.mkEnableOption "DankMaterialShell niri keybinds";
|
||||||
enableKeybinds =
|
enableSystemd = lib.mkEnableOption "DankMaterialShell systemd startup";
|
||||||
lib.mkEnableOption "DankMaterialShell Niri keybinds";
|
enableSpawn = lib.mkEnableOption "DankMaterialShell niri spawn-at-startup";
|
||||||
enableSystemd =
|
enableSystemMonitoring = lib.mkOption {
|
||||||
lib.mkEnableOption "DankMaterialShell systemd startup";
|
type = bool;
|
||||||
enableSpawn =
|
default = true;
|
||||||
lib.mkEnableOption "DankMaterialShell Niri spawn-at-startup";
|
description = "Add needed dependencies to use system monitoring widgets";
|
||||||
enableSystemMonitoring = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Add needed dependencies to use system monitoring widgets";
|
|
||||||
};
|
|
||||||
enableClipboard = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Add needed dependencies to use the clipboard widget";
|
|
||||||
};
|
|
||||||
enableVPN = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Add needed dependencies to use the VPN widget";
|
|
||||||
};
|
|
||||||
enableBrigthnessControl = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Add needed dependencies to have brightness/backlight support";
|
|
||||||
};
|
|
||||||
enableNightMode = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Add needed dependencies to have night mode support";
|
|
||||||
};
|
|
||||||
enableDynamicTheming = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Add needed dependencies to have dynamic theming support";
|
|
||||||
};
|
|
||||||
enableAudioWavelenght = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Add needed dependencies to have audio wavelenght support";
|
|
||||||
};
|
|
||||||
enableCalendarEvents = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "Add calendar events support via khal";
|
|
||||||
};
|
|
||||||
quickshell = {
|
|
||||||
package = lib.mkPackageOption pkgs "quickshell" {
|
|
||||||
default = quickshell.packages.${pkgs.system}.quickshell;
|
|
||||||
nullable = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
programs.quickshell = {
|
|
||||||
enable = true;
|
|
||||||
package = cfg.quickshell.package;
|
|
||||||
configs.DankMaterialShell = "${
|
|
||||||
self.packages.${pkgs.system}.dankMaterialShell
|
|
||||||
}/etc/xdg/quickshell/DankMaterialShell";
|
|
||||||
activeConfig = lib.mkIf cfg.enableSystemd "DankMaterialShell";
|
|
||||||
systemd = lib.mkIf cfg.enableSystemd {
|
|
||||||
enable = true;
|
|
||||||
target = "graphical-session.target";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.niri.settings = lib.mkMerge [
|
|
||||||
(lib.mkIf cfg.enableKeybinds {
|
|
||||||
binds = with config.lib.niri.actions; let
|
|
||||||
quickShellIpc = spawn "${cfg.quickshell.package}/bin/qs" "-c" "DankMaterialShell" "ipc" "call";
|
|
||||||
in {
|
|
||||||
"Mod+Space".action = quickShellIpc "spotlight" "toggle";
|
|
||||||
"Mod+V".action = quickShellIpc "clipboard" "toggle";
|
|
||||||
"Mod+M".action = quickShellIpc "processlist" "toggle";
|
|
||||||
"Mod+Comma".action = quickShellIpc "settings" "toggle";
|
|
||||||
"Super+Alt+L".action = quickShellIpc "lock" "lock";
|
|
||||||
"XF86AudioRaiseVolume" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = quickShellIpc "audio" "increment" "3";
|
|
||||||
};
|
|
||||||
"XF86AudioLowerVolume" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = quickShellIpc "audio" "decrement" "3";
|
|
||||||
};
|
|
||||||
"XF86AudioMute" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = quickShellIpc "audio" "mute";
|
|
||||||
};
|
|
||||||
"XF86AudioMicMute" = {
|
|
||||||
allow-when-locked = true;
|
|
||||||
action = quickShellIpc "audio" "micmute";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
})
|
enableClipboard = lib.mkOption {
|
||||||
(lib.mkIf (cfg.enableSpawn) {
|
type = bool;
|
||||||
spawn-at-startup =
|
default = true;
|
||||||
[{ command = [ "${cfg.quickshell.package}/bin/qs" "-c" "DankMaterialShell" ]; }];
|
description = "Add needed dependencies to use the clipboard widget";
|
||||||
})
|
};
|
||||||
];
|
enableVPN = lib.mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Add needed dependencies to use the VPN widget";
|
||||||
|
};
|
||||||
|
enableBrightnessControl = lib.mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Add needed dependencies to have brightness/backlight support";
|
||||||
|
};
|
||||||
|
enableNightMode = lib.mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Add needed dependencies to have night mode support";
|
||||||
|
};
|
||||||
|
enableDynamicTheming = lib.mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Add needed dependencies to have dynamic theming support";
|
||||||
|
};
|
||||||
|
enableAudioWavelength = lib.mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Add needed dependencies to have audio waveleng support";
|
||||||
|
};
|
||||||
|
enableCalendarEvents = lib.mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Add calendar events support via khal";
|
||||||
|
};
|
||||||
|
quickshell = {
|
||||||
|
package = lib.mkPackageOption pkgs "quickshell" {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
home.packages = [
|
config = lib.mkIf cfg.enable {
|
||||||
pkgs.material-symbols
|
programs.quickshell = {
|
||||||
pkgs.inter
|
enable = true;
|
||||||
pkgs.fira-code
|
package = cfg.quickshell.package;
|
||||||
|
|
||||||
pkgs.ddcutil
|
configs.dms = "${
|
||||||
pkgs.libsForQt5.qt5ct
|
self.packages.${pkgs.system}.dankMaterialShell
|
||||||
pkgs.kdePackages.qt6ct
|
}/etc/xdg/quickshell/DankMaterialShell";
|
||||||
dms-cli.packages.${pkgs.system}.default
|
activeConfig = lib.mkIf cfg.enableSystemd "dms";
|
||||||
]
|
|
||||||
++ lib.optional cfg.enableSystemMonitoring dgop.packages.${pkgs.system}.dgop
|
systemd = lib.mkIf cfg.enableSystemd {
|
||||||
++ lib.optionals cfg.enableClipboard [pkgs.cliphist pkgs.wl-clipboard]
|
enable = true;
|
||||||
++ lib.optionals cfg.enableVPN [pkgs.glib pkgs.networkmanager]
|
target = "graphical-session.target";
|
||||||
++ lib.optional cfg.enableBrigthnessControl pkgs.brightnessctl
|
};
|
||||||
++ lib.optional cfg.enableNightMode pkgs.gammastep
|
};
|
||||||
++ lib.optional cfg.enableDynamicTheming pkgs.matugen
|
|
||||||
++ lib.optional cfg.enableAudioWavelenght pkgs.cava
|
programs.niri.settings = lib.mkMerge [
|
||||||
++ lib.optional cfg.enableCalendarEvents pkgs.khal;
|
(lib.mkIf cfg.enableKeybinds {
|
||||||
};
|
binds = with config.lib.niri.actions; let
|
||||||
|
dms-ipc = spawn "dms" "ipc";
|
||||||
|
in {
|
||||||
|
"Mod+Space" = {
|
||||||
|
action = dms-ipc "spotlight" "toggle";
|
||||||
|
hotkey-overlay.title = "Toggle Spotlight";
|
||||||
|
};
|
||||||
|
"Mod+V" = {
|
||||||
|
action = dms-ipc "clipboard" "toggle";
|
||||||
|
hotkey-overlay.title = "Toggle Clipboard Manager";
|
||||||
|
};
|
||||||
|
"Mod+M" = {
|
||||||
|
action = dms-ipc "processlist" "toggle";
|
||||||
|
hotkey-overlay.title = "Toggle Process List";
|
||||||
|
};
|
||||||
|
"Mod+Comma" = {
|
||||||
|
action = dms-ipc "settings" "toggle";
|
||||||
|
hotkey-overlay.title = "Toggle Settings";
|
||||||
|
};
|
||||||
|
"Super+Alt+L" = {
|
||||||
|
action = dms-ipc "lock" "lock";
|
||||||
|
hotkey-overlay.title = "Toggle Lock Screen";
|
||||||
|
};
|
||||||
|
"XF86AudioRaiseVolume" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "audio" "increment" "3";
|
||||||
|
};
|
||||||
|
"XF86AudioLowerVolume" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "audio" "decrement" "3";
|
||||||
|
};
|
||||||
|
"XF86AudioMute" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "audio" "mute";
|
||||||
|
};
|
||||||
|
"XF86AudioMicMute" = {
|
||||||
|
allow-when-locked = true;
|
||||||
|
action = dms-ipc "audio" "micmute";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf cfg.enableSpawn {
|
||||||
|
spawn-at-startup = [
|
||||||
|
{command = ["dms" "run"];}
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
home.packages =
|
||||||
|
[
|
||||||
|
pkgs.material-symbols
|
||||||
|
pkgs.inter
|
||||||
|
pkgs.fira-code
|
||||||
|
|
||||||
|
pkgs.ddcutil
|
||||||
|
pkgs.libsForQt5.qt5ct
|
||||||
|
pkgs.kdePackages.qt6ct
|
||||||
|
dms-cli.packages.${pkgs.system}.default
|
||||||
|
]
|
||||||
|
++ lib.optional cfg.enableSystemMonitoring dgop.packages.${pkgs.system}.dgop
|
||||||
|
++ lib.optionals cfg.enableClipboard [pkgs.cliphist pkgs.wl-clipboard]
|
||||||
|
++ lib.optionals cfg.enableVPN [pkgs.glib pkgs.networkmanager]
|
||||||
|
++ lib.optional cfg.enableBrightnessControl pkgs.brightnessctl
|
||||||
|
++ lib.optional cfg.enableNightMode pkgs.gammastep
|
||||||
|
++ lib.optional cfg.enableDynamicTheming pkgs.matugen
|
||||||
|
++ lib.optional cfg.enableAudioWavelength pkgs.cava
|
||||||
|
++ lib.optional cfg.enableCalendarEvents pkgs.khal;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user