Refactor gui module
This commit is contained in:
parent
edfe0e5bf9
commit
e65183b4a4
36 changed files with 236 additions and 309 deletions
|
|
@ -14,15 +14,12 @@
|
|||
inherit (email) address name;
|
||||
signKey = email.gpg.key;
|
||||
in {
|
||||
firefox.enable = true;
|
||||
fuzzel.enable = true;
|
||||
gpg.enable = true;
|
||||
git = {
|
||||
inherit name signKey;
|
||||
email = address;
|
||||
encrypt-credential = true;
|
||||
};
|
||||
zed-editor.enable = true;
|
||||
fish.enable = true;
|
||||
bash.enable = true;
|
||||
jujutsu = {
|
||||
|
|
@ -30,15 +27,9 @@
|
|||
inherit name signKey;
|
||||
email = address;
|
||||
};
|
||||
ghostty.enable = true;
|
||||
starship.enable = true;
|
||||
sops.enable = true;
|
||||
mpv.enable = true;
|
||||
atuin.enable = true;
|
||||
chromium.enable = true;
|
||||
thunderbird.enable = true;
|
||||
alacritty.enable = true;
|
||||
# espanso.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -46,8 +37,16 @@
|
|||
wallpaper.enable = true;
|
||||
accounts.email.enable = true;
|
||||
programs = {
|
||||
chromium.enable = true;
|
||||
thunderbird.enable = true;
|
||||
# espanso.enable = true;
|
||||
mpv.enable = true;
|
||||
ghostty.enable = true;
|
||||
zed-editor.enable = true;
|
||||
firefox.enable = true;
|
||||
helix.enable = true;
|
||||
openssh.enable = true;
|
||||
alacritty.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -14,10 +14,7 @@
|
|||
inherit (email) name address;
|
||||
signKey = email.gpg.key;
|
||||
in {
|
||||
zed-editor.enable = true;
|
||||
rustypaste-cli.enable = true;
|
||||
firefox.enable = true;
|
||||
fuzzel.enable = true;
|
||||
gpg.enable = true;
|
||||
jujutsu = {
|
||||
enable = true;
|
||||
|
|
@ -31,18 +28,11 @@
|
|||
};
|
||||
fish.enable = true;
|
||||
bash.enable = true;
|
||||
ghostty.enable = true;
|
||||
foot.enable = false;
|
||||
starship.enable = true;
|
||||
sops.enable = true;
|
||||
mpv.enable = true;
|
||||
kvm.enable = true;
|
||||
atuin.enable = true;
|
||||
thunderbird.enable = true;
|
||||
chromium.enable = true;
|
||||
espanso.enable = true;
|
||||
ion.enable = true;
|
||||
alacritty.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -50,6 +40,15 @@
|
|||
wallpaper.enable = true;
|
||||
accounts.email.enable = true;
|
||||
programs = {
|
||||
chromium.enable = true;
|
||||
espanso.enable = true;
|
||||
thunderbird.enable = true;
|
||||
foot.enable = false;
|
||||
mpv.enable = true;
|
||||
ghostty.enable = true;
|
||||
alacritty.enable = true;
|
||||
zed-editor.enable = true;
|
||||
firefox.enable = true;
|
||||
openssh.enable = true;
|
||||
helix.enable = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.alacritty;
|
||||
cfg = config.david.programs.alacritty;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.alacritty = {
|
||||
david.programs.alacritty = {
|
||||
enable = lib.mkEnableOption "alacritty";
|
||||
};
|
||||
};
|
||||
|
|
@ -3,10 +3,10 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.chromium;
|
||||
cfg = config.david.programs.chromium;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.chromium = {
|
||||
david.programs.chromium = {
|
||||
enable = lib.mkEnableOption "chromium";
|
||||
};
|
||||
};
|
||||
|
|
@ -4,5 +4,19 @@
|
|||
./niri
|
||||
./wluma
|
||||
./helix.nix
|
||||
./firefox.nix
|
||||
./waybar.nix
|
||||
./zed.nix
|
||||
./alacritty
|
||||
./ghostty.nix
|
||||
./fuzzel.nix
|
||||
./mpv.nix
|
||||
./swaylock.nix
|
||||
./thunderbird.nix
|
||||
./chromium.nix
|
||||
./foot
|
||||
./swaync.nix
|
||||
./espanso.nix
|
||||
./waypaper.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.espanso;
|
||||
cfg = config.david.programs.espanso;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.espanso = {
|
||||
david.programs.espanso = {
|
||||
enable = lib.mkEnableOption "espanso";
|
||||
};
|
||||
};
|
||||
|
|
@ -6,10 +6,10 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.firefox;
|
||||
cfg = config.david.programs.firefox;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.firefox = {
|
||||
david.programs.firefox = {
|
||||
enable = lib.mkEnableOption "firefox";
|
||||
};
|
||||
};
|
||||
|
|
@ -3,10 +3,10 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.foot;
|
||||
cfg = config.david.programs.foot;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.foot = {
|
||||
david.programs.foot = {
|
||||
enable = lib.mkEnableOption "foot";
|
||||
};
|
||||
};
|
||||
24
home/david/modules/programs/fuzzel.nix
Normal file
24
home/david/modules/programs/fuzzel.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.david.programs.fuzzel;
|
||||
in {
|
||||
options = {
|
||||
david.programs.fuzzel = {
|
||||
enable = lib.mkEnableOption "fuzzel";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
programs.fuzzel = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
prompt = "'λ '";
|
||||
dpi-aware = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -5,12 +5,12 @@
|
|||
...
|
||||
}: {
|
||||
options = {
|
||||
youthlic.programs.ghostty = {
|
||||
david.programs.ghostty = {
|
||||
enable = lib.mkEnableOption "ghostty";
|
||||
};
|
||||
};
|
||||
config = let
|
||||
cfg = config.youthlic.programs.ghostty;
|
||||
cfg = config.david.programs.ghostty;
|
||||
in (lib.mkIf cfg.enable {
|
||||
programs.ghostty = lib.mkMerge [
|
||||
{
|
||||
|
|
@ -12,6 +12,10 @@ in {
|
|||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
stylix.targets.helix.enable = false;
|
||||
programs.helix.settings = {
|
||||
theme = "gruvbox_dark_hard";
|
||||
};
|
||||
youthlic.programs.helix = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.mpv;
|
||||
cfg = config.david.programs.mpv;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.mpv = {
|
||||
david.programs.mpv = {
|
||||
enable = lib.mkEnableOption "mpv";
|
||||
};
|
||||
};
|
||||
|
|
@ -3,9 +3,11 @@
|
|||
lib,
|
||||
inputs,
|
||||
pkgs,
|
||||
osConfig ? null,
|
||||
...
|
||||
} @ args: let
|
||||
cfg = config.david.programs.niri;
|
||||
niri = osConfig.programs.niri.package;
|
||||
in {
|
||||
options = {
|
||||
david.programs.niri = {
|
||||
|
|
@ -17,16 +19,59 @@ in {
|
|||
};
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
david.programs.niri.enable = config.youthlic.programs.niri.enable;
|
||||
david.programs.niri.enable = osConfig.youthlic.gui.enabled == "niri";
|
||||
}
|
||||
(
|
||||
lib.mkIf cfg.enable {
|
||||
youthlic.programs.niri = {
|
||||
home.packages =
|
||||
(with pkgs; [
|
||||
swaynotificationcenter
|
||||
kdePackages.polkit-kde-agent-1
|
||||
wl-clipboard
|
||||
cliphist
|
||||
])
|
||||
++ [niri];
|
||||
qt = {
|
||||
enable = true;
|
||||
};
|
||||
xdg.portal = {
|
||||
configPackages = [niri];
|
||||
enable = true;
|
||||
extraPortals = lib.mkIf (
|
||||
!niri.cargoBuildNoDefaultFeatures || builtins.elem "xdp-gnome-screencast" niri.cargoBuildFeatures
|
||||
) [pkgs.xdg-desktop-portal-gnome];
|
||||
};
|
||||
xdg.configFile = let
|
||||
qtctConf =
|
||||
''
|
||||
[Appearance]
|
||||
standard_dialogs=xdgdesktopportal
|
||||
''
|
||||
+ lib.optionalString (config.qt.style ? name) ''
|
||||
style=${config.qt.style.name}
|
||||
'';
|
||||
in {
|
||||
"qt5ct/qt5ct.conf" = lib.mkForce {
|
||||
text = qtctConf;
|
||||
};
|
||||
"qt6ct/qt6ct.conf" = lib.mkForce {
|
||||
text = qtctConf;
|
||||
};
|
||||
};
|
||||
david.programs = {
|
||||
fuzzel.enable = true;
|
||||
waybar.enable = true;
|
||||
wluma.enable = true;
|
||||
swaync.enable = true;
|
||||
swaylock.enable = true;
|
||||
waypaper.enable = true;
|
||||
};
|
||||
programs.niri = {
|
||||
config =
|
||||
(lib.toList (import ./config.nix (args // {inherit pkgs;})))
|
||||
++ (lib.toList cfg.extraConfig);
|
||||
package = niri;
|
||||
};
|
||||
david.programs.wluma.enable = true;
|
||||
}
|
||||
)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.swaylock;
|
||||
cfg = config.david.programs.swaylock;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.swaylock = {
|
||||
david.programs.swaylock = {
|
||||
enable = lib.mkEnableOption "swaylock";
|
||||
};
|
||||
};
|
||||
|
|
@ -3,10 +3,10 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.swaync;
|
||||
cfg = config.david.programs.swaync;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.swaync = {
|
||||
david.programs.swaync = {
|
||||
enable = lib.mkEnableOption "swaync";
|
||||
systemd.enable = lib.mkEnableOption "systemd service for swaync";
|
||||
};
|
||||
|
|
@ -3,10 +3,10 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.thunderbird;
|
||||
cfg = config.david.programs.thunderbird;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.thunderbird = {
|
||||
david.programs.thunderbird = {
|
||||
enable = lib.mkEnableOption "thunderbird";
|
||||
};
|
||||
};
|
||||
|
|
@ -4,10 +4,10 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.waybar;
|
||||
cfg = config.david.programs.waybar;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.waybar = {
|
||||
david.programs.waybar = {
|
||||
enable = lib.mkEnableOption "waybar";
|
||||
};
|
||||
};
|
||||
|
|
@ -4,10 +4,10 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.waypaper;
|
||||
cfg = config.david.programs.waypaper;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.waypaper = {
|
||||
david.programs.waypaper = {
|
||||
enable = lib.mkEnableOption "waypaper";
|
||||
};
|
||||
};
|
||||
|
|
@ -11,6 +11,12 @@ in {
|
|||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
youthlic.programs.wluma.config = ./config.toml;
|
||||
services.wluma = {
|
||||
enable = true;
|
||||
settings = ./config.toml |> builtins.readFile |> builtins.fromTOML;
|
||||
systemd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.zed-editor;
|
||||
cfg = config.david.programs.zed-editor;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.zed-editor = {
|
||||
david.programs.zed-editor = {
|
||||
enable = lib.mkEnableOption "zed-editor";
|
||||
};
|
||||
};
|
||||
|
|
@ -1,36 +1,20 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./zed.nix
|
||||
./rustypaste-cli.nix
|
||||
./atuin.nix
|
||||
./firefox.nix
|
||||
./bash.nix
|
||||
./fish.nix
|
||||
./kvm.nix
|
||||
./ghostty.nix
|
||||
./wluma.nix
|
||||
./niri.nix
|
||||
./starship
|
||||
./fuzzel.nix
|
||||
./mpv.nix
|
||||
./swaylock.nix
|
||||
./thunderbird.nix
|
||||
./chromium.nix
|
||||
./gpg
|
||||
./foot
|
||||
./sops.nix
|
||||
./git.nix
|
||||
./swaync.nix
|
||||
./helix
|
||||
./waybar.nix
|
||||
./jujutsu.nix
|
||||
./espanso.nix
|
||||
./yazi.nix
|
||||
./zoxide.nix
|
||||
./fzf.nix
|
||||
./eza.nix
|
||||
./ion.nix
|
||||
./alacritty
|
||||
./waypaper.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.fuzzel;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.fuzzel = {
|
||||
enable = lib.mkEnableOption "fuzzel";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
programs.fuzzel = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
# font = "LXGW WenKai:size=11";
|
||||
prompt = "'λ '";
|
||||
dpi-aware = true;
|
||||
};
|
||||
# colors = {
|
||||
# background = "282a36dd";
|
||||
# text = "f8f8f2ff";
|
||||
# match = "8be9fdff";
|
||||
# selection-match = "8be9fdff";
|
||||
# selection = "44475add";
|
||||
# selection-text = "f8f8f2ff";
|
||||
# border = "bd93f9ff";
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
theme = "gruvbox_dark_hard"
|
||||
|
||||
[editor]
|
||||
line-number = "relative"
|
||||
cursorline = true
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
config = let
|
||||
cfg = config.youthlic.programs.helix;
|
||||
in {
|
||||
stylix.targets.helix.enable = false;
|
||||
programs.helix = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
|
|
|
|||
|
|
@ -1,76 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
osConfig ? null,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.niri;
|
||||
niri = osConfig.programs.niri.package;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.niri = {
|
||||
enable = lib.mkEnableOption "niri";
|
||||
config = lib.mkOption {
|
||||
type = inputs.niri-flake.lib.kdl.types.kdl-document;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
youthlic.programs.niri.enable = osConfig.youthlic.gui.enabled == "niri";
|
||||
}
|
||||
(
|
||||
lib.mkIf cfg.enable {
|
||||
home.packages =
|
||||
(with pkgs; [
|
||||
swaynotificationcenter
|
||||
kdePackages.polkit-kde-agent-1
|
||||
wl-clipboard
|
||||
cliphist
|
||||
])
|
||||
++ [niri];
|
||||
qt = {
|
||||
enable = true;
|
||||
};
|
||||
xdg.portal = {
|
||||
configPackages = [niri];
|
||||
enable = true;
|
||||
extraPortals = lib.mkIf (
|
||||
!niri.cargoBuildNoDefaultFeatures || builtins.elem "xdp-gnome-screencast" niri.cargoBuildFeatures
|
||||
) [pkgs.xdg-desktop-portal-gnome];
|
||||
};
|
||||
xdg.configFile = let
|
||||
qtctConf =
|
||||
''
|
||||
[Appearance]
|
||||
standard_dialogs=xdgdesktopportal
|
||||
''
|
||||
+ lib.optionalString (config.qt.style ? name) ''
|
||||
style=${config.qt.style.name}
|
||||
'';
|
||||
in {
|
||||
"qt5ct/qt5ct.conf" = lib.mkForce {
|
||||
text = qtctConf;
|
||||
};
|
||||
"qt6ct/qt6ct.conf" = lib.mkForce {
|
||||
text = qtctConf;
|
||||
};
|
||||
};
|
||||
youthlic.programs = {
|
||||
fuzzel.enable = true;
|
||||
wluma.enable = true;
|
||||
waybar.enable = true;
|
||||
swaync.enable = true;
|
||||
swaylock.enable = true;
|
||||
waypaper.enable = true;
|
||||
};
|
||||
programs.niri = {
|
||||
config = cfg.config;
|
||||
package = niri;
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.youthlic.programs.wluma;
|
||||
in {
|
||||
options = {
|
||||
youthlic.programs.wluma = {
|
||||
enable = lib.mkEnableOption "wluma";
|
||||
config = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
example = ./config.toml;
|
||||
description = ''
|
||||
path to config file of wluma
|
||||
'';
|
||||
};
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
example = pkgs.wluam;
|
||||
default = pkgs.wluma;
|
||||
description = ''
|
||||
package of wluma
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [
|
||||
cfg.package
|
||||
];
|
||||
xdg.configFile."wluma/config.toml" = {
|
||||
enable = true;
|
||||
source = cfg.config;
|
||||
};
|
||||
systemd.user.services.wluma = {
|
||||
Unit = {
|
||||
Description = "Adjusting screen brightness based on screen contents and amount of ambient light";
|
||||
PartOf = ["graphical-session.target"];
|
||||
After = ["graphical-session.target"];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = ["${lib.getExe cfg.package}"];
|
||||
Restart = "always";
|
||||
EnvironmentFile = ["-%E/wluma/service.conf"];
|
||||
PrivateNetwork = true;
|
||||
PrivateMounts = false;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["graphical-session.target"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue