-
-
Notifications
You must be signed in to change notification settings - Fork 353
superfile: init #2398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
superfile: init #2398
Changes from all commits
a4f0695
a88fd41
a15b690
c856c2a
e29f4c3
1bf9798
bb5f96c
ef49333
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| { mkTarget, ... }: | ||
| mkTarget { | ||
| config = { colors }: { | ||
| programs.superfile = { | ||
| settings.theme = "stylix"; | ||
| themes.stylix = with colors.withHashtag; { | ||
| code_syntax_highlight = "stylix"; | ||
| full_screen_fg = base05; | ||
| full_screen_bg = base00; | ||
| gradient_color = [ base0E ]; | ||
| file_panel_fg = base05; | ||
| file_panel_bg = base00; | ||
| file_panel_border = base03; | ||
| file_panel_border_active = base16; | ||
| file_panel_top_directory_icon = base14; | ||
| file_panel_top_path = base0D; | ||
| file_panel_item_selected_fg = base0D; | ||
| file_panel_item_selected_bg = base00; | ||
| footer_fg = base09; | ||
| footer_bg = base00; | ||
| footer_border = base03; | ||
| footer_border_active = base16; | ||
| sidebar_fg = base05; | ||
| sidebar_bg = base00; | ||
| sidebar_title = base14; | ||
| sidebar_border = base03; | ||
| sidebar_border_active = base0F; | ||
| sidebar_item_selected_fg = base15; | ||
| sidebar_item_selected_bg = base00; | ||
| sidebar_divider = base03; | ||
| modal_fg = base05; | ||
| modal_bg = base00; | ||
| modal_border_active = base14; | ||
| modal_cancel_fg = base11; | ||
| modal_cancel_bg = base13; | ||
| modal_confirm_fg = base11; | ||
| modal_confirm_bg = base14; | ||
| help_menu_hotkey = base15; | ||
| help_menu_title = base14; | ||
| cursor = base13; | ||
| correct = base0B; | ||
| error = base0F; | ||
| hint = base15; | ||
| cancel = base13; | ||
| }; | ||
| }; | ||
| }; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { lib, ... }: { | ||
| name = "superfile"; | ||
| homepage = "https://superfile.dev"; | ||
| maintainers = [ lib.maintainers.reesilva ]; | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,143 @@ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| config, | ||||||||||||||||||||||
| lib, | ||||||||||||||||||||||
| pkgs, | ||||||||||||||||||||||
| ... | ||||||||||||||||||||||
| }: | ||||||||||||||||||||||
| let | ||||||||||||||||||||||
| inherit (lib) optionalAttrs; | ||||||||||||||||||||||
| inherit (config.lib.stylix) colors; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| chromaXml = | ||||||||||||||||||||||
| with colors.withHashtag; | ||||||||||||||||||||||
| pkgs.writeText "stylix-chroma.xml" '' | ||||||||||||||||||||||
| <style name="stylix"> | ||||||||||||||||||||||
| <entry type="Background" style="bg:${base00}"/> | ||||||||||||||||||||||
| <entry type="LineHighlight" style="bg:${base02}"/> | ||||||||||||||||||||||
| <entry type="LineNumbers" style="${base04}"/> | ||||||||||||||||||||||
| <entry type="LineNumbersTable" style="${base04}"/> | ||||||||||||||||||||||
| <entry type="LineTableTD" style=""/> | ||||||||||||||||||||||
| <entry type="LineTable" style=""/> | ||||||||||||||||||||||
| <entry type="CodeLine" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="Text" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="Punctuation" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="TextWhitespace" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="Other" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="Name" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="NameOther" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="NameConstant" style="${base0A}"/> | ||||||||||||||||||||||
| <entry type="NameDecorator" style="bold ${base0D}"/> | ||||||||||||||||||||||
| <entry type="NameEntity" style="${base0C}"/> | ||||||||||||||||||||||
| <entry type="NameException" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="NameNamespace" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="Literal" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="LiteralDate" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="Generic" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="GenericOutput" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="GenericPrompt" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="GenericStrong" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="GenericTraceback" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="Keyword" style="${base0E}"/> | ||||||||||||||||||||||
| <entry type="KeywordReserved" style="${base0E}"/> | ||||||||||||||||||||||
| <entry type="KeywordPseudo" style="${base0E}"/> | ||||||||||||||||||||||
| <entry type="KeywordConstant" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="KeywordDeclaration" style="${base08}"/> | ||||||||||||||||||||||
| <entry type="KeywordNamespace" style="${base0C}"/> | ||||||||||||||||||||||
| <entry type="KeywordType" style="${base08}"/> | ||||||||||||||||||||||
| <entry type="NameFunction" style="${base0D}"/> | ||||||||||||||||||||||
| <entry type="NameFunctionMagic" style="${base0D}"/> | ||||||||||||||||||||||
| <entry type="NameAttribute" style="${base0D}"/> | ||||||||||||||||||||||
| <entry type="NameClass" style="${base0A}"/> | ||||||||||||||||||||||
| <entry type="NameBuiltin" style="${base0C}"/> | ||||||||||||||||||||||
| <entry type="NameBuiltinPseudo" style="${base0C}"/> | ||||||||||||||||||||||
| <entry type="NameLabel" style="${base0C}"/> | ||||||||||||||||||||||
| <entry type="NameVariable" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="NameVariableClass" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="NameVariableGlobal" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="NameVariableInstance" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="NameVariableMagic" style="${base05}"/> | ||||||||||||||||||||||
| <entry type="NameProperty" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="NameTag" style="${base0E}"/> | ||||||||||||||||||||||
| <entry type="LiteralString" style="${base0B}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringChar" style="${base0B}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringSingle" style="${base0B}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringDouble" style="${base0B}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringBacktick" style="${base0B}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringOther" style="${base0B}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringSymbol" style="${base0B}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringInterpol" style="${base0B}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringHeredoc" style="${base04}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringDoc" style="${base04}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringEscape" style="${base0C}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringRegex" style="${base0C}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringDelimiter" style="${base0D}"/> | ||||||||||||||||||||||
| <entry type="LiteralStringAffix" style="${base0E}"/> | ||||||||||||||||||||||
| <entry type="LiteralNumber" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="LiteralNumberBin" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="LiteralNumberHex" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="LiteralNumberInteger" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="LiteralNumberFloat" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="LiteralNumberIntegerLong" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="LiteralNumberOct" style="${base09}"/> | ||||||||||||||||||||||
| <entry type="Operator" style="bold ${base0C}"/> | ||||||||||||||||||||||
| <entry type="OperatorWord" style="bold ${base0C}"/> | ||||||||||||||||||||||
| <entry type="Comment" style="italic ${base03}"/> | ||||||||||||||||||||||
| <entry type="CommentSingle" style="italic ${base03}"/> | ||||||||||||||||||||||
| <entry type="CommentMultiline" style="italic ${base03}"/> | ||||||||||||||||||||||
| <entry type="CommentSpecial" style="italic ${base03}"/> | ||||||||||||||||||||||
| <entry type="CommentHashbang" style="italic ${base03}"/> | ||||||||||||||||||||||
| <entry type="CommentPreproc" style="italic ${base03}"/> | ||||||||||||||||||||||
| <entry type="CommentPreprocFile" style="bold ${base03}"/> | ||||||||||||||||||||||
| <entry type="Error" style="${base08}"/> | ||||||||||||||||||||||
| <entry type="GenericError" style="${base08}"/> | ||||||||||||||||||||||
| <entry type="GenericDeleted" style="${base08} bg:${base01}"/> | ||||||||||||||||||||||
| <entry type="GenericInserted" style="${base0B} bg:${base01}"/> | ||||||||||||||||||||||
| <entry type="GenericEmph" style="italic ${base05}"/> | ||||||||||||||||||||||
| <entry type="GenericStrong" style="bold ${base05}"/> | ||||||||||||||||||||||
| <entry type="GenericUnderline" style="underline ${base05}"/> | ||||||||||||||||||||||
| <entry type="GenericHeading" style="bold ${base09}"/> | ||||||||||||||||||||||
| <entry type="GenericSubheading" style="bold ${base09}"/> | ||||||||||||||||||||||
| </style> | ||||||||||||||||||||||
| ''; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| registerGo = pkgs.writeText "register-stylix.go" '' | ||||||||||||||||||||||
| package main | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| import ( | ||||||||||||||||||||||
| _ "embed" | ||||||||||||||||||||||
| "strings" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| "github.com/alecthomas/chroma/v2" | ||||||||||||||||||||||
| "github.com/alecthomas/chroma/v2/styles" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| //go:embed stylix-chroma.xml | ||||||||||||||||||||||
| var stylixChromaXml string | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| func init() { | ||||||||||||||||||||||
| style, err := chroma.NewXMLStyle(strings.NewReader(stylixChromaXml)) | ||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||
| panic(err) | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| styles.Register(style) | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| ''; | ||||||||||||||||||||||
| in | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| overlay = | ||||||||||||||||||||||
| _final: prev: | ||||||||||||||||||||||
| optionalAttrs | ||||||||||||||||||||||
| ( | ||||||||||||||||||||||
| config.stylix.enable | ||||||||||||||||||||||
| && config.stylix.targets ? superfile | ||||||||||||||||||||||
| && config.stylix.targets.superfile.enable | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| superfile = prev.superfile.overrideAttrs (old: { | ||||||||||||||||||||||
| postPatch = (old.postPatch or "") + '' | ||||||||||||||||||||||
| cp ${registerGo} ./register-stylix.go | ||||||||||||||||||||||
| cp ${chromaXml} ./stylix-chroma.xml | ||||||||||||||||||||||
| ''; | ||||||||||||||||||||||
|
Comment on lines
+137
to
+140
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick:
Suggested change
|
||||||||||||||||||||||
| }); | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { lib, pkgs, ... }: { | ||
| stylix.testbed.ui = { | ||
| command = { | ||
| text = lib.getExe pkgs.superfile; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably open the |
||
| useTerminal = true; | ||
| }; | ||
| }; | ||
|
|
||
| home-manager.sharedModules = lib.singleton { | ||
| programs.superfile = { | ||
| enable = true; | ||
| firstUseCheck = false; | ||
| settings = { | ||
| auto_check_update = false; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? |
||
| ignore_missing_fields = true; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What fields are missing? |
||
| nerdfont = false; | ||
| }; | ||
| }; | ||
| }; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless this is the idiomatic Go formatting, the following might be better: