steal from MaxMur

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-04-03 17:57:49 +03:00
parent f31ca59f58
commit 211e509628
11 changed files with 94 additions and 84 deletions

View File

@ -6,24 +6,25 @@
lib, lib,
... ...
}: let }: let
inherit (config.stylix) colors;
inherit (lib) mkIf mkEnableOption mkDefault mkForce getExe;
cfg = config.desktop.hyprland; cfg = config.desktop.hyprland;
hostname = osConfig.networking.hostName; hostname = osConfig.networking.hostName;
cursorSize = config.stylix.cursor.size; cursorSize = config.stylix.cursor.size;
fontName = config.stylix.fonts.sansSerif.name; fontName = config.stylix.fonts.sansSerif.name;
inherit (config.lib.stylix) colors;
keyboard = keyboard =
if hostname == "eldrid" if hostname == "eldrid"
then "chromeos" then "chromeos"
else "platform"; else "platform";
xdgPictures = xdgPictures =
config.xdg.userDirs.pictures; config.xdg.userDirs.pictures;
ifLaptop = lib.mkIf (hostname != "dunamis"); ifLaptop = mkIf (hostname != "dunamis");
in { in {
options = { options = {
desktop.hyprland.enable = desktop.hyprland.enable =
lib.mkEnableOption "enable hyprland desktop"; mkEnableOption "enable hyprland desktop";
}; };
config = lib.mkIf cfg.enable { config = mkIf cfg.enable {
stylix.targets.waybar.enable = false; stylix.targets.waybar.enable = false;
stylix.targets.hyprland.enable = false; stylix.targets.hyprland.enable = false;
stylix.targets.hyprlock.enable = false; stylix.targets.hyprlock.enable = false;
@ -507,7 +508,7 @@ in {
}; };
qt = { qt = {
enable = true; enable = true;
platformTheme.name = lib.mkDefault "gtk3"; platformTheme.name = mkDefault "gtk3";
}; };
dconf.settings = { dconf.settings = {
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
@ -1017,7 +1018,7 @@ in {
width = 300; width = 300;
height = 300; height = 300;
icon_theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; icon_theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}";
corner_radius = lib.mkDefault 9; corner_radius = mkDefault 9;
#corners = "top-right,bottom-left"; #corners = "top-right,bottom-left";
offset = "16x16"; offset = "16x16";
origin = "bottom-right"; origin = "bottom-right";
@ -1230,7 +1231,7 @@ in {
Service = Service =
graphicalService.Service graphicalService.Service
// { // {
Environment = lib.mkForce "QT_QPA_PLATFORM=wayland"; Environment = mkForce "QT_QPA_PLATFORM=wayland";
}; };
}; };
hyprpolkitagent = mkGraphicalService { hyprpolkitagent = mkGraphicalService {
@ -1252,7 +1253,7 @@ in {
// { // {
Type = "simple"; Type = "simple";
Slice = "session.slice"; Slice = "session.slice";
ExecStart = "${lib.getExe perSystem.hyprsunset.hyprsunset} -t 6500"; ExecStart = "${getExe perSystem.hyprsunset.hyprsunset} -t 6500";
}; };
}; };
}; };

View File

@ -5,9 +5,10 @@
lib, lib,
... ...
}: let }: let
cfg = config.desktop.niri; inherit (lib) mkIf mkEnableOption mkDefault mkForce getExe;
inherit (osConfig.networking) hostId; inherit (osConfig.networking) hostId;
inherit (config.lib.stylix) colors; inherit (config.stylix) colors;
cfg = config.desktop.niri;
cursorSize = config.stylix.cursor.size; cursorSize = config.stylix.cursor.size;
cursorName = config.stylix.cursor.name; cursorName = config.stylix.cursor.name;
keyboard = keyboard =
@ -16,18 +17,18 @@
else "platform"; else "platform";
xdgPics = xdgPics =
config.xdg.userDirs.pictures; config.xdg.userDirs.pictures;
ifLaptop = lib.mkIf (hostId != "c7f6c4a1"); ifLaptop = mkIf (hostId != "c7f6c4a1");
# TODO: make terminal depent on thing outside a module # TODO: make terminal depent on thing outside a module
terminal = lib.getExe pkgs.wezterm; terminal = getExe pkgs.wezterm;
launcher = lib.getExe pkgs.fuzzel; launcher = getExe pkgs.fuzzel;
browser = "app.zen_browser.zen"; browser = "app.zen_browser.zen";
lockscreen = lib.getExe pkgs.gtklock; lockscreen = getExe pkgs.gtklock;
in { in {
options = { options = {
desktop.niri.enable = desktop.niri.enable =
lib.mkEnableOption "enable niri desktop"; mkEnableOption "enable niri desktop";
}; };
config = lib.mkIf cfg.enable { config = mkIf cfg.enable {
stylix.targets = { stylix.targets = {
waybar.enable = false; waybar.enable = false;
wpaperd.enable = true; wpaperd.enable = true;
@ -274,7 +275,7 @@ in {
match-mode = "fuzzy"; match-mode = "fuzzy";
icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}";
}; };
border = lib.mkDefault { border = mkDefault {
width = 3; width = 3;
radius = 12; radius = 12;
}; };
@ -1039,7 +1040,7 @@ in {
Service = Service =
graphicalService.Service graphicalService.Service
// { // {
Environment = lib.mkForce "QT_QPA_PLATFORM=wayland"; Environment = mkForce "QT_QPA_PLATFORM=wayland";
}; };
}; };
xwayland-satellite = mkGraphicalService { xwayland-satellite = mkGraphicalService {
@ -1047,12 +1048,12 @@ in {
graphicalService.Service graphicalService.Service
// { // {
Type = "simple"; Type = "simple";
ExecStart = lib.getExe pkgs.xwayland-satellite + " :123"; ExecStart = getExe pkgs.xwayland-satellite + " :123";
}; };
}; };
wpaperd = mkGraphicalService { wpaperd = mkGraphicalService {
Service = Service =
lib.mkDefault graphicalService.Service; mkDefault graphicalService.Service;
}; };
gnome-polkit-agent = mkGraphicalService { gnome-polkit-agent = mkGraphicalService {
Service = Service =

View File

@ -3,8 +3,8 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; let inherit (lib) mkIf mkEnableOption;
cfg = config.console.joshuto; cfg = config.console.joshuto;
in { in {
options = { options = {
@ -204,7 +204,7 @@ in {
# ''; # '';
# }; # };
# in # in
lib.mkIf cfg.enable { mkIf cfg.enable {
home.packages = [pkgs.file]; home.packages = [pkgs.file];
programs.joshuto = { programs.joshuto = {
enable = true; enable = true;
@ -223,7 +223,7 @@ in {
column_ratio = [1 5 2]; column_ratio = [1 5 2];
}; };
preview = { preview = {
# preview_script = lib.getExe pkgs.pistol; # preview_script = getExe pkgs.pistol;
use_xdg_thumbs = true; use_xdg_thumbs = true;
xdg_thumb_size = "xxlarge"; xdg_thumb_size = "xxlarge";
}; };

View File

@ -3,8 +3,8 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; let inherit (lib) mkIf mkEnableOption getExe;
cfg = config.editor.helix; cfg = config.editor.helix;
in { in {
options = { options = {
@ -61,7 +61,7 @@ in {
}; };
}; };
languages = { languages = {
language-server = with lib; { language-server = {
clangd.command = "${pkgs.clang-tools}/bin/clangd"; clangd.command = "${pkgs.clang-tools}/bin/clangd";
markdown-oxide.command = getExe pkgs.markdown-oxide; markdown-oxide.command = getExe pkgs.markdown-oxide;
# nil.command = getExe pkgs.nil; # nil.command = getExe pkgs.nil;
@ -74,7 +74,7 @@ in {
{ {
name = "nix"; name = "nix";
auto-format = true; auto-format = true;
formatter.command = lib.getExe pkgs.alejandra; formatter.command = getExe pkgs.alejandra;
language-servers = ["nixd"]; language-servers = ["nixd"];
} }
# { # {
@ -86,7 +86,7 @@ in {
{ {
name = "typst"; name = "typst";
auto-format = true; auto-format = true;
formatter.command = lib.getExe pkgs.typstyle; formatter.command = getExe pkgs.typstyle;
language-servers = ["tinymist"]; language-servers = ["tinymist"];
} }
{ {
@ -109,7 +109,7 @@ in {
# name = "rust"; # name = "rust";
# auto-format = true; # auto-format = true;
# language-servers = ["rust-analyzer"]; # language-servers = ["rust-analyzer"];
# formatter.command = lib.getExe pkgs.rustfmt; # formatter.command = getExe pkgs.rustfmt;
# } # }
]; ];
}; };

View File

@ -1,15 +1,16 @@
{ {
pkgs,
# pkgs-51b85c,
lib,
config, config,
lib,
pkgs,
... ...
}: { }: let
inherit (lib) mkIf mkEnableOption;
in {
options = { options = {
editor.neovim.enable = editor.neovim.enable =
lib.mkEnableOption "enable neovim text editor"; mkEnableOption "enable neovim text editor";
}; };
config = lib.mkIf config.editors.neovim.enable { config = mkIf config.editors.neovim.enable {
# stylix.targets.nixvim.enable = true; # stylix.targets.nixvim.enable = true;
home.packages = with pkgs; [neovide]; home.packages = with pkgs; [neovide];
programs.nixvim = { programs.nixvim = {

View File

@ -3,8 +3,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: let
with lib; let inherit (lib) mkIf mkEnableOption mkForce getExe;
cfg = config.editor.zed; cfg = config.editor.zed;
in { in {
options = { options = {
@ -22,8 +22,8 @@ in {
]; ];
userSettings = { userSettings = {
vim_mode = true; vim_mode = true;
ui_font_size = lib.mkForce 16; ui_font_size = mkForce 16;
buffer_font_size = lib.mkForce 16; buffer_font_size = mkForce 16;
features = {inline_completion_provider = "none";}; features = {inline_completion_provider = "none";};
auto_update = false; auto_update = false;
languages = { languages = {
@ -33,13 +33,13 @@ in {
"nixd" "nixd"
]; ];
formatter = { formatter = {
external.command = lib.getExe pkgs.alejandra; external.command = getExe pkgs.alejandra;
}; };
}; };
"Rust" = { "Rust" = {
formatter = { formatter = {
external = { external = {
command = lib.getExe pkgs.rustfmt; command = getExe pkgs.rustfmt;
arguments = ["--edition" "2021"]; arguments = ["--edition" "2021"];
}; };
}; };
@ -49,7 +49,7 @@ in {
format_on_save = "on"; format_on_save = "on";
formatter = { formatter = {
external = { external = {
command = lib.getExe pkgs.typstyle; command = getExe pkgs.typstyle;
arguments = ["-i" "{buffer_path}"]; arguments = ["-i" "{buffer_path}"];
}; };
}; };
@ -76,39 +76,39 @@ in {
rust-analyzer = { rust-analyzer = {
binary = { binary = {
arguments = []; arguments = [];
path = lib.getExe pkgs.rust-analyzer; path = getExe pkgs.rust-analyzer;
}; };
}; };
ruff = { ruff = {
binary = { binary = {
arguments = []; arguments = [];
path = lib.getExe pkgs.ruff; path = getExe pkgs.ruff;
}; };
}; };
nixd = { nixd = {
binary = { binary = {
arguments = []; arguments = [];
path = lib.getExe pkgs.nixd; path = getExe pkgs.nixd;
}; };
initialization_options.formatting.command = [(lib.getExe pkgs.alejandra)]; initialization_options.formatting.command = [(getExe pkgs.alejandra)];
}; };
nil = { nil = {
binary = { binary = {
arguments = []; arguments = [];
path = lib.getExe pkgs.nil; path = getExe pkgs.nil;
}; };
initialization_options.formatting.command = [(lib.getExe pkgs.alejandra)]; initialization_options.formatting.command = [(getExe pkgs.alejandra)];
}; };
texlab = { texlab = {
binary = { binary = {
arguments = []; arguments = [];
path = lib.getExe pkgs.texlab; path = getExe pkgs.texlab;
}; };
}; };
tinymist = { tinymist = {
binary = { binary = {
arguments = []; arguments = [];
path = lib.getExe pkgs.tinymist; path = getExe pkgs.tinymist;
}; };
}; };
}; };

View File

@ -5,6 +5,7 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption;
cfg = config.desktop.cosmic; cfg = config.desktop.cosmic;
in { in {
imports = with inputs; [ imports = with inputs; [
@ -12,9 +13,9 @@ in {
]; ];
options = { options = {
desktop.cosmic.enable = desktop.cosmic.enable =
lib.mkEnableOption "enable cosmic desktop"; mkEnableOption "enable cosmic desktop";
}; };
config = lib.mkIf cfg.enable { config = mkIf cfg.enable {
sound.pipewire.enable = true; sound.pipewire.enable = true;
nix.settings = { nix.settings = {
substituters = ["https://cosmic.cachix.org/"]; substituters = ["https://cosmic.cachix.org/"];

View File

@ -2,27 +2,31 @@
config, config,
lib, lib,
... ...
}: { }: let
inherit (lib) mkIf mkEnableOption;
in {
options = { options = {
locale.ukrainian.enable = locale.ukrainian.enable =
lib.mkEnableOption "enables ukrainian locale"; mkEnableOption "enables ukrainian locale";
}; };
config = lib.mkIf config.locale.ukrainian.enable { config = mkIf config.locale.ukrainian.enable {
i18n = { i18n = let
defaultLocale = "uk_UA.UTF-8"; locale = "uk_UA.UTF-8";
in {
defaultLocale = locale;
extraLocaleSettings = { extraLocaleSettings = {
LC_CTYPE = "uk_UA.UTF-8"; LC_ADDRESS = locale;
LC_NUMERIC = "uk_UA.UTF-8";
LC_TIME = "uk_UA.UTF-8";
LC_COLLATE = "en_US.UTF-8"; LC_COLLATE = "en_US.UTF-8";
LC_MONETARY = "uk_UA.UTF-8"; LC_CTYPE = locale;
LC_MESSAGES = "uk_UA.UTF-8"; LC_IDENTIFICATION = locale;
LC_PAPER = "uk_UA.UTF-8"; LC_MEASUREMENT = locale;
LC_NAME = "uk_UA.UTF-8"; LC_MESSAGES = locale;
LC_ADDRESS = "uk_UA.UTF-8"; LC_MONETARY = locale;
LC_TELEPHONE = "uk_UA.UTF-8"; LC_NAME = locale;
LC_MEASUREMENT = "uk_UA.UTF-8"; LC_NUMERIC = locale;
LC_IDENTIFICATION = "uk_UA.UTF-8"; LC_PAPER = locale;
LC_TELEPHONE = locale;
LC_TIME = locale;
}; };
}; };
}; };

View File

@ -2,12 +2,14 @@
config, config,
lib, lib,
... ...
}: { }: let
inherit (lib) mkIf mkEnableOption;
in {
options = { options = {
opentabletdriver.enable = opentabletdriver.enable =
lib.mkEnableOption "enables opentabletdriver"; mkEnableOption "enables opentabletdriver";
}; };
config = lib.mkIf config.opentabletdriver.enable { config = mkIf config.opentabletdriver.enable {
hardware.opentabletdriver = { hardware.opentabletdriver = {
enable = true; enable = true;
daemon.enable = true; daemon.enable = true;

View File

@ -1,16 +1,16 @@
{ {
pkgs,
lib,
config, config,
lib,
... ...
}: { }: let
inherit (lib) mkIf mkEnableOption;
in {
options = { options = {
qmk-vial.enable = qmk-vial.enable =
lib.mkEnableOption "adds a udev rule for vial keyboards"; mkEnableOption "adds a udev rule for vial keyboards";
}; };
config = lib.mkIf config.qmk-vial.enable { config = mkIf config.qmk-vial.enable {
services.udev.extraRules = '' services.udev.extraRules = ''
#vial rule
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
''; '';
}; };

View File

@ -3,15 +3,15 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; let inherit (lib) mkIf mkEnableOption mkDefault;
cfg = config.security.basic; cfg = config.security.basic;
in { in {
options = { options = {
security.basic.enable = security.basic.enable =
lib.mkEnableOption "enable basic security"; mkEnableOption "enable basic security";
}; };
config = lib.mkIf cfg.enable { config = mkIf cfg.enable {
security = { security = {
sudo.enable = false; sudo.enable = false;
# doas.enable = true; # doas.enable = true;
@ -36,7 +36,7 @@ in {
} }
}); });
''; '';
apparmor.enable = lib.mkDefault true; apparmor.enable = mkDefault true;
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -85,6 +85,6 @@ in {
"ufs" "ufs"
]; ];
nix.settings.allowed-users = lib.mkDefault ["@users"]; nix.settings.allowed-users = mkDefault ["@users"];
}; };
} }