attempt plasma flake
This commit is contained in:
parent
dac2d0cf9c
commit
012e493ad3
12 changed files with 561 additions and 5 deletions
21
flakes/de_plasma/home_manager/autostart.nix
Normal file
21
flakes/de_plasma/home_manager/autostart.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.ringofstorms.dePlasma;
|
||||
inherit (lib) mkIf;
|
||||
delayMs = cfg.monitors.scriptDelayMs;
|
||||
script = pkgs.writeShellScriptBin "plasma-kscreen-overrides" ''
|
||||
set -euo pipefail
|
||||
sleep $((${toString delayMs} / 1000)).$(( ${toString delayMs} % 1000 ))
|
||||
${lib.concatStringsSep "\n" (map (c: c) cfg.monitors.commands)}
|
||||
'';
|
||||
in
|
||||
{
|
||||
options = {};
|
||||
config = mkIf (cfg.enable && cfg.monitors.enableOverrides && cfg.monitors.commands != [ ]) {
|
||||
# Use XDG autostart
|
||||
xdg.autostart."ringofstorms-kscreen-overrides" = {
|
||||
name = "Apply monitor overrides";
|
||||
exec = "${script}/bin/plasma-kscreen-overrides";
|
||||
};
|
||||
};
|
||||
}
|
||||
11
flakes/de_plasma/home_manager/default.nix
Normal file
11
flakes/de_plasma/home_manager/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./plasma.nix
|
||||
./shortcuts.nix
|
||||
./panel.nix
|
||||
./theme.nix
|
||||
./polkit.nix
|
||||
./autostart.nix
|
||||
];
|
||||
}
|
||||
22
flakes/de_plasma/home_manager/panel.nix
Normal file
22
flakes/de_plasma/home_manager/panel.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.ringofstorms.dePlasma;
|
||||
inherit (lib) mkIf;
|
||||
mkPanel = {
|
||||
location ? cfg.panel.location,
|
||||
height ? cfg.panel.height,
|
||||
opacity ? cfg.panel.opacity,
|
||||
widgets ? cfg.panel.widgets
|
||||
}: {
|
||||
location = location;
|
||||
height = height;
|
||||
opacity = opacity;
|
||||
widgets = widgets;
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {};
|
||||
config = mkIf (cfg.enable && cfg.panel.enabled) {
|
||||
programs.plasma.panels = [ (mkPanel {}) ];
|
||||
};
|
||||
}
|
||||
15
flakes/de_plasma/home_manager/plasma.nix
Normal file
15
flakes/de_plasma/home_manager/plasma.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.ringofstorms.dePlasma;
|
||||
inherit (lib) mkIf;
|
||||
in
|
||||
{
|
||||
options = {};
|
||||
config = mkIf cfg.enable {
|
||||
# plasma-manager base enable
|
||||
programs.plasma = {
|
||||
enable = true;
|
||||
# Tweak some global Plasma config if desired later
|
||||
};
|
||||
};
|
||||
}
|
||||
4
flakes/de_plasma/home_manager/polkit.nix
Normal file
4
flakes/de_plasma/home_manager/polkit.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
# Plasma ships polkit-agent in its session; keep placeholder for parity
|
||||
}
|
||||
38
flakes/de_plasma/home_manager/shortcuts.nix
Normal file
38
flakes/de_plasma/home_manager/shortcuts.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.ringofstorms.dePlasma;
|
||||
inherit (lib) mkIf;
|
||||
workspaces = builtins.genList (i: i + 1) 9;
|
||||
kwinWorkspace = builtins.listToAttrs (map (i: {
|
||||
name = "Switch to Desktop ${toString i}";
|
||||
value = "Meta+${toString i}";
|
||||
}) workspaces);
|
||||
kwinMoveWorkspace = builtins.listToAttrs (map (i: {
|
||||
name = "Window to Desktop ${toString i}";
|
||||
value = "Meta+Shift+${toString i}";
|
||||
}) workspaces);
|
||||
krunnerShortcut = if cfg.shortcuts.launcher == "krunner" then {
|
||||
krunner = { "Run Command" = "Meta+Space"; };
|
||||
} else { };
|
||||
in
|
||||
{
|
||||
options = {};
|
||||
config = mkIf (cfg.enable && cfg.shortcuts.useI3Like) {
|
||||
programs.plasma.shortcuts =
|
||||
({
|
||||
kwin = ({ "Close Window" = cfg.shortcuts.closeWindow; } // kwinWorkspace // kwinMoveWorkspace);
|
||||
} // krunnerShortcut);
|
||||
|
||||
programs.plasma.hotkeys.commands = {
|
||||
ringofstorms_terminal = {
|
||||
key = "Meta+Return";
|
||||
command = cfg.shortcuts.terminal;
|
||||
};
|
||||
} // (if cfg.shortcuts.launcher == "rofi" then {
|
||||
ringofstorms_launcher = {
|
||||
key = "Meta+Space";
|
||||
command = "rofi -show drun";
|
||||
};
|
||||
} else {});
|
||||
};
|
||||
}
|
||||
19
flakes/de_plasma/home_manager/theme.nix
Normal file
19
flakes/de_plasma/home_manager/theme.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.ringofstorms.dePlasma;
|
||||
inherit (lib) mkIf;
|
||||
in
|
||||
{
|
||||
options = {};
|
||||
config = mkIf (cfg.enable && cfg.appearance.dark.enable) {
|
||||
programs.plasma = {
|
||||
workspace = {
|
||||
colorScheme = "Breeze Dark";
|
||||
lookAndFeel = "org.kde.breezedark.desktop";
|
||||
cursorTheme = "breeze_cursors";
|
||||
};
|
||||
fonts = { }; # keep defaults
|
||||
kscreenlocker = { }; # swaylock analog not applicable; left default
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue