Merge pull request #129 from DarkKirb/fixup-sway-config
fixup sway config
This commit is contained in:
commit
009cfa6380
18 changed files with 865 additions and 535 deletions
|
@ -115,4 +115,9 @@ in {
|
||||||
enabled = "ibus";
|
enabled = "ibus";
|
||||||
ibus.engines = with pkgs.ibus-engines; [anthy];
|
ibus.engines = with pkgs.ibus-engines; [anthy];
|
||||||
};
|
};
|
||||||
|
security.polkit.enable = true;
|
||||||
|
security.pam.services.kwallet = {
|
||||||
|
name = "kwallet";
|
||||||
|
enableKwallet = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
13
config/programs/foot.nix
Normal file
13
config/programs/foot.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{...}: {
|
||||||
|
programs.foot = {
|
||||||
|
enable = true;
|
||||||
|
server.enable = true;
|
||||||
|
settings = {
|
||||||
|
main = {
|
||||||
|
term = "xterm-256color";
|
||||||
|
font = "FiraCode Nerd Font:size=12";
|
||||||
|
dpi-aware = "yes";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -16,171 +16,16 @@ desktop: {
|
||||||
programs.helix = {
|
programs.helix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
theme = "gruvbox";
|
|
||||||
editor = {
|
editor = {
|
||||||
line-number = "relative";
|
line-number = "relative";
|
||||||
};
|
cursorline = true;
|
||||||
};
|
color-modes = true;
|
||||||
themes = {
|
cursor-shape = {
|
||||||
gruvbox = {
|
insert = "bar";
|
||||||
# Author : Jakub Bartodziej <kubabartodziej@gmail.com>
|
normal = "block";
|
||||||
# The theme uses the gruvbox dark palette with standard contrast: github.com/morhetz/gruvbox
|
select = "underline";
|
||||||
"attribute" = "aqua1";
|
|
||||||
"keyword" = {fg = "red1";};
|
|
||||||
"keyword.directive" = "red0";
|
|
||||||
"namespace" = "aqua1";
|
|
||||||
"punctuation" = "orange1";
|
|
||||||
"punctuation.delimiter" = "orange1";
|
|
||||||
"operator" = "purple1";
|
|
||||||
"special" = "purple0";
|
|
||||||
"variable.other.member" = "blue1";
|
|
||||||
"variable" = "fg1";
|
|
||||||
"variable.builtin" = "orange1";
|
|
||||||
"variable.parameter" = "fg2";
|
|
||||||
"type" = "yellow1";
|
|
||||||
"type.builtin" = "yellow1";
|
|
||||||
"constructor" = {
|
|
||||||
fg = "purple1";
|
|
||||||
modifiers = ["bold"];
|
|
||||||
};
|
|
||||||
"function" = {
|
|
||||||
fg = "green1";
|
|
||||||
modifiers = ["bold"];
|
|
||||||
};
|
|
||||||
"function.macro" = "aqua1";
|
|
||||||
"function.builtin" = "yellow1";
|
|
||||||
"tag" = "red1";
|
|
||||||
"comment" = {
|
|
||||||
fg = "gray1";
|
|
||||||
modifiers = ["italic"];
|
|
||||||
};
|
|
||||||
"constant" = {fg = "purple1";};
|
|
||||||
"constant.builtin" = {
|
|
||||||
fg = "purple1";
|
|
||||||
modifiers = ["bold"];
|
|
||||||
};
|
|
||||||
"string" = "green1";
|
|
||||||
"constant.numeric" = "purple1";
|
|
||||||
"constant.character.escape" = {
|
|
||||||
fg = "fg2";
|
|
||||||
modifiers = ["bold"];
|
|
||||||
};
|
|
||||||
"label" = "aqua1";
|
|
||||||
"module" = "aqua1";
|
|
||||||
|
|
||||||
"diff.plus" = "green1";
|
|
||||||
"diff.delta" = "orange1";
|
|
||||||
"diff.minus" = "red1";
|
|
||||||
|
|
||||||
"warning" = {
|
|
||||||
fg = "orange1";
|
|
||||||
bg = "bg1";
|
|
||||||
};
|
|
||||||
"error" = {
|
|
||||||
fg = "red1";
|
|
||||||
bg = "bg1";
|
|
||||||
};
|
|
||||||
"info" = {
|
|
||||||
fg = "aqua1";
|
|
||||||
bg = "bg1";
|
|
||||||
};
|
|
||||||
"hint" = {
|
|
||||||
fg = "blue1";
|
|
||||||
bg = "bg1";
|
|
||||||
};
|
|
||||||
|
|
||||||
"ui.background" = {bg = "bg0";};
|
|
||||||
"ui.linenr" = {fg = "bg4";};
|
|
||||||
"ui.linenr.selected" = {fg = "yellow1";};
|
|
||||||
"ui.cursorline" = {bg = "bg1";};
|
|
||||||
"ui.statusline" = {
|
|
||||||
fg = "fg1";
|
|
||||||
bg = "bg2";
|
|
||||||
};
|
|
||||||
"ui.statusline.normal" = {
|
|
||||||
fg = "fg1";
|
|
||||||
bg = "bg2";
|
|
||||||
};
|
|
||||||
"ui.statusline.insert" = {
|
|
||||||
fg = "fg1";
|
|
||||||
bg = "blue0";
|
|
||||||
};
|
|
||||||
"ui.statusline.select" = {
|
|
||||||
fg = "fg1";
|
|
||||||
bg = "orange0";
|
|
||||||
};
|
|
||||||
"ui.statusline.inactive" = {
|
|
||||||
fg = "fg4";
|
|
||||||
bg = "bg1";
|
|
||||||
};
|
|
||||||
"ui.popup" = {bg = "bg1";};
|
|
||||||
"ui.window" = {bg = "bg1";};
|
|
||||||
"ui.help" = {
|
|
||||||
bg = "bg1";
|
|
||||||
fg = "fg1";
|
|
||||||
};
|
|
||||||
"ui.text" = {fg = "fg1";};
|
|
||||||
"ui.text.focus" = {fg = "fg1";};
|
|
||||||
"ui.selection" = {
|
|
||||||
bg = "bg3";
|
|
||||||
modifiers = ["reversed"];
|
|
||||||
};
|
|
||||||
"ui.cursor.primary" = {modifiers = ["reversed"];};
|
|
||||||
"ui.cursor.match" = {bg = "bg2";};
|
|
||||||
"ui.menu" = {
|
|
||||||
fg = "fg1";
|
|
||||||
bg = "bg2";
|
|
||||||
};
|
|
||||||
"ui.menu.selected" = {
|
|
||||||
fg = "bg2";
|
|
||||||
bg = "blue1";
|
|
||||||
modifiers = ["bold"];
|
|
||||||
};
|
|
||||||
"ui.virtual.whitespace" = "bg2";
|
|
||||||
"ui.virtual.ruler" = {bg = "bg1";};
|
|
||||||
|
|
||||||
"diagnostic" = {modifiers = ["underlined"];};
|
|
||||||
|
|
||||||
"markup.heading" = "aqua1";
|
|
||||||
"markup.bold" = {modifiers = ["bold"];};
|
|
||||||
"markup.italic" = {modifiers = ["italic"];};
|
|
||||||
"markup.link.url" = {
|
|
||||||
fg = "green1";
|
|
||||||
modifiers = ["underlined"];
|
|
||||||
};
|
|
||||||
"markup.link.text" = "red1";
|
|
||||||
"markup.raw" = "red1";
|
|
||||||
palette = {
|
|
||||||
bg0 = "#282828"; # main background
|
|
||||||
bg1 = "#3c3836";
|
|
||||||
bg2 = "#504945";
|
|
||||||
bg3 = "#665c54";
|
|
||||||
bg4 = "#7c6f64";
|
|
||||||
|
|
||||||
fg0 = "#fbf1c7";
|
|
||||||
fg1 = "#ebdbb2"; # main foreground
|
|
||||||
fg2 = "#d5c4a1";
|
|
||||||
fg3 = "#bdae93";
|
|
||||||
fg4 = "#a89984"; # gray0
|
|
||||||
|
|
||||||
gray0 = "#a89984";
|
|
||||||
gray1 = "#928374";
|
|
||||||
|
|
||||||
red0 = "#cc241d"; # neutral
|
|
||||||
red1 = "#fb4934"; # bright
|
|
||||||
green0 = "#98971a";
|
|
||||||
green1 = "#b8bb26";
|
|
||||||
yellow0 = "#d79921";
|
|
||||||
yellow1 = "#fabd2f";
|
|
||||||
blue0 = "#458588";
|
|
||||||
blue1 = "#83a598";
|
|
||||||
purple0 = "#b16286";
|
|
||||||
purple1 = "#d3869b";
|
|
||||||
aqua0 = "#689d6a";
|
|
||||||
aqua1 = "#8ec07c";
|
|
||||||
orange0 = "#d65d0e";
|
|
||||||
orange1 = "#fe8019";
|
|
||||||
};
|
};
|
||||||
|
indent-guides.render = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,51 +10,9 @@
|
||||||
After = ["graphical-session-pre.target"];
|
After = ["graphical-session-pre.target"];
|
||||||
PartOf = ["graphical-session.target"];
|
PartOf = ["graphical-session.target"];
|
||||||
};
|
};
|
||||||
Install = {
|
Install.WantedBy = ["graphical-session.target"];
|
||||||
WantedBy = ["graphical-session.target"];
|
|
||||||
};
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${pkgs.keepassxc}/bin/keepassxc";
|
ExecStart = "${pkgs.keepassxc}/bin/keepassxc";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
xdg.configFile."keepassxc/keepassxc.ini".text = ''
|
|
||||||
[General]
|
|
||||||
ConfigVersion=1
|
|
||||||
|
|
||||||
[Browser]
|
|
||||||
CustomProxyLocation=
|
|
||||||
Enabled=true
|
|
||||||
|
|
||||||
[FdoSecrets]
|
|
||||||
Enabled=true
|
|
||||||
|
|
||||||
[GUI]
|
|
||||||
AdvancedSettings=true
|
|
||||||
ApplicationTheme=dark
|
|
||||||
TrayIconAppearance=monochrome-light
|
|
||||||
|
|
||||||
[KeeShare]
|
|
||||||
Active="<?xml version=\"1.0\"?>\n<KeeShare xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <Active/>\n</KeeShare>\n"
|
|
||||||
Foreign="<?xml version=\"1.0\"?>\n<KeeShare xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <Foreign/>\n</KeeShare>\n"
|
|
||||||
Own="<?xml version=\"1.0\"?>\n<KeeShare xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <PrivateKey/>\n <PublicKey/>\n</KeeShare>\n"
|
|
||||||
QuietSuccess=true
|
|
||||||
|
|
||||||
[PasswordGenerator]
|
|
||||||
AdditionalChars=
|
|
||||||
AdvancedMode=true
|
|
||||||
Braces=true
|
|
||||||
Dashes=true
|
|
||||||
EASCII=false
|
|
||||||
EnsureEvery=false
|
|
||||||
ExcludedChars=
|
|
||||||
Length=10
|
|
||||||
Logograms=true
|
|
||||||
Math=true
|
|
||||||
Punctuation=true
|
|
||||||
Quotes=true
|
|
||||||
SpecialChars=true
|
|
||||||
|
|
||||||
[Security]
|
|
||||||
IconDownloadFallback=true
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
|
programs.mako = {
|
||||||
|
enable = true;
|
||||||
|
defaultTimeout = 30000;
|
||||||
|
};
|
||||||
systemd.user.services.mako = {
|
systemd.user.services.mako = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "mako";
|
Description = "mako";
|
||||||
|
After = ["graphical-session-pre.target"];
|
||||||
PartOf = ["graphical-session.target"];
|
PartOf = ["graphical-session.target"];
|
||||||
};
|
};
|
||||||
Install = {
|
Install.WantedBy = ["graphical-session.target"];
|
||||||
WantedBy = ["graphical-session.target"];
|
|
||||||
};
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${pkgs.mako}/bin/mako --default-timeout 30000";
|
ExecStart = "mako";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,13 +70,10 @@ in {
|
||||||
systemd.user.services.plover = {
|
systemd.user.services.plover = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "plover";
|
Description = "plover";
|
||||||
After = ["tray.target"];
|
After = ["graphical-session-pre.target"];
|
||||||
PartOf = ["graphical-session.target"];
|
PartOf = ["graphical-session.target"];
|
||||||
Requires = ["tray.target"];
|
|
||||||
};
|
|
||||||
Install = {
|
|
||||||
WantedBy = ["graphical-session.target"];
|
|
||||||
};
|
};
|
||||||
|
Install.WantedBy = ["graphical-session.target"];
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${plover-env}/bin/plover";
|
ExecStart = "${plover-env}/bin/plover";
|
||||||
};
|
};
|
||||||
|
|
11
config/programs/rofi.nix
Normal file
11
config/programs/rofi.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
programs.rofi = {
|
||||||
|
enable = true;
|
||||||
|
font = "Noto Sans";
|
||||||
|
extraConfig = {
|
||||||
|
display-drun = " Apps ";
|
||||||
|
display-run = " Run ";
|
||||||
|
};
|
||||||
|
terminal = "${pkgs.foot}/bin/foot";
|
||||||
|
};
|
||||||
|
}
|
|
@ -4,35 +4,24 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
c = "$";
|
||||||
switch_window = pkgs.writeScript "switchWindow" ''
|
switch_window = pkgs.writeScript "switchWindow" ''
|
||||||
# https://www.reddit.com/r/swaywm/comments/krd0sq/comment/gib6z73/?context=3
|
set -euo pipefail
|
||||||
jq_filter='
|
|
||||||
# descend to workspace or scratchpad
|
tree=$(${pkgs.sway}/bin/swaymsg -t get_tree)
|
||||||
.nodes[].nodes[]
|
readarray -t win_ids <<< "$(${pkgs.jq}/bin/jq -r '.. | objects | select(has("app_id")) | .id' <<< "$tree")"
|
||||||
# save workspace name as .w
|
readarray -t win_names <<< "$(${pkgs.jq}/bin/jq -r '.. | objects | select(has("app_id")) | .name' <<< "$tree")"
|
||||||
| {"w": .name} + (
|
readarray -t win_types <<< "$(${pkgs.jq}/bin/jq -r '.. | objects | select(has("app_id")) | .app_id // .window_properties.class' <<< "$tree")"
|
||||||
if (.nodes|length) > 0 then # workspace
|
|
||||||
[recurse(.nodes[])]
|
switch () {
|
||||||
else # scratchpad
|
local k
|
||||||
[]
|
read -r k
|
||||||
end
|
swaymsg "[con_id=${c}{win_ids[$k]}] focus"
|
||||||
+ .floating_nodes
|
|
||||||
| .[]
|
|
||||||
# select nodes with no children (windows)
|
|
||||||
| select(.nodes==[])
|
|
||||||
)
|
|
||||||
| [
|
|
||||||
"<span size=\"xx-small\">\(.id)</span>",
|
|
||||||
# remove markup and index from workspace name, replace scratch with "[S]"
|
|
||||||
"<span size=\"xx-small\">\(.w | gsub("^[^:]*:|<[^>]*>"; "") | sub("__i3_scratch"; "[S]"))</span>",
|
|
||||||
# get app name (or window class if xwayland)
|
|
||||||
"<span weight=\"bold\">\(if .app_id == null then .window_properties.class else .app_id end)</span>",
|
|
||||||
"<span style=\"italic\">\(.name)</span>"
|
|
||||||
] | @tsv
|
|
||||||
'
|
|
||||||
${pkgs.sway}/bin/swaymsg -t get_tree | ${pkgs.jq}/bin/jq -r "$jq_filter" | ${pkgs.wofi}/bin/wofi -m --insensitive --show dmenu --prompt='Focus a window' | {
|
|
||||||
read -r id name && swaymsg "[con_id=$id]" focus
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k in $(seq 0 $((${c}{#win_ids[@]} - 1))); do
|
||||||
|
echo -e "<span weight=\\"bold\\">\\${c}{win_types[$k]}</span> - ${c}{win_names[$k]}"
|
||||||
|
done | rofi -dmenu -markup-rows -i -p window -format i | switch
|
||||||
'';
|
'';
|
||||||
screenshot_then_switch = pkgs.writeScript "screenshotThenSwitch" ''
|
screenshot_then_switch = pkgs.writeScript "screenshotThenSwitch" ''
|
||||||
${pkgs.sway-contrib.grimshot}/bin/grimshot "$@"
|
${pkgs.sway-contrib.grimshot}/bin/grimshot "$@"
|
||||||
|
@ -59,23 +48,6 @@
|
||||||
'';
|
'';
|
||||||
installPhase = "true";
|
installPhase = "true";
|
||||||
};
|
};
|
||||||
# bash script to let dbus know about important env variables and
|
|
||||||
# propogate them to relevent services run at the end of sway config
|
|
||||||
# see
|
|
||||||
# https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist
|
|
||||||
# note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts
|
|
||||||
# some user services to make sure they have the correct environment variables
|
|
||||||
dbus-sway-environment = pkgs.writeTextFile {
|
|
||||||
name = "dbus-sway-environment";
|
|
||||||
destination = "/bin/dbus-sway-environment";
|
|
||||||
executable = true;
|
|
||||||
|
|
||||||
text = ''
|
|
||||||
${pkgs.dbus}/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
|
|
||||||
${pkgs.systemd}/bin/systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
|
|
||||||
${pkgs.systemd}/bin/systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
# currently, there is some friction between sway and gtk:
|
# currently, there is some friction between sway and gtk:
|
||||||
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
|
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
|
||||||
# the suggested way to set gtk settings is with gsettings
|
# the suggested way to set gtk settings is with gsettings
|
||||||
|
@ -100,11 +72,9 @@ in {
|
||||||
./wl-clipboard.nix
|
./wl-clipboard.nix
|
||||||
./mako.nix
|
./mako.nix
|
||||||
./swayidle.nix
|
./swayidle.nix
|
||||||
|
./foot.nix
|
||||||
|
./rofi.nix
|
||||||
];
|
];
|
||||||
home.file.".config/wofi/config".text = ''
|
|
||||||
allow_markup = true
|
|
||||||
dmenu-parse_action = true
|
|
||||||
'';
|
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
@ -138,7 +108,8 @@ in {
|
||||||
inherit (config.wayland.windowManager.sway.config) modifier;
|
inherit (config.wayland.windowManager.sway.config) modifier;
|
||||||
in
|
in
|
||||||
lib.mkOptionDefault {
|
lib.mkOptionDefault {
|
||||||
"${modifier}+d" = "exec ${pkgs.wofi}/bin/wofi --show drun";
|
"${modifier}+Return" = "exec ${pkgs.foot}/bin/foot";
|
||||||
|
"${modifier}+d" = "exec ${pkgs.rofi}/bin/rofi --show drun";
|
||||||
"Print" = "mode screenshot";
|
"Print" = "mode screenshot";
|
||||||
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||||
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||||
|
@ -160,15 +131,15 @@ in {
|
||||||
modes = {
|
modes = {
|
||||||
screenshot = {
|
screenshot = {
|
||||||
Print = "exec ${screenshot_then_switch} copy area";
|
Print = "exec ${screenshot_then_switch} copy area";
|
||||||
"Shift+Print" = "exec ${screenshot_then_switch} save area $HOME/Pictures/grim-$(date --iso=s).png";
|
"Shift+Print" = "exec ${screenshot_then_switch} save area $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
|
||||||
a = "exec ${screenshot_then_switch} copy active";
|
a = "exec ${screenshot_then_switch} copy active";
|
||||||
"Shift+a" = "exec ${screenshot_then_switch} save active $HOME/Pictures/grim-$(date --iso=s).png";
|
"Shift+a" = "exec ${screenshot_then_switch} save active $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
|
||||||
s = "exec ${screenshot_then_switch} copy screen";
|
s = "exec ${screenshot_then_switch} copy screen";
|
||||||
"Shift+s" = "exec ${screenshot_then_switch} save screen $HOME/Pictures/grim-$(date --iso=s).png";
|
"Shift+s" = "exec ${screenshot_then_switch} save screen $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
|
||||||
o = "exec ${screenshot_then_switch} copy output";
|
o = "exec ${screenshot_then_switch} copy output";
|
||||||
"Shift+o" = "exec ${screenshot_then_switch} save output $HOME/Pictures/grim-$(date --iso=s).png";
|
"Shift+o" = "exec ${screenshot_then_switch} save output $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
|
||||||
w = "exec ${screenshot_then_switch} copy window";
|
w = "exec ${screenshot_then_switch} copy window";
|
||||||
"Shift+w" = "exec ${screenshot_then_switch} save window $HOME/Pictures/grim-$(date --iso=s).png";
|
"Shift+w" = "exec ${screenshot_then_switch} save window $HOME/Pictures/grim-$(date --iso=s | sed 's/:/-/g').png";
|
||||||
Escape = ''mode "default"'';
|
Escape = ''mode "default"'';
|
||||||
Return = ''mode "default"'';
|
Return = ''mode "default"'';
|
||||||
};
|
};
|
||||||
|
@ -185,9 +156,10 @@ in {
|
||||||
export GTK_USE_PORTAL=1
|
export GTK_USE_PORTAL=1
|
||||||
'';
|
'';
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
exec ${dbus-sway-environment}/bin/dbus-sway-environment
|
|
||||||
exec ${configure-gtk}/bin/configure-gtk
|
exec ${configure-gtk}/bin/configure-gtk
|
||||||
exec ${pkgs.systemd}/bin/systemctl --user import-environment
|
exec ${pkgs.systemd}/bin/systemctl --user import-environment
|
||||||
|
gaps outer 8
|
||||||
|
gaps inner 4
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -17,16 +17,36 @@
|
||||||
${pkgs.mpc-cli}/bin/mpc play
|
${pkgs.mpc-cli}/bin/mpc play
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
systemd.user.services.swayidle = {
|
services.swayidle = {
|
||||||
Unit = {
|
enable = true;
|
||||||
Description = "swayidle";
|
events = [
|
||||||
PartOf = ["graphical-session.target"];
|
{
|
||||||
};
|
event = "before-sleep";
|
||||||
Install = {
|
command = "${lock-script}";
|
||||||
WantedBy = ["graphical-session.target"];
|
}
|
||||||
};
|
{
|
||||||
Service = {
|
event = "lock";
|
||||||
ExecStart = "${pkgs.swayidle}/bin/swayidle -w timeout 300 ${lock-script} timeout 305 ${screen-off-script} resume ${resume-script} before-sleep ${lock-script} timeout 900 ${suspend-script} lock ${lock-script} unlock ${unlock-script}";
|
command = "${lock-script}";
|
||||||
};
|
}
|
||||||
|
{
|
||||||
|
event = "unlock";
|
||||||
|
command = "${unlock-script}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
timeouts = [
|
||||||
|
{
|
||||||
|
timeout = 300;
|
||||||
|
command = "${lock-script}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
timeout = 305;
|
||||||
|
command = "${screen-off-script}";
|
||||||
|
resumeCommand = "${resume-script}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
timeout = 900;
|
||||||
|
command = "${suspend-script}";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,83 +1,532 @@
|
||||||
{pkgs, ...}: let
|
{pkgs, config, ...}: let
|
||||||
theme = import ../../extra/theme.nix;
|
theme = import ../../extra/theme.nix;
|
||||||
|
inherit (config.lib.formats.rasi) mkLiteral;
|
||||||
|
rasiColor = c: mkLiteral (theme.cssColor c);
|
||||||
in {
|
in {
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
cursorTheme = {
|
cursorTheme = {
|
||||||
package = null;
|
package = pkgs.libsForQt5.breeze-icons;
|
||||||
name = "breeze_cursors";
|
name = "breeze-dark";
|
||||||
size = 24;
|
size = 24;
|
||||||
};
|
};
|
||||||
font = {
|
font = {
|
||||||
package = null;
|
package = pkgs.noto-fonts;
|
||||||
name = "Noto Sans";
|
name = "Noto Sans";
|
||||||
size = 10;
|
size = 10;
|
||||||
};
|
};
|
||||||
iconTheme = {
|
iconTheme = {
|
||||||
package = null;
|
package = pkgs.libsForQt5.breeze-icons;
|
||||||
name = "breeze-dark";
|
name = "breeze-dark";
|
||||||
};
|
};
|
||||||
theme = {
|
theme = {
|
||||||
package = null;
|
package = pkgs.libsForQt5.breeze-gtk;
|
||||||
name = "Breeze-Dark";
|
name = "Breeze-Dark";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
qt.enable = true;
|
qt.enable = true;
|
||||||
qt.style.package = pkgs.libsForQt5.breeze-qt5;
|
qt.style.package = pkgs.libsForQt5.breeze-qt5;
|
||||||
qt.style.name = "BreezeDark";
|
qt.style.name = "BreezeDark";
|
||||||
|
# Taken from https://github.com/jakehamilton/dotfiles/blob/master/waybar/style.css
|
||||||
programs.waybar.style = with theme; ''
|
programs.waybar.style = with theme; ''
|
||||||
* {
|
* {
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
min-height: 24px;
|
||||||
font-family: "NotoSansDisplay Nerd Font", "Noto Sans Mono CJK JP";
|
font-family: "NotoSansDisplay Nerd Font", "Noto Sans Mono CJK JP";
|
||||||
}
|
color: ${cssColor base};
|
||||||
|
|
||||||
window.HDMI-A-1 * {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window#waybar {
|
window#waybar {
|
||||||
background: ${cssColor bg};
|
background: tranparent;
|
||||||
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mpd, #cpu {
|
window#waybar.hidden {
|
||||||
background: ${cssColor green};
|
opacity: 0.2;
|
||||||
color: ${cssColor bg};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pulseaudio {
|
#window {
|
||||||
background: ${cssColor yellow};
|
margin-top: 8px;
|
||||||
color: ${cssColor bg};
|
padding: 0px 16px 0px 16px;
|
||||||
}
|
border-radius: 24px;
|
||||||
|
transition: none;
|
||||||
#network, #tray {
|
|
||||||
background: ${cssColor blue};
|
|
||||||
color: ${cssColor bg};
|
|
||||||
}
|
|
||||||
|
|
||||||
#memory, #workspaces button.focused {
|
|
||||||
background: ${cssColor magenta};
|
|
||||||
}
|
|
||||||
|
|
||||||
#language {
|
|
||||||
background: ${cssColor cyan};
|
|
||||||
}
|
|
||||||
|
|
||||||
#clock {
|
|
||||||
background: ${cssColor light-grey};
|
|
||||||
}
|
|
||||||
|
|
||||||
.urgent {
|
|
||||||
background: ${cssColor red};
|
|
||||||
}
|
|
||||||
|
|
||||||
#workspaces button {
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
label {
|
#workspaces {
|
||||||
color: #fff;
|
margin-top: 8px;
|
||||||
|
margin-left: 12px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-radius: 24px;
|
||||||
|
background: ${cssColor surface0};
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button {
|
||||||
|
transition: none;
|
||||||
|
background: transparent;
|
||||||
|
font-size: 16px;
|
||||||
|
color: ${cssColor text};
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.focused {
|
||||||
|
background: ${cssColor mauve};
|
||||||
|
color: ${cssColor base};
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button:hover {
|
||||||
|
background: ${cssColor sapphire};
|
||||||
|
color: ${cssColor base};
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-radius: 24px;
|
||||||
|
background: ${cssColor green};
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.disconnected,
|
||||||
|
#mpd.stopped {
|
||||||
|
background: ${cssColor red};
|
||||||
|
}
|
||||||
|
|
||||||
|
#network {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-radius: 24px;
|
||||||
|
transition: none;
|
||||||
|
background: ${cssColor mauve};
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-radius: 24px;
|
||||||
|
transition: none;
|
||||||
|
background: ${cssColor teal};
|
||||||
|
}
|
||||||
|
|
||||||
|
#temperature, #battery {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-radius: 24px;
|
||||||
|
transition: none;
|
||||||
|
background: ${cssColor green};
|
||||||
|
}
|
||||||
|
|
||||||
|
#cpu, #backlight, #battery.warning {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-radius: 24px;
|
||||||
|
transition: none;
|
||||||
|
background: ${cssColor yellow};
|
||||||
|
}
|
||||||
|
|
||||||
|
#memory, #battery.critical {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-radius: 24px;
|
||||||
|
transition: none;
|
||||||
|
background: ${cssColor red};
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
|
margin-right: 12px;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-radius: 26px;
|
||||||
|
transition: none;
|
||||||
|
background: ${cssColor surface0};
|
||||||
|
color: ${cssColor text};
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
wayland.windowManager.sway.extraConfig = with theme; ''
|
||||||
|
# target title bg text indicator border
|
||||||
|
client.focused ${cssColor pink} ${cssColor base} ${cssColor text} ${cssColor rosewater} ${cssColor pink}
|
||||||
|
client.focused_inactive ${cssColor mauve} ${cssColor base} ${cssColor text} ${cssColor rosewater} ${cssColor mauve}
|
||||||
|
client.unfocused ${cssColor mauve} ${cssColor base} ${cssColor text} ${cssColor rosewater} ${cssColor mauve}
|
||||||
|
client.urgent ${cssColor peach} ${cssColor base} ${cssColor peach} ${cssColor overlay0} ${cssColor peach}
|
||||||
|
client.placeholder ${cssColor overlay0} ${cssColor base} ${cssColor text} ${cssColor overlay0} ${cssColor overlay0}
|
||||||
|
client.background ${cssColor base}
|
||||||
|
'';
|
||||||
|
|
||||||
|
programs.foot.settings.colors = with theme; {
|
||||||
|
alpha = 0.9;
|
||||||
|
background = base;
|
||||||
|
foreground = text;
|
||||||
|
regular0 = surface1;
|
||||||
|
regular1 = red;
|
||||||
|
regular2 = green;
|
||||||
|
regular3 = yellow;
|
||||||
|
regular4 = blue;
|
||||||
|
regular5 = pink;
|
||||||
|
regular6 = teal;
|
||||||
|
regular7 = subtext1;
|
||||||
|
bright0 = surface2;
|
||||||
|
bright1 = red;
|
||||||
|
bright2 = green;
|
||||||
|
bright3 = yellow;
|
||||||
|
bright4 = blue;
|
||||||
|
bright5 = pink;
|
||||||
|
bright6 = teal;
|
||||||
|
bright7 = subtext0;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.rofi.theme = with theme; let
|
||||||
|
element = {
|
||||||
|
background-color = mkLiteral "inherit";
|
||||||
|
text-color = mkLiteral "inherit";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
"*" = {
|
||||||
|
bg-col = rasiColor base;
|
||||||
|
bg-col-light = rasiColor base;
|
||||||
|
border-col = rasiColor base;
|
||||||
|
selected-col = rasiColor base;
|
||||||
|
blue = rasiColor blue;
|
||||||
|
fg-col = rasiColor text;
|
||||||
|
fg-col2 = rasiColor red;
|
||||||
|
grey = rasiColor overlay0;
|
||||||
|
width = 600;
|
||||||
|
};
|
||||||
|
element-text = element;
|
||||||
|
window = {
|
||||||
|
height = mkLiteral "360px";
|
||||||
|
border = mkLiteral "3px";
|
||||||
|
border-color = mkLiteral "@border-col";
|
||||||
|
background-color = mkLiteral "@bg-col";
|
||||||
|
opacity = mkLiteral "0.9";
|
||||||
|
};
|
||||||
|
mainbox = {
|
||||||
|
background-color = mkLiteral "@bg-col";
|
||||||
|
};
|
||||||
|
inputbar = {
|
||||||
|
children = map mkLiteral ["prompt" "entry"];
|
||||||
|
background-color = mkLiteral "@bg-col";
|
||||||
|
border-radius = mkLiteral "5px";
|
||||||
|
padding = mkLiteral "2px";
|
||||||
|
};
|
||||||
|
prompt = {
|
||||||
|
background-color = mkLiteral "@blue";
|
||||||
|
padding = mkLiteral "6px";
|
||||||
|
text-color = mkLiteral "@bg-col";
|
||||||
|
border-radius = mkLiteral "3px";
|
||||||
|
margin = mkLiteral "20px 0px 0px 20px";
|
||||||
|
};
|
||||||
|
|
||||||
|
textbox-prompt-colon = {
|
||||||
|
expand = mkLiteral "false";
|
||||||
|
str = ":";
|
||||||
|
};
|
||||||
|
|
||||||
|
entry = {
|
||||||
|
padding = mkLiteral "6px";
|
||||||
|
margin = mkLiteral "20px 0px 0px 10px";
|
||||||
|
text-color = mkLiteral "@fg-col";
|
||||||
|
background-color = mkLiteral "@bg-col";
|
||||||
|
};
|
||||||
|
|
||||||
|
listview = {
|
||||||
|
border = mkLiteral "0px 0px 0px";
|
||||||
|
padding = mkLiteral "6px 0px 0px";
|
||||||
|
margin = mkLiteral "10px 0px 0px 20px";
|
||||||
|
columns = 2;
|
||||||
|
lines = 5;
|
||||||
|
background-color = mkLiteral "@bg-col";
|
||||||
|
};
|
||||||
|
|
||||||
|
element = {
|
||||||
|
padding = mkLiteral "5px";
|
||||||
|
background-color = mkLiteral "@bg-col";
|
||||||
|
text-color = mkLiteral "@fg-col";
|
||||||
|
};
|
||||||
|
|
||||||
|
element-icon = element // {
|
||||||
|
size = mkLiteral "25px";
|
||||||
|
};
|
||||||
|
|
||||||
|
"element selected" = {
|
||||||
|
background-color = mkLiteral "@selected-col";
|
||||||
|
text-color = mkLiteral "@fg-col2";
|
||||||
|
};
|
||||||
|
|
||||||
|
mode-switcher = element // {
|
||||||
|
spacing = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
button = {
|
||||||
|
padding = mkLiteral "10px";
|
||||||
|
background-color = mkLiteral "@bg-col-light";
|
||||||
|
text-color = mkLiteral "@grey";
|
||||||
|
vertical-align = mkLiteral "0.5";
|
||||||
|
horizontal-align = mkLiteral "0.5";
|
||||||
|
};
|
||||||
|
|
||||||
|
"button selected" = {
|
||||||
|
background-color = mkLiteral "@bg-col";
|
||||||
|
text-color = mkLiteral "@blue";
|
||||||
|
};
|
||||||
|
|
||||||
|
message = {
|
||||||
|
background-color = mkLiteral "@bg-col-light";
|
||||||
|
margin = mkLiteral "2px";
|
||||||
|
padding = mkLiteral "2px";
|
||||||
|
border-radius = mkLiteral "5px";
|
||||||
|
};
|
||||||
|
|
||||||
|
textbox = {
|
||||||
|
padding = mkLiteral "6px";
|
||||||
|
margin = mkLiteral "20px 0px 0px 20px";
|
||||||
|
text-color = mkLiteral "@blue";
|
||||||
|
background-color = mkLiteral "@bg-col-light";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs.helix = {
|
||||||
|
settings.theme = "catppuccin";
|
||||||
|
themes.catppucchin = {
|
||||||
|
# Syntax highlighting
|
||||||
|
# -------------------
|
||||||
|
"type" = "yellow";
|
||||||
|
|
||||||
|
"constructor" = "sapphire";
|
||||||
|
|
||||||
|
"constant" = "peach";
|
||||||
|
"constant.builtin" = "peach";
|
||||||
|
"constant.character" = "teal";
|
||||||
|
"constant.character.escape" = "pink";
|
||||||
|
|
||||||
|
"string" = "green";
|
||||||
|
"string.regexp" = "peach";
|
||||||
|
"string.special" = "blue";
|
||||||
|
|
||||||
|
"comment" = {
|
||||||
|
fg = "surface2";
|
||||||
|
modifiers = ["italic"];
|
||||||
|
};
|
||||||
|
|
||||||
|
"variable" = "text";
|
||||||
|
"variable.parameter" = {
|
||||||
|
fg = "maroon";
|
||||||
|
modifiers = ["italic"];
|
||||||
|
};
|
||||||
|
"variable.builtin" = "red";
|
||||||
|
"variable.other.member" = "teal";
|
||||||
|
|
||||||
|
"label" = "sapphire"; # used for lifetimes
|
||||||
|
|
||||||
|
"punctuation" = "overlay2";
|
||||||
|
"punctuation.special" = "sky";
|
||||||
|
|
||||||
|
"keyword" = "mauve";
|
||||||
|
"keyword.control.conditional" = {
|
||||||
|
fg = "mauve";
|
||||||
|
modifiers = ["italic"];
|
||||||
|
};
|
||||||
|
|
||||||
|
"operator" = "sky";
|
||||||
|
|
||||||
|
"function" = "blue";
|
||||||
|
"function.builtin" = "peach";
|
||||||
|
"function.macro" = "mauve";
|
||||||
|
|
||||||
|
"tag" = "mauve";
|
||||||
|
|
||||||
|
"namespace" = {
|
||||||
|
fg = "blue";
|
||||||
|
modifiers = ["italic"];
|
||||||
|
};
|
||||||
|
|
||||||
|
"special" = "blue"; # fuzzy highlight
|
||||||
|
|
||||||
|
"markup.heading.marker" = {
|
||||||
|
fg = "peach";
|
||||||
|
modifiers = ["bold"];
|
||||||
|
};
|
||||||
|
"markup.heading.1" = "lavender";
|
||||||
|
"markup.heading.2" = "mauve";
|
||||||
|
"markup.heading.3" = "green";
|
||||||
|
"markup.heading.4" = "yellow";
|
||||||
|
"markup.heading.5" = "pink";
|
||||||
|
"markup.heading.6" = "teal";
|
||||||
|
"markup.list" = "mauve";
|
||||||
|
"markup.bold" = {modifiers = ["bold"];};
|
||||||
|
"markup.italic" = {modifiers = ["italic"];};
|
||||||
|
"markup.link.url" = {
|
||||||
|
fg = "rosewater";
|
||||||
|
modifiers = ["italic" "underlined"];
|
||||||
|
};
|
||||||
|
"markup.link.text" = "blue";
|
||||||
|
"markup.raw" = "flamingo";
|
||||||
|
|
||||||
|
"diff.plus" = "green";
|
||||||
|
"diff.minus" = "red";
|
||||||
|
"diff.delta" = "blue";
|
||||||
|
|
||||||
|
# User Interface
|
||||||
|
# --------------
|
||||||
|
"ui.background" = {
|
||||||
|
fg = "text";
|
||||||
|
bg = "base";
|
||||||
|
};
|
||||||
|
|
||||||
|
"ui.linenr" = {fg = "surface1";};
|
||||||
|
"ui.linenr.selected" = {fg = "lavender";};
|
||||||
|
|
||||||
|
"ui.statusline" = {
|
||||||
|
fg = "text";
|
||||||
|
bg = "mantle";
|
||||||
|
};
|
||||||
|
"ui.statusline.inactive" = {
|
||||||
|
fg = "surface2";
|
||||||
|
bg = "mantle";
|
||||||
|
};
|
||||||
|
"ui.statusline.normal" = {
|
||||||
|
fg = "base";
|
||||||
|
bg = "lavender";
|
||||||
|
modifiers = ["bold"];
|
||||||
|
};
|
||||||
|
"ui.statusline.insert" = {
|
||||||
|
fg = "base";
|
||||||
|
bg = "green";
|
||||||
|
modifiers = ["bold"];
|
||||||
|
};
|
||||||
|
"ui.statusline.select" = {
|
||||||
|
fg = "base";
|
||||||
|
bg = "flamingo";
|
||||||
|
modifiers = ["bold"];
|
||||||
|
};
|
||||||
|
|
||||||
|
"ui.popup" = {
|
||||||
|
fg = "text";
|
||||||
|
bg = "surface0";
|
||||||
|
};
|
||||||
|
"ui.window" = {fg = "crust";};
|
||||||
|
"ui.help" = {
|
||||||
|
fg = "overlay2";
|
||||||
|
bg = "surface0";
|
||||||
|
};
|
||||||
|
|
||||||
|
"ui.bufferline" = {
|
||||||
|
fg = "surface1";
|
||||||
|
bg = "mantle";
|
||||||
|
};
|
||||||
|
"ui.bufferline.active" = {
|
||||||
|
fg = "text";
|
||||||
|
bg = "base";
|
||||||
|
modifiers = ["bold" "italic"];
|
||||||
|
};
|
||||||
|
"ui.bufferline.background" = {bg = "surface0";};
|
||||||
|
|
||||||
|
"ui.text" = "text";
|
||||||
|
"ui.text.focus" = {
|
||||||
|
fg = "text";
|
||||||
|
bg = "surface0";
|
||||||
|
modifiers = ["bold"];
|
||||||
|
};
|
||||||
|
|
||||||
|
"ui.virtual" = "overlay0";
|
||||||
|
"ui.virtual.ruler" = {bg = "surface0";};
|
||||||
|
"ui.virtual.indent-guide" = "surface0";
|
||||||
|
|
||||||
|
"ui.selection" = {bg = "surface1";};
|
||||||
|
|
||||||
|
"ui.cursor" = {
|
||||||
|
fg = "base";
|
||||||
|
bg = "secondary_cursor";
|
||||||
|
};
|
||||||
|
"ui.cursor.primary" = {
|
||||||
|
fg = "base";
|
||||||
|
bg = "rosewater";
|
||||||
|
};
|
||||||
|
"ui.cursor.match" = {
|
||||||
|
fg = "peach";
|
||||||
|
modifiers = ["bold"];
|
||||||
|
};
|
||||||
|
|
||||||
|
"ui.cursorline.primary" = {bg = "cursorline";};
|
||||||
|
|
||||||
|
"ui.highlight" = {
|
||||||
|
bg = "surface1";
|
||||||
|
modifiers = ["bold"];
|
||||||
|
};
|
||||||
|
|
||||||
|
"ui.menu" = {
|
||||||
|
fg = "overlay2";
|
||||||
|
bg = "surface0";
|
||||||
|
};
|
||||||
|
"ui.menu.selected" = {
|
||||||
|
fg = "text";
|
||||||
|
bg = "surface1";
|
||||||
|
modifiers = ["bold"];
|
||||||
|
};
|
||||||
|
|
||||||
|
diagnostic = {modifiers = ["underlined"];};
|
||||||
|
"diagnostic.error" = "red";
|
||||||
|
"diagnostic.warn" = "yellow";
|
||||||
|
"diagnostic.info" = "sky";
|
||||||
|
"diagnostic.hint" = "teal";
|
||||||
|
|
||||||
|
error = "red";
|
||||||
|
warning = "yellow";
|
||||||
|
info = "sky";
|
||||||
|
hint = "teal";
|
||||||
|
palette = with theme; {
|
||||||
|
rosewater = cssColor rosewater;
|
||||||
|
flamingo = cssColor flamingo;
|
||||||
|
pink = cssColor pink;
|
||||||
|
mauve = cssColor mauve;
|
||||||
|
red = cssColor red;
|
||||||
|
maroon = cssColor maroon;
|
||||||
|
peach = cssColor peach;
|
||||||
|
yellow = cssColor yellow;
|
||||||
|
green = cssColor green;
|
||||||
|
teal = cssColor teal;
|
||||||
|
sky = cssColor sky;
|
||||||
|
sapphire = cssColor sapphire;
|
||||||
|
blue = cssColor blue;
|
||||||
|
lavender = cssColor lavender;
|
||||||
|
text = cssColor text;
|
||||||
|
subtext1 = cssColor subtext1;
|
||||||
|
subtext0 = cssColor subtext0;
|
||||||
|
overlay2 = cssColor overlay2;
|
||||||
|
overlay1 = cssColor overlay1;
|
||||||
|
overlay0 = cssColor overlay0;
|
||||||
|
surface2 = cssColor surface2;
|
||||||
|
surface1 = cssColor surface1;
|
||||||
|
surface0 = cssColor surface0;
|
||||||
|
base = cssColor base;
|
||||||
|
mantle = cssColor mantle;
|
||||||
|
crust = cssColor crust;
|
||||||
|
|
||||||
|
cursorline = "#2a2b3c";
|
||||||
|
secondary_cursor = "#b5a6a8";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,37 +5,5 @@
|
||||||
clock24 = true;
|
clock24 = true;
|
||||||
prefix = "C-a";
|
prefix = "C-a";
|
||||||
sensibleOnTop = true;
|
sensibleOnTop = true;
|
||||||
plugins = with pkgs.tmuxPlugins; [
|
|
||||||
power-theme
|
|
||||||
cpu
|
|
||||||
{
|
|
||||||
plugin = resurrect;
|
|
||||||
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = continuum;
|
|
||||||
extraConfig = ''
|
|
||||||
set -g @continuum-restore 'on'
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
extraConfig = ''
|
|
||||||
set-window-option -g automatic-rename on
|
|
||||||
set-option -g set-titles on
|
|
||||||
|
|
||||||
bind -n M-Left select-pane -L
|
|
||||||
bind -n M-Right select-pane -R
|
|
||||||
bind -n M-Up select-pane -U
|
|
||||||
bind -n M-Down select-pane -D
|
|
||||||
|
|
||||||
bind -n S-Left previous-window
|
|
||||||
bind -n S-Right next-window
|
|
||||||
|
|
||||||
set -sg escape-time 0
|
|
||||||
|
|
||||||
set -g mouse on
|
|
||||||
set -g default-terminal "screen-256color"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,8 @@
|
||||||
"editor.fontFamily" = "\"FiraCode Nerd Font Mono\", \"Noto Sans Mono CJK JP\", monospace";
|
"editor.fontFamily" = "\"FiraCode Nerd Font Mono\", \"Noto Sans Mono CJK JP\", monospace";
|
||||||
"rust-analyzer.checkOnSave.command" = "clippy";
|
"rust-analyzer.checkOnSave.command" = "clippy";
|
||||||
"ledger.binary" = "${pkgs.hledger}/bin/hledger";
|
"ledger.binary" = "${pkgs.hledger}/bin/hledger";
|
||||||
"workbench.colorTheme" = "Gruvbox Dark Hard";
|
"workbench.colorTheme" = "Catppuccin Mocha";
|
||||||
|
"window.titleBarStyle" = "custom";
|
||||||
"rust-analyzer.hoverActions.references" = true;
|
"rust-analyzer.hoverActions.references" = true;
|
||||||
"rust-analyzer.lens.methodReferences" = true;
|
"rust-analyzer.lens.methodReferences" = true;
|
||||||
"rust-analyzer.workspace.symbol.search.scope" = "workspace_and_dependencies";
|
"rust-analyzer.workspace.symbol.search.scope" = "workspace_and_dependencies";
|
||||||
|
@ -289,6 +290,7 @@
|
||||||
bierner.markdown-mermaid
|
bierner.markdown-mermaid
|
||||||
bradlc.vscode-tailwindcss
|
bradlc.vscode-tailwindcss
|
||||||
bungcip.better-toml
|
bungcip.better-toml
|
||||||
|
catppuccin.catppuccin-vsc
|
||||||
christian-kohler.path-intellisense
|
christian-kohler.path-intellisense
|
||||||
codezombiech.gitignore
|
codezombiech.gitignore
|
||||||
davidanson.vscode-markdownlint
|
davidanson.vscode-markdownlint
|
||||||
|
@ -304,7 +306,6 @@
|
||||||
github.vscode-pull-request-github
|
github.vscode-pull-request-github
|
||||||
golang.go
|
golang.go
|
||||||
haskell.haskell
|
haskell.haskell
|
||||||
jdinhlife.gruvbox
|
|
||||||
jnoortheen.nix-ide
|
jnoortheen.nix-ide
|
||||||
justusadam.language-haskell
|
justusadam.language-haskell
|
||||||
mkhl.direnv
|
mkhl.direnv
|
||||||
|
|
|
@ -33,12 +33,12 @@
|
||||||
format = "{name} {icon}";
|
format = "{name} {icon}";
|
||||||
};
|
};
|
||||||
"sway/mode" = {
|
"sway/mode" = {
|
||||||
format = "<span style=\"italic\">{}<span>";
|
format = "{}";
|
||||||
};
|
};
|
||||||
mpd = {
|
mpd = {
|
||||||
format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ";
|
format = "{stateIcon} {artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})";
|
||||||
format-disconnected = "Disconnected ";
|
format-disconnected = "ﳌ";
|
||||||
format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ";
|
format-stopped = "";
|
||||||
unknown-tag = "N/A";
|
unknown-tag = "N/A";
|
||||||
interval = 2;
|
interval = 2;
|
||||||
consume-icons = {
|
consume-icons = {
|
||||||
|
@ -60,6 +60,11 @@
|
||||||
};
|
};
|
||||||
tooltip-format = "MPD (connected)";
|
tooltip-format = "MPD (connected)";
|
||||||
tooltip-format-disconnected = "MPD (disconnected)";
|
tooltip-format-disconnected = "MPD (disconnected)";
|
||||||
|
on-click = "${pkgs.mpc-cli}/bin/mpc toggle";
|
||||||
|
on-click-middle = "${pkgs.foot}/bin/foot ${pkgs.ncmpcpp}/bin/ncmpcpp";
|
||||||
|
on-click-right = "${pkgs.mpc-cli}/bin/mpc stop";
|
||||||
|
on-scroll-up = "${pkgs.mpc-cli}/bin/mpc seekthrough +00:00:10";
|
||||||
|
on-scroll-down = "${pkgs.mpc-cli}/bin/mpc seekthrough -00:00:10";
|
||||||
};
|
};
|
||||||
idle_inhibitor = {
|
idle_inhibitor = {
|
||||||
format = "{icon}";
|
format = "{icon}";
|
||||||
|
@ -106,20 +111,11 @@
|
||||||
bat = "BAT2";
|
bat = "BAT2";
|
||||||
};
|
};
|
||||||
network = {
|
network = {
|
||||||
format-wifi = "{essid} ({signalStrength}%) ";
|
format-wifi = " {essid} {ipaddr}";
|
||||||
format-ethernet = "{ipaddr}/{cidr} ";
|
format-ethernet = " {ipaddr}";
|
||||||
tooltip-format = "{ifname} via {gwaddr} ";
|
|
||||||
format-linked = "{ifname} (No IP) ";
|
|
||||||
format-disconnected = "Disconnected ⚠";
|
|
||||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
|
||||||
};
|
};
|
||||||
pulseaudio = {
|
pulseaudio = {
|
||||||
format = "{volume}% {icon} {format_source}";
|
format = "{icon} {volume}%";
|
||||||
format-bluetooth = "{volume}% {icon} {format_source}";
|
|
||||||
format-bluetooth-muted = " {icon} {format_source}";
|
|
||||||
format-muted = " {format_source}";
|
|
||||||
format-source = "{volume}% ";
|
|
||||||
format-source-muted = "";
|
|
||||||
format-icons = {
|
format-icons = {
|
||||||
headphone = "";
|
headphone = "";
|
||||||
hands-free = "";
|
hands-free = "";
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
systemd.user.services.wl-clipboard = {
|
systemd.user.services.wl-clipboard = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "wl-clipboard";
|
Description = "wl-clipboard";
|
||||||
|
After = ["graphical-session-pre.target"];
|
||||||
PartOf = ["graphical-session.target"];
|
PartOf = ["graphical-session.target"];
|
||||||
};
|
};
|
||||||
Install = {
|
Install.WantedBy = ["graphical-session.target"];
|
||||||
WantedBy = ["graphical-session.target"];
|
|
||||||
};
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.clipman}/bin/clipman store --no-persist";
|
ExecStart = "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.clipman}/bin/clipman store --no-persist";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
environment.systemPackages = [ pkgs.cifs-utils pkgs.lxqt.lxqt-policykit ];
|
environment.systemPackages = [pkgs.cifs-utils pkgs.lxqt.lxqt-policykit];
|
||||||
networking.firewall.extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns'';
|
networking.firewall.extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns'';
|
||||||
services.gvfs.enable = true;
|
services.gvfs.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
{pkgs, config, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/gitea.nix
|
../../modules/gitea.nix
|
||||||
(import ../../modules/gateway-st.nix {name = "gitea";})
|
(import ../../modules/gateway-st.nix {name = "gitea";})
|
||||||
|
|
348
default.nix
348
default.nix
|
@ -5,7 +5,6 @@
|
||||||
# containing 'defaultNix' (to be used in 'default.nix'), 'shellNix'
|
# containing 'defaultNix' (to be used in 'default.nix'), 'shellNix'
|
||||||
# (to be used in 'shell.nix').
|
# (to be used in 'shell.nix').
|
||||||
let
|
let
|
||||||
|
|
||||||
src = ./.;
|
src = ./.;
|
||||||
system = builtins.currentSystem or "unknown-system";
|
system = builtins.currentSystem or "unknown-system";
|
||||||
|
|
||||||
|
@ -13,169 +12,251 @@ let
|
||||||
|
|
||||||
lockFile = builtins.fromJSON (builtins.readFile lockFilePath);
|
lockFile = builtins.fromJSON (builtins.readFile lockFilePath);
|
||||||
|
|
||||||
fetchTree =
|
fetchTree = info:
|
||||||
info:
|
if info.type == "github"
|
||||||
if info.type == "github" then
|
then {
|
||||||
{ outPath =
|
outPath =
|
||||||
fetchTarball
|
fetchTarball
|
||||||
({ url = "https://api.${info.host or "github.com"}/repos/${info.owner}/${info.repo}/tarball/${info.rev}"; }
|
(
|
||||||
// (if info ? narHash then { sha256 = info.narHash; } else {})
|
{url = "https://api.${info.host or "github.com"}/repos/${info.owner}/${info.repo}/tarball/${info.rev}";}
|
||||||
);
|
// (
|
||||||
rev = info.rev;
|
if info ? narHash
|
||||||
shortRev = builtins.substring 0 7 info.rev;
|
then {sha256 = info.narHash;}
|
||||||
lastModified = info.lastModified;
|
else {}
|
||||||
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
|
)
|
||||||
narHash = info.narHash;
|
);
|
||||||
}
|
rev = info.rev;
|
||||||
else if info.type == "git" then
|
shortRev = builtins.substring 0 7 info.rev;
|
||||||
{ outPath =
|
lastModified = info.lastModified;
|
||||||
builtins.fetchGit
|
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
|
||||||
({ url = info.url; }
|
narHash = info.narHash;
|
||||||
// (if info ? rev then { inherit (info) rev; } else {})
|
}
|
||||||
// (if info ? ref then { inherit (info) ref; } else {})
|
else if info.type == "git"
|
||||||
// (if info ? submodules then { inherit (info) submodules; } else {})
|
then
|
||||||
);
|
{
|
||||||
lastModified = info.lastModified;
|
|
||||||
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
|
|
||||||
narHash = info.narHash;
|
|
||||||
} // (if info ? rev then {
|
|
||||||
rev = info.rev;
|
|
||||||
shortRev = builtins.substring 0 7 info.rev;
|
|
||||||
} else {
|
|
||||||
})
|
|
||||||
else if info.type == "path" then
|
|
||||||
{ outPath = builtins.path { path = info.path; };
|
|
||||||
narHash = info.narHash;
|
|
||||||
}
|
|
||||||
else if info.type == "tarball" then
|
|
||||||
{ outPath =
|
|
||||||
fetchTarball
|
|
||||||
({ inherit (info) url; }
|
|
||||||
// (if info ? narHash then { sha256 = info.narHash; } else {})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if info.type == "gitlab" then
|
|
||||||
{ inherit (info) rev narHash lastModified;
|
|
||||||
outPath =
|
outPath =
|
||||||
fetchTarball
|
builtins.fetchGit
|
||||||
({ url = "https://${info.host or "gitlab.com"}/api/v4/projects/${info.owner}%2F${info.repo}/repository/archive.tar.gz?sha=${info.rev}"; }
|
(
|
||||||
// (if info ? narHash then { sha256 = info.narHash; } else {})
|
{url = info.url;}
|
||||||
);
|
// (
|
||||||
shortRev = builtins.substring 0 7 info.rev;
|
if info ? rev
|
||||||
|
then {inherit (info) rev;}
|
||||||
|
else {}
|
||||||
|
)
|
||||||
|
// (
|
||||||
|
if info ? ref
|
||||||
|
then {inherit (info) ref;}
|
||||||
|
else {}
|
||||||
|
)
|
||||||
|
// (
|
||||||
|
if info ? submodules
|
||||||
|
then {inherit (info) submodules;}
|
||||||
|
else {}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
lastModified = info.lastModified;
|
||||||
|
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
|
||||||
|
narHash = info.narHash;
|
||||||
}
|
}
|
||||||
|
// (
|
||||||
|
if info ? rev
|
||||||
|
then {
|
||||||
|
rev = info.rev;
|
||||||
|
shortRev = builtins.substring 0 7 info.rev;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
)
|
||||||
|
else if info.type == "path"
|
||||||
|
then {
|
||||||
|
outPath = builtins.path {path = info.path;};
|
||||||
|
narHash = info.narHash;
|
||||||
|
}
|
||||||
|
else if info.type == "tarball"
|
||||||
|
then {
|
||||||
|
outPath =
|
||||||
|
fetchTarball
|
||||||
|
(
|
||||||
|
{inherit (info) url;}
|
||||||
|
// (
|
||||||
|
if info ? narHash
|
||||||
|
then {sha256 = info.narHash;}
|
||||||
|
else {}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if info.type == "gitlab"
|
||||||
|
then {
|
||||||
|
inherit (info) rev narHash lastModified;
|
||||||
|
outPath =
|
||||||
|
fetchTarball
|
||||||
|
(
|
||||||
|
{url = "https://${info.host or "gitlab.com"}/api/v4/projects/${info.owner}%2F${info.repo}/repository/archive.tar.gz?sha=${info.rev}";}
|
||||||
|
// (
|
||||||
|
if info ? narHash
|
||||||
|
then {sha256 = info.narHash;}
|
||||||
|
else {}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
shortRev = builtins.substring 0 7 info.rev;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
# FIXME: add Mercurial, tarball inputs.
|
# FIXME: add Mercurial, tarball inputs.
|
||||||
throw "flake input has unsupported input type '${info.type}'";
|
throw "flake input has unsupported input type '${info.type}'";
|
||||||
|
|
||||||
callFlake4 = flakeSrc: locks:
|
callFlake4 = flakeSrc: locks: let
|
||||||
let
|
flake = import (flakeSrc + "/flake.nix");
|
||||||
flake = import (flakeSrc + "/flake.nix");
|
|
||||||
|
|
||||||
inputs = builtins.mapAttrs (n: v:
|
inputs = builtins.mapAttrs (n: v:
|
||||||
if v.flake or true
|
if v.flake or true
|
||||||
then callFlake4 (fetchTree (v.locked // v.info)) v.inputs
|
then callFlake4 (fetchTree (v.locked // v.info)) v.inputs
|
||||||
else fetchTree (v.locked // v.info)) locks;
|
else fetchTree (v.locked // v.info))
|
||||||
|
locks;
|
||||||
|
|
||||||
outputs = flakeSrc // (flake.outputs (inputs // {self = outputs;}));
|
outputs = flakeSrc // (flake.outputs (inputs // {self = outputs;}));
|
||||||
in
|
in
|
||||||
assert flake.edition == 201909;
|
assert flake.edition == 201909; outputs;
|
||||||
outputs;
|
|
||||||
|
|
||||||
callLocklessFlake = flakeSrc:
|
callLocklessFlake = flakeSrc: let
|
||||||
let
|
flake = import (flakeSrc + "/flake.nix");
|
||||||
flake = import (flakeSrc + "/flake.nix");
|
outputs = flakeSrc // (flake.outputs {self = outputs;});
|
||||||
outputs = flakeSrc // (flake.outputs ({ self = outputs; }));
|
in
|
||||||
in outputs;
|
outputs;
|
||||||
|
|
||||||
rootSrc = let
|
rootSrc = let
|
||||||
# Try to clean the source tree by using fetchGit, if this source
|
# Try to clean the source tree by using fetchGit, if this source
|
||||||
# tree is a valid git repository.
|
# tree is a valid git repository.
|
||||||
tryFetchGit = src:
|
tryFetchGit = src:
|
||||||
if isGit && !isShallow
|
if isGit && !isShallow
|
||||||
then
|
then let
|
||||||
let res = builtins.fetchGit src;
|
res = builtins.fetchGit src;
|
||||||
in if res.rev == "0000000000000000000000000000000000000000" then removeAttrs res ["rev" "shortRev"] else res
|
in
|
||||||
else { outPath = src; };
|
if res.rev == "0000000000000000000000000000000000000000"
|
||||||
|
then removeAttrs res ["rev" "shortRev"]
|
||||||
|
else res
|
||||||
|
else {outPath = src;};
|
||||||
# NB git worktrees have a file for .git, so we don't check the type of .git
|
# NB git worktrees have a file for .git, so we don't check the type of .git
|
||||||
isGit = builtins.pathExists (src + "/.git");
|
isGit = builtins.pathExists (src + "/.git");
|
||||||
isShallow = builtins.pathExists (src + "/.git/shallow");
|
isShallow = builtins.pathExists (src + "/.git/shallow");
|
||||||
|
|
||||||
in
|
in
|
||||||
{ lastModified = 0; lastModifiedDate = formatSecondsSinceEpoch 0; }
|
{
|
||||||
// (if src ? outPath then src else tryFetchGit src);
|
lastModified = 0;
|
||||||
|
lastModifiedDate = formatSecondsSinceEpoch 0;
|
||||||
|
}
|
||||||
|
// (
|
||||||
|
if src ? outPath
|
||||||
|
then src
|
||||||
|
else tryFetchGit src
|
||||||
|
);
|
||||||
|
|
||||||
# Format number of seconds in the Unix epoch as %Y%m%d%H%M%S.
|
# Format number of seconds in the Unix epoch as %Y%m%d%H%M%S.
|
||||||
formatSecondsSinceEpoch = t:
|
formatSecondsSinceEpoch = t: let
|
||||||
let
|
rem = x: y: x - x / y * y;
|
||||||
rem = x: y: x - x / y * y;
|
days = t / 86400;
|
||||||
days = t / 86400;
|
secondsInDay = rem t 86400;
|
||||||
secondsInDay = rem t 86400;
|
hours = secondsInDay / 3600;
|
||||||
hours = secondsInDay / 3600;
|
minutes = (rem secondsInDay 3600) / 60;
|
||||||
minutes = (rem secondsInDay 3600) / 60;
|
seconds = rem t 60;
|
||||||
seconds = rem t 60;
|
|
||||||
|
|
||||||
# Courtesy of https://stackoverflow.com/a/32158604.
|
# Courtesy of https://stackoverflow.com/a/32158604.
|
||||||
z = days + 719468;
|
z = days + 719468;
|
||||||
era = (if z >= 0 then z else z - 146096) / 146097;
|
era =
|
||||||
doe = z - era * 146097;
|
(
|
||||||
yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365;
|
if z >= 0
|
||||||
y = yoe + era * 400;
|
then z
|
||||||
doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
|
else z - 146096
|
||||||
mp = (5 * doy + 2) / 153;
|
)
|
||||||
d = doy - (153 * mp + 2) / 5 + 1;
|
/ 146097;
|
||||||
m = mp + (if mp < 10 then 3 else -9);
|
doe = z - era * 146097;
|
||||||
y' = y + (if m <= 2 then 1 else 0);
|
yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365;
|
||||||
|
y = yoe + era * 400;
|
||||||
|
doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
|
||||||
|
mp = (5 * doy + 2) / 153;
|
||||||
|
d = doy - (153 * mp + 2) / 5 + 1;
|
||||||
|
m =
|
||||||
|
mp
|
||||||
|
+ (
|
||||||
|
if mp < 10
|
||||||
|
then 3
|
||||||
|
else -9
|
||||||
|
);
|
||||||
|
y' =
|
||||||
|
y
|
||||||
|
+ (
|
||||||
|
if m <= 2
|
||||||
|
then 1
|
||||||
|
else 0
|
||||||
|
);
|
||||||
|
|
||||||
pad = s: if builtins.stringLength s < 2 then "0" + s else s;
|
pad = s:
|
||||||
in "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}";
|
if builtins.stringLength s < 2
|
||||||
|
then "0" + s
|
||||||
|
else s;
|
||||||
|
in "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}";
|
||||||
|
|
||||||
allNodes =
|
allNodes =
|
||||||
builtins.mapAttrs
|
builtins.mapAttrs
|
||||||
(key: node:
|
(
|
||||||
let
|
key: node: let
|
||||||
sourceInfo =
|
sourceInfo =
|
||||||
if key == lockFile.root
|
if key == lockFile.root
|
||||||
then rootSrc
|
then rootSrc
|
||||||
else fetchTree (node.info or {} // removeAttrs node.locked ["dir"]);
|
else fetchTree (node.info or {} // removeAttrs node.locked ["dir"]);
|
||||||
|
|
||||||
subdir = if key == lockFile.root then "" else node.locked.dir or "";
|
subdir =
|
||||||
|
if key == lockFile.root
|
||||||
|
then ""
|
||||||
|
else node.locked.dir or "";
|
||||||
|
|
||||||
flake = import (sourceInfo + (if subdir != "" then "/" else "") + subdir + "/flake.nix");
|
flake = import (sourceInfo
|
||||||
|
+ (
|
||||||
|
if subdir != ""
|
||||||
|
then "/"
|
||||||
|
else ""
|
||||||
|
)
|
||||||
|
+ subdir
|
||||||
|
+ "/flake.nix");
|
||||||
|
|
||||||
inputs = builtins.mapAttrs
|
inputs =
|
||||||
(inputName: inputSpec: allNodes.${resolveInput inputSpec})
|
builtins.mapAttrs
|
||||||
(node.inputs or {});
|
(inputName: inputSpec: allNodes.${resolveInput inputSpec})
|
||||||
|
(node.inputs or {});
|
||||||
|
|
||||||
# Resolve a input spec into a node name. An input spec is
|
# Resolve a input spec into a node name. An input spec is
|
||||||
# either a node name, or a 'follows' path from the root
|
# either a node name, or a 'follows' path from the root
|
||||||
# node.
|
# node.
|
||||||
resolveInput = inputSpec:
|
resolveInput = inputSpec:
|
||||||
if builtins.isList inputSpec
|
if builtins.isList inputSpec
|
||||||
then getInputByPath lockFile.root inputSpec
|
then getInputByPath lockFile.root inputSpec
|
||||||
else inputSpec;
|
else inputSpec;
|
||||||
|
|
||||||
# Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the
|
# Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the
|
||||||
# root node, returning the final node.
|
# root node, returning the final node.
|
||||||
getInputByPath = nodeName: path:
|
getInputByPath = nodeName: path:
|
||||||
if path == []
|
if path == []
|
||||||
then nodeName
|
then nodeName
|
||||||
else
|
|
||||||
getInputByPath
|
|
||||||
# Since this could be a 'follows' input, call resolveInput.
|
|
||||||
(resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path})
|
|
||||||
(builtins.tail path);
|
|
||||||
|
|
||||||
outputs = flake.outputs (inputs // { self = result; });
|
|
||||||
|
|
||||||
result = outputs // sourceInfo // { inherit inputs; inherit outputs; inherit sourceInfo; };
|
|
||||||
in
|
|
||||||
if node.flake or true then
|
|
||||||
assert builtins.isFunction flake.outputs;
|
|
||||||
result
|
|
||||||
else
|
else
|
||||||
sourceInfo
|
getInputByPath
|
||||||
)
|
# Since this could be a 'follows' input, call resolveInput.
|
||||||
lockFile.nodes;
|
(resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path})
|
||||||
|
(builtins.tail path);
|
||||||
|
|
||||||
|
outputs = flake.outputs (inputs // {self = result;});
|
||||||
|
|
||||||
|
result =
|
||||||
|
outputs
|
||||||
|
// sourceInfo
|
||||||
|
// {
|
||||||
|
inherit inputs;
|
||||||
|
inherit outputs;
|
||||||
|
inherit sourceInfo;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
if node.flake or true
|
||||||
|
then assert builtins.isFunction flake.outputs; result
|
||||||
|
else sourceInfo
|
||||||
|
)
|
||||||
|
lockFile.nodes;
|
||||||
|
|
||||||
result =
|
result =
|
||||||
if !(builtins.pathExists lockFilePath)
|
if !(builtins.pathExists lockFilePath)
|
||||||
|
@ -185,4 +266,5 @@ let
|
||||||
else if lockFile.version >= 5 && lockFile.version <= 7
|
else if lockFile.version >= 5 && lockFile.version <= 7
|
||||||
then allNodes.${lockFile.root}
|
then allNodes.${lockFile.root}
|
||||||
else throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}";
|
else throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}";
|
||||||
in result.outputs
|
in
|
||||||
|
result.outputs
|
||||||
|
|
|
@ -1,26 +1,33 @@
|
||||||
rec {
|
rec {
|
||||||
authors = [
|
name = "Catppuccin Mocha Theme";
|
||||||
"Chris Kempson"
|
|
||||||
];
|
rosewater = "f5e0dc";
|
||||||
name = "Paraiso (dark)";
|
flamingo = "f2cdcd";
|
||||||
black = "2f1e2e";
|
pink = "f5c2e7";
|
||||||
dark-red = red;
|
mauve = "cba6f7";
|
||||||
dark-green = green;
|
red = "f38ba8";
|
||||||
dark-yellow = yellow;
|
maroon = "eba0ac";
|
||||||
dark-blue = blue;
|
peach = "fab387";
|
||||||
dark-magenta = magenta;
|
yellow = "f9e2af";
|
||||||
dark-cyan = cyan;
|
green = "a6e3a1";
|
||||||
light-grey = "998299";
|
teal = "94e2d5";
|
||||||
dark-grey = "737373";
|
sky = "89dceb";
|
||||||
red = "ef6155";
|
sapphire = "74c7ec";
|
||||||
green = "48b685";
|
blue = "89b4fa";
|
||||||
yellow = "fec418";
|
lavender = "b4befe";
|
||||||
blue = "06b6ef";
|
text = "cdd6f4";
|
||||||
magenta = "815ba4";
|
subtext1 = "bac2de";
|
||||||
cyan = "5bc4bf";
|
subtext0 = "a6adc8";
|
||||||
white = "e7e9db";
|
overlay2 = "9399b2";
|
||||||
bg = black;
|
overlay1 = "7f849c";
|
||||||
fg = white;
|
overlay0 = "6c7086";
|
||||||
|
surface2 = "585b70";
|
||||||
|
surface1 = "45475a";
|
||||||
|
surface0 = "313244";
|
||||||
|
base = "1e1e2e";
|
||||||
|
mantle = "181825";
|
||||||
|
crust = "11111b";
|
||||||
|
|
||||||
cssColor = color: "#${color}";
|
cssColor = color: "#${color}";
|
||||||
alacrittyColor = color: "0x${color}";
|
alacrittyColor = color: "0x${color}";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue