move all home level programs to progems dir

This commit is contained in:
ulic-youthlic 2025-02-01 18:43:49 +08:00
parent 77d70dcf2e
commit bc450a9fe7
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
27 changed files with 27 additions and 21 deletions

View file

@ -0,0 +1,39 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.atuin;
in
{
options = {
youthlic.programs.atuin = {
enable = lib.mkEnableOption "atuin";
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
programs.atuin = {
daemon = {
enable = true;
logLevel = "trace";
};
enable = true;
settings = {
auto_sync = true;
update_check = false;
style = "full";
history_filter = [
"^ .*"
];
enter_accept = false;
keymap_mode = "vim-insert";
sync.records = true;
};
};
})
(lib.mkIf config.youthlic.programs.fish.enable {
programs.atuin.enableFishIntegration = true;
})
(lib.mkIf config.youthlic.programs.bash.enable {
programs.atuin.enableBashIntegration = true;
})
];
}

View file

@ -0,0 +1,21 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.chromium;
in
{
options = {
youthlic.programs.chromium = {
enable = lib.mkEnableOption "chromium";
};
};
config = lib.mkIf cfg.enable {
programs.chromium = {
enable = true;
commandLineArgs = [
"--ozone-platform=wayland"
"--enable-wayland-ime=true"
"--enable-features=UseOzonePlatform"
];
};
};
}

View file

@ -0,0 +1,26 @@
{ ... }:
{
imports = [
./atuin.nix
./firefox.nix
./shell
./kvm.nix
./ghostty.nix
./wluma.nix
./niri.nix
./starship
./obs.nix
./fuzzel.nix
./mpv.nix
./swaylock.nix
./thunderbird.nix
./chromium.nix
./gpg
./foot
./sops.nix
./git.nix
./swaync.nix
./helix
./waybar.nix
];
}

View file

@ -0,0 +1,138 @@
{
pkgs,
outputs,
system,
lib,
config,
...
}:
let
cfg = config.youthlic.programs.firefox;
in
{
options = {
youthlic.programs.firefox = {
enable = lib.mkEnableOption "firefox";
};
};
config = lib.mkIf cfg.enable {
programs.firefox = {
enable = true;
languagePacks = [
"zh-CN"
"en-US"
];
profiles.default = {
name = "default";
isDefault = true;
extensions = with outputs.packages."${system}"; [
immersive-translate
tridactyl
];
search = {
force = true;
default = "DuckDuckGo";
engines = {
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"Nix Options" = {
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "channel";
value = "unstable";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [
{
template = "https://home-manager-options.extranix.com";
params = [
{
name = "query";
value = "{searchTerms}";
}
{
name = "release";
value = "master";
}
];
}
];
definedAliases = [ "hm" ];
};
"NUR Packages" = {
urls = [
{
template = "https://nur.nix-community.org/";
}
];
definedAliases = [ "nu" ];
};
"Nix Flakes" = {
urls = [
{
template = "https://search.nixos.org/flakes";
params = [
{
name = "channel";
value = "unstable";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
definedAliases = [ "nf" ];
};
"NixOS Wiki" = {
urls = [
{
template = "https://nixos.wiki/index.php";
params = [
{
name = "search";
value = "{searchTerms}";
}
];
}
];
definedAliases = [ "nw" ];
};
"Bing".metaData.hidden = true;
"Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias
};
};
};
};
};
}

View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.foot;
in
{
options = {
youthlic.programs.foot = {
enable = lib.mkEnableOption "foot";
};
};
config = lib.mkIf cfg.enable {
programs.foot = {
enable = true;
server.enable = true;
settings = builtins.fromINI (builtins.readFile ./foot.ini);
};
};
}

View file

@ -0,0 +1,256 @@
# -*- conf -*-
# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd)
term=foot
# login-shell=no
# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode
# title=foot
# locked-title=no
font=FiraCode Nerd Font:size=15:lang=en-US
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
# font-size-adjustment=0.5
# line-height=<font metrics>
# letter-spacing=0
horizontal-letter-offset=0
vertical-letter-offset=0
# underline-offset=<font metrics>
# underline-thickness=<font underline thickness>
# strikeout-thickness=<font strikeout thickness>
# box-drawings-uses-font-glyphs=no
dpi-aware=yes
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
# initial-window-mode=windowed
# pad=0x0
# resize-by-cells=yes
# resize-keep-grid=yes
# resize-delay-ms=100
# bold-text-in-bright=no
# word-delimiters=,│`|:"'()[]{}<>
selection-target=clipboard
# workers=<number of logical CPUs>
# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is libutempter (Linux)
# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ulog (FreeBSD)
[environment]
# name=value
[bell]
# urgent=no
# notify=no
# visual=no
# command=
# command-focused=no
[desktop-notifications]
# command=notify-send --wait --app-name ${app-id} --icon ${app-id} --category ${category} --urgency ${urgency} --expire-time ${expire-time} --hint STRING:image-path:${icon} --hint BOOLEAN:suppress-sound:${muted} --hint STRING:sound-name:${sound-name} --replace-id ${replace-id} ${action-argument} --print-id -- ${title} ${body}
# command-action-argument=--action ${action-name}=${action-label}
# close=""
# inhibit-when-focused=yes
[scrollback]
# lines=1000
# multiplier=3.0
# indicator-position=relative
# indicator-format=""
[url]
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
# protocols=http, https, ftp, ftps, file, gemini, gopher
# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]
[cursor]
style=beam # block
# color=<inverse foreground/background>
# blink=no
# blink-rate=500
# beam-thickness=1.5
# underline-thickness=<font underline thickness>
[mouse]
hide-when-typing=yes
# alternate-scroll-mode=yes
[touch]
# long-press-delay=400
[colors]
# alpha=1.0
# background=242424
# foreground=ffffff
# flash=7f7f00
# flash-alpha=0.5
## Normal/regular colors (color palette 0-7)
# regular0=242424 # black
# regular1=f62b5a # red
# regular2=47b413 # green
# regular3=e3c401 # yellow
# regular4=24acd4 # blue
# regular5=f2affd # magenta
# regular6=13c299 # cyan
# regular7=e6e6e6 # white
## Bright colors (color palette 8-15)
# bright0=616161 # bright black
# bright1=ff4d51 # bright red
# bright2=35d450 # bright green
# bright3=e9e836 # bright yellow
# bright4=5dc5f8 # bright blue
# bright5=feabf2 # bright magenta
# bright6=24dfc4 # bright cyan
# bright7=ffffff # bright white
## dimmed colors (see foot.ini(5) man page)
# dim0=<not set>
# ...
# dim7=<not-set>
## The remaining 256-color palette
# 16 = <256-color palette #16>
# ...
# 255 = <256-color palette #255>
## Sixel colors
# sixel0 = 000000
# sixel1 = 3333cc
# sixel2 = cc2121
# sixel3 = 33cc33
# sixel4 = cc33cc
# sixel5 = 33cccc
# sixel6 = cccc33
# sixel7 = 878787
# sixel8 = 424242
# sixel9 = 545499
# sixel10 = 994242
# sixel11 = 549954
# sixel12 = 995499
# sixel13 = 549999
# sixel14 = 999954
# sixel15 = cccccc
## Misc colors
# selection-foreground=<inverse foreground/background>
# selection-background=<inverse foreground/background>
# jump-labels=<regular0> <regular3> # black-on-yellow
# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue
# search-box-no-match=<regular0> <regular1> # black-on-red
# search-box-match=<regular0> <regular3> # black-on-yellow
# urls=<regular3>
[csd]
# preferred=server
# size=26
# font=<primary font>
# color=<foreground color>
# hide-when-maximized=no
# double-click-to-maximize=yes
# border-width=0
# border-color=<csd.color>
# button-width=26
# button-color=<background color>
# button-minimize-color=<regular4>
# button-maximize-color=<regular2>
# button-close-color=<regular1>
[key-bindings]
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
# clipboard-copy=Control+Shift+c XF86Copy
# clipboard-paste=Control+Shift+v XF86Paste
# primary-paste=Shift+Insert
# search-start=Control+Shift+r
# font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n
# minimize=none
# maximize=none
# fullscreen=none
# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-selected=[xargs -r firefox] none
# pipe-command-output=[wl-copy] none # Copy last command's output to the clipboard
# show-urls-launch=Control+Shift+o
# show-urls-copy=none
# show-urls-persistent=none
# prompt-prev=Control+Shift+z
# prompt-next=Control+Shift+x
# unicode-input=Control+Shift+u
# noop=none
# quit=none
[search-bindings]
# cancel=Control+g Control+c Escape
# commit=Return
# find-prev=Control+r
# find-next=Control+s
# cursor-left=Left Control+b
# cursor-left-word=Control+Left Mod1+b
# cursor-right=Right Control+f
# cursor-right-word=Control+Right Mod1+f
# cursor-home=Home Control+a
# cursor-end=End Control+e
# delete-prev=BackSpace
# delete-prev-word=Mod1+BackSpace Control+BackSpace
# delete-next=Delete
# delete-next-word=Mod1+d Control+Delete
# extend-char=Shift+Right
# extend-to-word-boundary=Control+w Control+Shift+Right
# extend-to-next-whitespace=Control+Shift+w
# extend-line-down=Shift+Down
# extend-backward-char=Shift+Left
# extend-backward-to-word-boundary=Control+Shift+Left
# extend-backward-to-next-whitespace=none
# extend-line-up=Shift+Up
# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste
# primary-paste=Shift+Insert
# unicode-input=none
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
[url-bindings]
# cancel=Control+g Control+c Control+d Escape
# toggle-url-visible=t
[text-bindings]
# \x03=Mod4+c # Map Super+c -> Ctrl+c
[mouse-bindings]
# scrollback-up-mouse=BTN_WHEEL_BACK
# scrollback-down-mouse=BTN_WHEEL_FORWARD
# font-increase=Control+BTN_WHEEL_BACK
# font-decrease=Control+BTN_WHEEL_FORWARD
# selection-override-modifiers=Shift
# primary-paste=BTN_MIDDLE
# select-begin=BTN_LEFT
# select-begin-block=Control+BTN_LEFT
# select-extend=BTN_RIGHT
# select-extend-character-wise=Control+BTN_RIGHT
# select-word=BTN_LEFT-2
# select-word-whitespace=Control+BTN_LEFT-2
# select-quote = BTN_LEFT-3
# select-row=BTN_LEFT-4
# vim: ft=dosini

View file

@ -0,0 +1,32 @@
{ 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";
# };
};
};
};
}

View file

@ -0,0 +1,55 @@
{
pkgs,
config,
lib,
...
}:
{
options = {
youthlic.programs.ghostty = {
enable = lib.mkEnableOption "ghostty";
};
};
config =
let
cfg = config.youthlic.programs.ghostty;
in
(lib.mkIf cfg.enable {
programs.ghostty = lib.mkMerge [
{
enable = true;
package = pkgs.ghostty;
settings = {
# font-family = "FiraCode Nerd Font";
font-feature = [
"calt=1"
"clig=1"
"liga=1"
"cv01"
"cv02"
"cv06"
"zero"
"onum"
"cv17"
"ss05"
"ss03"
"cv16"
"cv31"
"cv29"
"cv30"
];
font-size = 17;
# theme = "ayu";
background-opacity = 0.8;
confirm-close-surface = "false";
};
}
(lib.mkIf config.youthlic.programs.fish.enable {
enableFishIntegration = true;
})
(lib.mkIf config.youthlic.programs.bash.enable {
enableBashIntegration = true;
})
];
});
}

View file

@ -0,0 +1,82 @@
{
config,
lib,
...
}:
{
options = {
youthlic.programs.git = {
email = lib.mkOption {
type = lib.types.str;
description = ''
git email
'';
};
name = lib.mkOption {
type = lib.types.str;
example = ''youthlic'';
description = ''
git name
'';
};
signKey = lib.mkOption {
type = lib.types.addCheck (lib.types.nullOr lib.types.str) (
x: (x == null || config.youthlic.programs.gpg.enable)
);
default = null;
description = ''
key fingerprint for sign commit
'';
};
encrypt-credential = lib.mkEnableOption "encrypt git credential";
};
};
config =
let
cfg = config.youthlic.programs.git;
in
lib.mkMerge [
{
programs.lazygit = {
enable = true;
};
programs.gh = {
enable = true;
gitCredentialHelper.enable = true;
settings = {
git_protocol = "ssh";
};
};
programs.git = {
enable = true;
userEmail = cfg.email;
userName = cfg.name;
delta = {
enable = true;
options = {
line-number = true;
hyperlinks = true;
side-by-side = true;
};
};
lfs.enable = true;
};
}
(lib.mkIf (cfg.signKey != null) {
programs.git.signing = {
signByDefault = true;
key = cfg.signKey;
};
})
(lib.mkIf cfg.encrypt-credential {
programs.git.extraConfig = {
credential = {
helper = "store --file=${config.sops.secrets."git-credential".path}";
};
};
sops.secrets."git-credential" = {
mode = "0640";
};
})
];
}

View file

@ -0,0 +1,47 @@
{
pkgs,
config,
lib,
outputs,
...
}:
{
options = {
youthlic.programs.gpg = {
enable = lib.mkEnableOption "gpg";
};
};
config =
let
cfg = config.youthlic.programs.gpg;
in
lib.mkIf cfg.enable {
services.gpg-agent = lib.mkMerge [
{
enable = true;
enableSshSupport = true;
pinentryPackage = outputs.packages."${pkgs.system}".pinentry-selector;
sshKeys = [
"C817E333BF88F16EA0F7ADE27BDCCC16AD25E5A6"
];
}
(lib.mkIf config.youthlic.programs.fish.enable {
enableFishIntegration = true;
})
(lib.mkIf config.youthlic.programs.bash.enable {
enableBashIntegration = true;
})
];
programs.gpg = {
enable = true;
mutableKeys = true;
mutableTrust = true;
publicKeys = [
{
source = ./public-key.txt;
trust = "ultimate";
}
];
};
};
}

View file

@ -0,0 +1,23 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEZ4EP8BYJKwYBBAHaRw8BAQdAKGtsoTz2OMi6ZaUyE2IuGFuOniKDLX7WI5OH
iPoaH+K0LXlvdXRobGljIChtYWluIGtleSkgPHVsaWMueW91dGhsaWNAZ21haWwu
Y29tPoiTBBMWCgA7FiEExvy9f0nhy7q9ZmH3/AIGPwQzGpUFAmeBD/ACGwEFCwkI
BwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQ/AIGPwQzGpUEWwD+IMXd5CYtwkJD
GWv7w4LB8SkmMkzSAtCfn0rsLk5AAsUBAIHZGP869EO+MsiyzzbYzKEYeoULECc5
RSu4kvcTIAoDuDMEZ4EQHRYJKwYBBAHaRw8BAQdAnmKX2VX5V1XJyI5J91KiqAk+
bgssUJ5LUq+4RtJBguWI7wQYFgoAIBYhBMb8vX9J4cu6vWZh9/wCBj8EMxqVBQJn
gRAdAhsCAIEJEPwCBj8EMxqVdiAEGRYKAB0WIQQYMd5Sc/DTvN/HQadj6Gw8FKDX
IQUCZ4EQHQAKCRBj6Gw8FKDXISn7AP9CF4qs4EtwOqE/ghFrF4LxloGvIz9iPssI
5g1GrFE2awD/QM7ltH6lPgMNfa6/+fQeERWiz5jXCks/Cl/Sb+ydIAr0dQD/dQQH
MpFGntmx0vkhoZnx34sGHyjTwPM2lHHJMYwrmRcBAKqSa5mVb/wpDcR0CNyfusjC
HxQM6MgBQouDLP+ANtsMuDgEZ4EQORIKKwYBBAGXVQEFAQEHQCqKIhwfA/Jf5pNl
KZ60KG1rMwuE2jBM/buKmVK51xczAwEIB4h4BBgWCgAgFiEExvy9f0nhy7q9ZmH3
/AIGPwQzGpUFAmeBEDkCGwwACgkQ/AIGPwQzGpXbiQEAwRhX1oMVLzsruiKVqNL+
rMq+U6kTuadbh9fJAjCQ9QEA/AjFXS7hNvrsxzv3O+8P1nOZOMKB9p1aM2EDgpF7
q0QNuDMEZ4EZ/xYJKwYBBAHaRw8BAQdAsw7WxrMq/qv2tvLRsGhCdauGAoL8L91b
TJQmvqWADjCIeAQYFgoAIBYhBMb8vX9J4cu6vWZh9/wCBj8EMxqVBQJngRn/Ahsg
AAoJEPwCBj8EMxqVSe0A/0vlCUek4APS09osNpUyLWcboq9x7Jw4ycChcqDTfweP
AQCRDLL8wMjSlwONCLmERl8KoXnQhaEz/f3TiInUYbdkCw==
=Rq0o
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -0,0 +1,85 @@
# theme = "ayu_evolve" # avoid conflicting with stylix
[editor]
line-number = "relative"
cursorline = true
cursorcolumn = false
true-color = true
undercurl = true
bufferline = "multiple"
color-modes = true
default-line-ending = "lf"
popup-border = "all"
[editor.statusline]
left = [
"mode",
"spacer",
"version-control",
"file-type",
"separator",
"read-only-indicator",
"file-name",
"file-modification-indicator",
"spacer",
"spinner",
]
center = ["diagnostics"]
right = [
"register",
"file-line-ending",
"file-encoding",
"separator",
"total-line-numbers",
"position",
"position-percentage",
]
separator = "|"
mode.normal = "NORMAL"
mode.insert = "INSERT"
mode.select = "SELECT"
[editor.lsp]
display-messages = true
display-inlay-hints = true
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[editor.file-picker]
hidden = false
[editor.auto-save]
focus-lost = true
after-delay.enable = true
[editor.whitespace.render]
space = "none"
tab = "all"
nbsp = "all"
newline = "none"
[editor.whitespace.characters]
space = "·"
nbsp = "⍽"
tab = "→"
newline = "⏎"
tabpad = "·"
[editor.indent-guides]
render = true
[editor.gutters]
layout = ["diagnostics", "spacer", "line-numbers", "spacer", "diff"]
line-numbers.min-width = 1
[editor.soft-wrap]
enable = true
wrap-at-text-width = true
[editor.inline-diagnostics]
cursor-line = "hint"
other-lines = "error"
prefix-len = 2

View file

@ -0,0 +1,256 @@
{
lib,
pkgs,
config,
...
}:
{
options = {
youthlic.programs.helix = {
enable = lib.mkEnableOption "helix";
extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
example = (
with pkgs;
[
deno
]
);
description = ''
extra packages for helix lsp and formatter
'';
};
};
};
config =
let
cfg = config.youthlic.programs.helix;
in
{
programs.helix = lib.mkIf cfg.enable {
enable = true;
defaultEditor = true;
extraPackages = cfg.extraPackages;
settings =
let
config-file = builtins.readFile ./config.toml;
config = builtins.fromTOML config-file;
in
config;
languages = {
language-server = {
neocmakelsp = {
command = "neocmakelsp";
args = [
"stdio"
];
};
fish-lsp = {
command = "fish-lsp";
args = [
"start"
];
};
};
language = [
{
name = "cmake";
language-servers = [
"neocmakelsp"
"cmake-language-server"
];
}
{
name = "kdl";
formatter = {
command = "kdlfmt";
args = [
"format"
"-"
];
};
}
{
name = "just";
formatter = {
command = "just";
args = [
"--dump"
];
};
}
{
name = "nix";
formatter = {
command = "nixfmt";
args = [ "-" ];
};
}
{
name = "xml";
formatter = {
command = "xmllint";
args = [
"--format"
"-"
];
};
}
{
name = "typst";
formatter = {
command = "typstyle";
};
}
{
name = "c";
formatter = {
command = "clang-format";
};
}
{
name = "cpp";
formatter = {
command = "clang-format";
};
}
{
name = "python";
formatter = {
command = "ruff";
args = [
"format"
"-s"
"--line-length"
"88"
"-"
];
};
language-servers = [
"pyright"
"ruff"
];
}
{
name = "go";
formatter = {
command = "goimports";
};
}
{
name = "awk";
formatter = {
command = "awk";
timeout = 5;
args = [
"--file=/dev/stdin"
"--pretty-print=/dev/stdout"
];
};
}
{
name = "fish";
language-servers = [
"fish-lsp"
];
}
{
name = "yaml";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"yaml"
];
};
}
{
name = "html";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"html"
];
};
language-servers = [
"vscode-html-language-server"
];
}
{
name = "css";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"css"
];
};
language-servers = [
"vscode-css-language-server"
];
}
{
name = "toml";
formatter = {
command = "taplo";
args = [
"fmt"
"-"
];
};
}
{
name = "markdown";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"md"
];
};
}
{
name = "json";
language-servers = [
"vscode-json-language-server"
];
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"json"
];
};
}
{
name = "jsonc";
language-servers = [
"vscode-json-language-server"
];
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"jsonc"
];
};
}
];
};
};
};
}

View file

@ -0,0 +1,21 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.kvm;
in
{
options = {
youthlic.programs.kvm = {
enable = lib.mkEnableOption "kvm";
};
};
config = lib.mkIf cfg.enable {
dconf = {
settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
};
};
};
};
}

View file

@ -0,0 +1,16 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.mpv;
in
{
options = {
youthlic.programs.mpv = {
enable = lib.mkEnableOption "mpv";
};
};
config = lib.mkIf cfg.enable {
programs.mpv = {
enable = true;
};
};
}

View file

@ -0,0 +1,45 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.youthlic.programs.niri;
in
{
options = {
youthlic.programs.niri = {
enable = lib.mkEnableOption "niri";
config = lib.mkOption {
type = lib.types.path;
example = ./config.kdl;
description = ''
the pach to config.kdl
'';
};
};
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
swaynotificationcenter
swaybg
xwayland-satellite
niri-unstable
polkit-kde-agent
wl-clipboard
cliphist
];
youthlic.programs = {
fuzzel.enable = true;
wluma.enable = true;
waybar.enable = true;
swaync.enable = true;
swaylock.enable = true;
};
programs.niri = {
config = builtins.readFile cfg.config;
package = pkgs.niri-unstable;
};
};
}

View file

@ -0,0 +1,25 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.youthlic.programs.obs;
in
{
options = {
youthlic.programs.obs = {
enable = lib.mkEnableOption "obs";
};
};
config = lib.mkIf cfg.enable {
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-source-record
input-overlay
];
};
};
}

View file

@ -0,0 +1,76 @@
{ config, lib, ... }:
let
inherit (lib) mkEnableOption mkIf mkMerge;
fish-cfg = config.youthlic.programs.fish;
bash-cfg = config.youthlic.programs.bash;
cfg-helper =
conf:
mkMerge [
conf
(mkIf fish-cfg.enable {
enableFishIntegration = true;
})
(mkIf bash-cfg.enable {
enableBashIntegration = true;
})
];
in
{
options = {
youthlic.programs = {
fish = {
enable =mkEnableOption "fish";
};
bash = {
enable = mkEnableOption "bash";
};
};
};
config = mkMerge [
{
programs = {
zoxide = cfg-helper {
enable = true;
};
yazi = cfg-helper {
enable = true;
};
fzf = cfg-helper {
enable = true;
};
eza = cfg-helper {
enable = true;
};
};
}
(mkIf fish-cfg.enable {
programs = {
fish = {
enable = true;
interactiveShellInit = ''
fish_vi_key_bindings
'';
functions = {
__fish_command_not_found_handler = {
body = "__fish_default_command_not_found_handler $argv[1]";
onEvent = "fish_command_not_found";
};
fish_greeting = {
body = ''
fastfetch
'';
};
};
};
fastfetch.enable = true;
};
})
(mkIf bash-cfg.enable {
programs = {
bash = {
enable = true;
};
};
})
];
}

View file

@ -0,0 +1,48 @@
{
lib,
config,
pkgs,
rootPath,
...
}:
{
options = {
youthlic.programs.sops = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = ''
whether enable sops-nix or not
'';
};
keyFile = lib.mkOption {
type = lib.types.nonEmptyStr;
default = "/var/sops/key.txt";
description = ''
path to age key file
'';
};
};
};
config =
let
cfg = config.youthlic.programs.sops;
in
lib.mkIf cfg.enable {
home.packages = (
with pkgs;
[
sops
age
]
);
sops = {
age = {
keyFile = cfg.keyFile;
generateKey = false;
};
defaultSopsFile = rootPath + "/secrets/general.yaml";
};
};
}

View file

@ -0,0 +1,213 @@
"$schema" = 'https://starship.rs/config-schema.json'
[character]
success_symbol = '[λ](bold blue)'
error_symbol = '[λ](bold red)'
vimcmd_symbol = '[Λ](bold blue)'
vimcmd_replace_one_symbol = '[Λ](bold purple)'
vimcmd_replace_symbol = '[Λ](bold purple)'
vimcmd_visual_symbol = '[Λ](bold yellow)'
[[battery.display]]
threshold = 10
style = 'bold red'
[[battery.display]]
threshold = 30
style = 'bold yellow'
discharging_symbol = '💦'
[[battery.display]]
threshold = 100
style = 'green'
[git_branch]
format = 'on [$symbol$branch(:$remote_branch)]($style) '
symbol = " "
[git_status]
diverged = '⇕⇡${ahead_count}⇣${behind_count}'
conflicted = "[⚔️${count}](red)"
ahead = '[⇡${count}](bold green)'
behind = '[⇣${count}](bold yellow)'
untracked = '[!${count}](red)'
stashed = "[📦${count}](purple)"
modified = '[M${count}](bold yellow)'
staged = "[+${count}](green)"
renamed = "[»${count}](bold yellow)"
deleted = '[-${count}](blue)'
up_to_date = '[✓](green)'
format = '([(\[$all_status\])(\[$ahead_behind\])]($style) ) '
[git_commit]
format = '([\($hash$tag\)]($style) )'
only_detached = false
[directory]
fish_style_pwd_dir_length = 2
truncation_length = 2
truncate_to_repo = false
repo_root_style = "bold green"
use_os_path_sep = false
read_only = " 󰌾"
[aws]
symbol = " "
[buf]
symbol = " "
[c]
symbol = " "
[conda]
symbol = " "
[crystal]
symbol = " "
[dart]
symbol = " "
[docker_context]
symbol = " "
[elixir]
symbol = " "
[elm]
symbol = " "
[fennel]
symbol = " "
[fossil_branch]
symbol = " "
[golang]
symbol = " "
[guix_shell]
symbol = " "
[haskell]
symbol = " "
[haxe]
symbol = " "
[hg_branch]
symbol = " "
[hostname]
ssh_symbol = " "
[java]
symbol = " "
[julia]
symbol = " "
[kotlin]
symbol = " "
[lua]
symbol = " "
[memory_usage]
symbol = "󰍛 "
[meson]
symbol = "󰔷 "
[nim]
symbol = "󰆥 "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
[ocaml]
symbol = " "
[os.symbols]
Alpaquita = " "
Alpine = " "
AlmaLinux = " "
Amazon = " "
Android = " "
Arch = " "
Artix = " "
CentOS = " "
Debian = " "
DragonFly = " "
Emscripten = " "
EndeavourOS = " "
Fedora = " "
FreeBSD = " "
Garuda = "󰛓 "
Gentoo = " "
HardenedBSD = "󰞌 "
Illumos = "󰈸 "
Kali = " "
Linux = " "
Mabox = " "
Macos = " "
Manjaro = " "
Mariner = " "
MidnightBSD = " "
Mint = " "
NetBSD = " "
NixOS = " "
OpenBSD = "󰈺 "
openSUSE = " "
OracleLinux = "󰌷 "
Pop = " "
Raspbian = " "
Redhat = " "
RedHatEnterprise = " "
RockyLinux = " "
Redox = "󰀘 "
Solus = "󰠳 "
SUSE = " "
Ubuntu = " "
Unknown = " "
Void = " "
Windows = "󰍲 "
[package]
symbol = "󰏗 "
[perl]
symbol = " "
[php]
symbol = " "
[pijul_channel]
symbol = " "
[python]
symbol = " "
[rlang]
symbol = "󰟔 "
[ruby]
symbol = " "
[rust]
symbol = "󱘗 "
[scala]
symbol = " "
[swift]
symbol = " "
[zig]
symbol = " "

View file

@ -0,0 +1,29 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.starship;
in
{
options = {
youthlic.programs.starship = {
enable = lib.mkEnableOption "starship";
};
};
config = lib.mkIf cfg.enable {
programs.starship = lib.mkMerge [
{
enable = true;
settings =
let
config-file = builtins.readFile ./config.toml;
in
builtins.fromTOML config-file;
}
(lib.mkIf config.youthlic.programs.fish.enable {
enableFishIntegration = true;
})
(lib.mkIf config.youthlic.programs.bash.enable {
enableBashIntegration = true;
})
];
};
}

View file

@ -0,0 +1,22 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.youthlic.programs.swaylock;
in
{
options = {
youthlic.programs.swaylock = {
enable = lib.mkEnableOption "swaylock";
};
};
config = lib.mkIf cfg.enable {
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
};
};
}

View file

@ -0,0 +1,22 @@
{ lib, config, ... }:
let
cfg = config.youthlic.programs.swaync;
in
{
options = {
youthlic.programs.swaync = {
enable = lib.mkEnableOption "swaync";
systemd.enable = lib.mkEnableOption "systemd service for swaync";
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
services.swaync = {
enable = true;
};
})
(lib.mkIf (!cfg.systemd.enable) {
systemd.user.services.swaync = lib.mkForce { };
})
];
}

View file

@ -0,0 +1,22 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.thunderbird;
in
{
options = {
youthlic.programs.thunderbird = {
enable = lib.mkEnableOption "thunderbird";
};
};
config = lib.mkIf cfg.enable {
programs.thunderbird = {
enable = true;
profiles = {
default = {
withExternalGnupg = true;
isDefault = true;
};
};
};
};
}

View file

@ -0,0 +1,189 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.youthlic.programs.waybar;
in
{
options = {
youthlic.programs.waybar = {
enable = lib.mkEnableOption "waybar";
};
};
config = lib.mkIf cfg.enable {
programs.waybar = {
enable = true;
systemd.enable = false;
settings = [
{
layer = "top";
position = "top";
modules-left = [
"niri/workspaces"
"wlr/taskbar"
];
modules-center = [ "clock" ];
modules-right = [
"tray"
"idle_inhibitor"
"memory"
"backlight"
"pulseaudio"
"battery"
"custom/notification"
];
"niri/worksapces" = { };
"niri/taskbar" = {
icon-size = 15;
on-click = "activate";
on-click-middle = "close";
};
"tray" = {
icon-size = 15;
spacing = 10;
};
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = " ";
deactivated = " ";
};
};
memory = {
format = " {percentage}%";
on-click = lib.getExe pkgs.resources;
};
backlight = {
format = "{icon}{percent}%";
format-icons = " ";
on-scroll-up = "${lib.getExe pkgs.brightnessctl} set +1%";
on-scroll-down = "${lib.getExe pkgs.brightnessctl} set 1%-";
};
pulseaudio = {
format = "{icon}{volume}%";
format-bluetooth = " {volume}%";
format-muted = " -%";
format-source = " {volume}%";
format-source-muted = " ";
format-icons = {
default = [
" "
" "
" "
];
headphone = " ";
headset = " ";
hands-free = " ";
};
on-click = "${lib.getExe' pkgs.wireplumber "wpctl"} set-mute @DEFAULT_AUDIO_SINK@ toggle";
on-click-right = lib.getExe pkgs.pwvucontrol;
tooltip-format = "{icon}{desc} {volume}%";
};
battery = {
states = {
warning = 30;
critical = 15;
};
format = "{icon}{capacity}%";
format-charging = " {capacity}%";
format-icons = [
" "
" "
" "
" "
" "
];
tooltip-format = ''
{power}W
{timeTo}'';
};
clock = {
format = "{:%a %b %d %R}";
calendar.format = {
months = "<span color='#ff7b63'>{}</span>";
days = "<span color='#ffffff'>{}</span>";
weeks = "<span color='#8ff0a4'>W{}</span>";
weekdays = "<span color='#f8e45c'>{}</span>";
today = "<span color='#78aeed'><u>{}</u></span>";
};
actions = {
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
tooltip-format = "{calendar}";
};
"custom/notification" = {
"tooltip" = false;
"format" = "{icon}";
"format-icons" = {
"notification" = "<span foreground='red'><sup></sup></span>";
"none" = "";
"dnd-notification" = "<span foreground='red'><sup></sup></span>";
"dnd-none" = "";
};
"return-type" = "json";
"exec" = "swaync-client -swb";
"on-click" = "swaync-client -t -sw";
"on-click-right" = "swaync-client -d -sw";
"escape" = true;
};
}
];
style = ''
* {
font-family: LXGW Wenkai, FiraCode Nerd Font;
font-weight: bold;
font-size: 14px;
}
window#waybar {
background: alpha(@theme_base_color, 0.9);
color: @theme_text_color;
}
#custom-notification,
#workspaces,
#taskbar button,
#mode,
#clock,
#tray,
#mpris,
#idle_inhibitor,
#backlight,
#cpu,
#memory,
#pulseaudio,
#battery {
padding: 0 6px;
}
#workspaces button {
padding: 3px 6px;
}
#workspaces button.focused,
#workspaces button.active {
color: #78aeed;
}
#battery.warning {
color: #f8e45c;
}
#battery.critical {
color: #ff7b63;
}
#battery.charging {
color: #8ff0a4;
}
'';
};
};
}

View file

@ -0,0 +1,57 @@
{
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 = ''
pakcage 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" ];
};
};
};
}