Update helix theme
This commit is contained in:
parent
86d1e2e383
commit
c342d535ba
13 changed files with 493 additions and 321 deletions
|
@ -16,171 +16,16 @@ desktop: {
|
|||
programs.helix = {
|
||||
enable = true;
|
||||
settings = {
|
||||
theme = "gruvbox";
|
||||
editor = {
|
||||
line-number = "relative";
|
||||
};
|
||||
};
|
||||
themes = {
|
||||
gruvbox = {
|
||||
# Author : Jakub Bartodziej <kubabartodziej@gmail.com>
|
||||
# The theme uses the gruvbox dark palette with standard contrast: github.com/morhetz/gruvbox
|
||||
"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";
|
||||
cursorline = true;
|
||||
color-modes = true;
|
||||
cursor-shape = {
|
||||
insert = "bar";
|
||||
normal = "block";
|
||||
select = "underline";
|
||||
};
|
||||
indent-guides.render = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
systemd.user.services.keepassxc = {
|
||||
Unit = {
|
||||
Description = "keepassxc";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = ["graphical-session-pre.target"];
|
||||
PartOf = ["graphical-session.target"];
|
||||
};
|
||||
Install.WantedBy = ["graphical-session.target"];
|
||||
Service = {
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
systemd.user.services.mako = {
|
||||
Unit = {
|
||||
Description = "mako";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = ["graphical-session-pre.target"];
|
||||
PartOf = ["graphical-session.target"];
|
||||
};
|
||||
Install.WantedBy = ["graphical-session.target"];
|
||||
Service = {
|
||||
|
|
|
@ -70,8 +70,8 @@ in {
|
|||
systemd.user.services.plover = {
|
||||
Unit = {
|
||||
Description = "plover";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = ["graphical-session-pre.target"];
|
||||
PartOf = ["graphical-session.target"];
|
||||
};
|
||||
Install.WantedBy = ["graphical-session.target"];
|
||||
Service = {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
font = "Noto Sans";
|
||||
extraConfig = {
|
||||
display-drun = " Apps ";
|
||||
display-run = " Run ";
|
||||
display-run = " Run ";
|
||||
};
|
||||
terminal = "${pkgs.foot}/bin/foot";
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
c="$";
|
||||
c = "$";
|
||||
switch_window = pkgs.writeScript "switchWindow" ''
|
||||
set -euo pipefail
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
|||
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" ''
|
||||
${pkgs.sway-contrib.grimshot}/bin/grimshot "$@"
|
||||
${pkgs.sway}/bin/swaymsg mode default
|
||||
|
|
|
@ -20,14 +20,33 @@ in {
|
|||
services.swayidle = {
|
||||
enable = true;
|
||||
events = [
|
||||
{ event = "before-sleep"; command = "${lock-script}"; }
|
||||
{ event = "lock"; command = "${lock-script}"; }
|
||||
{ event = "unlock"; command = "${unlock-script}"; }
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "${lock-script}";
|
||||
}
|
||||
{
|
||||
event = "lock";
|
||||
command = "${lock-script}";
|
||||
}
|
||||
{
|
||||
event = "unlock";
|
||||
command = "${unlock-script}";
|
||||
}
|
||||
];
|
||||
timeouts = [
|
||||
{ timeout = 300; command = "${lock-script}"; }
|
||||
{ timeout = 305; command = "${screen-off-script}"; resume = "${resume-script}"; }
|
||||
{ timeout = 900; command = "${suspend-script}"; }
|
||||
{
|
||||
timeout = 300;
|
||||
command = "${lock-script}";
|
||||
}
|
||||
{
|
||||
timeout = 305;
|
||||
command = "${screen-off-script}";
|
||||
resume = "${resume-script}";
|
||||
}
|
||||
{
|
||||
timeout = 900;
|
||||
command = "${suspend-script}";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -198,12 +198,12 @@ in {
|
|||
bright7 = subtext0;
|
||||
};
|
||||
|
||||
programs.rofi.theme = with theme;
|
||||
let element = {
|
||||
programs.rofi.theme = with theme; let
|
||||
element = {
|
||||
background-color = mkLiteral "inherit";
|
||||
text-color = mkLiteral "inherit";
|
||||
}; in
|
||||
{
|
||||
};
|
||||
in {
|
||||
"*" = {
|
||||
bg-col = rasiColor base;
|
||||
bg-col-light = rasiColor base;
|
||||
|
@ -309,4 +309,226 @@ in {
|
|||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
systemd.user.services.wl-clipboard = {
|
||||
Unit = {
|
||||
Description = "wl-clipboard";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = ["graphical-session-pre.target"];
|
||||
PartOf = ["graphical-session.target"];
|
||||
};
|
||||
Install.WantedBy = ["graphical-session.target"];
|
||||
Service = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{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'';
|
||||
services.gvfs.enable = true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
{pkgs, config, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
../../modules/gitea.nix
|
||||
(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'
|
||||
# (to be used in 'shell.nix').
|
||||
let
|
||||
|
||||
src = ./.;
|
||||
system = builtins.currentSystem or "unknown-system";
|
||||
|
||||
|
@ -13,169 +12,251 @@ let
|
|||
|
||||
lockFile = builtins.fromJSON (builtins.readFile lockFilePath);
|
||||
|
||||
fetchTree =
|
||||
info:
|
||||
if info.type == "github" then
|
||||
{ outPath =
|
||||
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 {})
|
||||
);
|
||||
rev = info.rev;
|
||||
shortRev = builtins.substring 0 7 info.rev;
|
||||
lastModified = info.lastModified;
|
||||
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
|
||||
narHash = info.narHash;
|
||||
}
|
||||
else if info.type == "git" then
|
||||
{ outPath =
|
||||
builtins.fetchGit
|
||||
({ url = info.url; }
|
||||
// (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;
|
||||
fetchTree = info:
|
||||
if info.type == "github"
|
||||
then {
|
||||
outPath =
|
||||
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 {}
|
||||
)
|
||||
);
|
||||
rev = info.rev;
|
||||
shortRev = builtins.substring 0 7 info.rev;
|
||||
lastModified = info.lastModified;
|
||||
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
|
||||
narHash = info.narHash;
|
||||
}
|
||||
else if info.type == "git"
|
||||
then
|
||||
{
|
||||
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;
|
||||
builtins.fetchGit
|
||||
(
|
||||
{url = info.url;}
|
||||
// (
|
||||
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
|
||||
# FIXME: add Mercurial, tarball inputs.
|
||||
throw "flake input has unsupported input type '${info.type}'";
|
||||
|
||||
callFlake4 = flakeSrc: locks:
|
||||
let
|
||||
flake = import (flakeSrc + "/flake.nix");
|
||||
callFlake4 = flakeSrc: locks: let
|
||||
flake = import (flakeSrc + "/flake.nix");
|
||||
|
||||
inputs = builtins.mapAttrs (n: v:
|
||||
if v.flake or true
|
||||
then callFlake4 (fetchTree (v.locked // v.info)) v.inputs
|
||||
else fetchTree (v.locked // v.info)) locks;
|
||||
inputs = builtins.mapAttrs (n: v:
|
||||
if v.flake or true
|
||||
then callFlake4 (fetchTree (v.locked // v.info)) v.inputs
|
||||
else fetchTree (v.locked // v.info))
|
||||
locks;
|
||||
|
||||
outputs = flakeSrc // (flake.outputs (inputs // {self = outputs;}));
|
||||
in
|
||||
assert flake.edition == 201909;
|
||||
outputs;
|
||||
outputs = flakeSrc // (flake.outputs (inputs // {self = outputs;}));
|
||||
in
|
||||
assert flake.edition == 201909; outputs;
|
||||
|
||||
callLocklessFlake = flakeSrc:
|
||||
let
|
||||
flake = import (flakeSrc + "/flake.nix");
|
||||
outputs = flakeSrc // (flake.outputs ({ self = outputs; }));
|
||||
in outputs;
|
||||
callLocklessFlake = flakeSrc: let
|
||||
flake = import (flakeSrc + "/flake.nix");
|
||||
outputs = flakeSrc // (flake.outputs {self = outputs;});
|
||||
in
|
||||
outputs;
|
||||
|
||||
rootSrc = let
|
||||
# Try to clean the source tree by using fetchGit, if this source
|
||||
# tree is a valid git repository.
|
||||
tryFetchGit = src:
|
||||
if isGit && !isShallow
|
||||
then
|
||||
let res = builtins.fetchGit src;
|
||||
in if res.rev == "0000000000000000000000000000000000000000" then removeAttrs res ["rev" "shortRev"] else res
|
||||
else { outPath = src; };
|
||||
then let
|
||||
res = builtins.fetchGit src;
|
||||
in
|
||||
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
|
||||
isGit = builtins.pathExists (src + "/.git");
|
||||
isShallow = builtins.pathExists (src + "/.git/shallow");
|
||||
|
||||
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.
|
||||
formatSecondsSinceEpoch = t:
|
||||
let
|
||||
rem = x: y: x - x / y * y;
|
||||
days = t / 86400;
|
||||
secondsInDay = rem t 86400;
|
||||
hours = secondsInDay / 3600;
|
||||
minutes = (rem secondsInDay 3600) / 60;
|
||||
seconds = rem t 60;
|
||||
formatSecondsSinceEpoch = t: let
|
||||
rem = x: y: x - x / y * y;
|
||||
days = t / 86400;
|
||||
secondsInDay = rem t 86400;
|
||||
hours = secondsInDay / 3600;
|
||||
minutes = (rem secondsInDay 3600) / 60;
|
||||
seconds = rem t 60;
|
||||
|
||||
# Courtesy of https://stackoverflow.com/a/32158604.
|
||||
z = days + 719468;
|
||||
era = (if z >= 0 then z else z - 146096) / 146097;
|
||||
doe = z - era * 146097;
|
||||
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);
|
||||
# Courtesy of https://stackoverflow.com/a/32158604.
|
||||
z = days + 719468;
|
||||
era =
|
||||
(
|
||||
if z >= 0
|
||||
then z
|
||||
else z - 146096
|
||||
)
|
||||
/ 146097;
|
||||
doe = z - era * 146097;
|
||||
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;
|
||||
in "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}";
|
||||
pad = s:
|
||||
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 =
|
||||
builtins.mapAttrs
|
||||
(key: node:
|
||||
let
|
||||
sourceInfo =
|
||||
if key == lockFile.root
|
||||
then rootSrc
|
||||
else fetchTree (node.info or {} // removeAttrs node.locked ["dir"]);
|
||||
(
|
||||
key: node: let
|
||||
sourceInfo =
|
||||
if key == lockFile.root
|
||||
then rootSrc
|
||||
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
|
||||
(inputName: inputSpec: allNodes.${resolveInput inputSpec})
|
||||
(node.inputs or {});
|
||||
inputs =
|
||||
builtins.mapAttrs
|
||||
(inputName: inputSpec: allNodes.${resolveInput inputSpec})
|
||||
(node.inputs or {});
|
||||
|
||||
# Resolve a input spec into a node name. An input spec is
|
||||
# either a node name, or a 'follows' path from the root
|
||||
# node.
|
||||
resolveInput = inputSpec:
|
||||
if builtins.isList inputSpec
|
||||
then getInputByPath lockFile.root inputSpec
|
||||
else inputSpec;
|
||||
# Resolve a input spec into a node name. An input spec is
|
||||
# either a node name, or a 'follows' path from the root
|
||||
# node.
|
||||
resolveInput = inputSpec:
|
||||
if builtins.isList inputSpec
|
||||
then getInputByPath lockFile.root inputSpec
|
||||
else inputSpec;
|
||||
|
||||
# Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the
|
||||
# root node, returning the final node.
|
||||
getInputByPath = nodeName: path:
|
||||
if path == []
|
||||
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
|
||||
# Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the
|
||||
# root node, returning the final node.
|
||||
getInputByPath = nodeName: path:
|
||||
if path == []
|
||||
then nodeName
|
||||
else
|
||||
sourceInfo
|
||||
)
|
||||
lockFile.nodes;
|
||||
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 sourceInfo
|
||||
)
|
||||
lockFile.nodes;
|
||||
|
||||
result =
|
||||
if !(builtins.pathExists lockFilePath)
|
||||
|
@ -185,4 +266,5 @@ let
|
|||
else if lockFile.version >= 5 && lockFile.version <= 7
|
||||
then allNodes.${lockFile.root}
|
||||
else throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}";
|
||||
in result.outputs
|
||||
in
|
||||
result.outputs
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
rec {
|
||||
name = "Catppuccin Mocha Theme";
|
||||
|
||||
rosewater = "f5e0dc";
|
||||
rosewater = "f5e0dc";
|
||||
flamingo = "f2cdcd";
|
||||
pink = "f5c2e7";
|
||||
mauve = "cba6f7";
|
||||
|
@ -27,7 +27,7 @@ rec {
|
|||
base = "1e1e2e";
|
||||
mantle = "181825";
|
||||
crust = "11111b";
|
||||
|
||||
|
||||
cssColor = color: "#${color}";
|
||||
alacrittyColor = color: "0x${color}";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue