Personal Nix setup

Restructure into flakes

+5 -1
.gitignore
···
+
/result
+
.*
-
.nix-secret
*.log
+
+
**/encrypt/*
+
!**/encrypt/*.age
-427
config/colors.nix
···
-
let
-
inherit (import ../modules/color-utils.nix) mkLuaSyntax mkVimSyntax mkVimHardlineColors mkColor mkHighlight;
-
in rec {
-
colors = {
-
gutter = (mkColor "#16171d" "232" "15"); # gutter fg grey
-
cursor = (mkColor "#2C323C" "236" "8"); # cursor grey
-
element = (mkColor "#404449" "238" "15"); # special grey
-
split = (mkColor "#282c34" "59" "15");
-
-
black = (mkColor "#13131a" "235" "0");
-
grey = (mkColor "#3E4452" "237" "15");
-
-
red = (mkColor "#ED95A8" "204" "1");
-
brightRed = (mkColor "#EF5350" "196" "9");
-
-
green = (mkColor "#C3E88D" "114" "2");
-
brightGreen = (mkColor "#C3E88D" "114" "2");
-
-
yellow = (mkColor "#FFCB6B" "180" "3");
-
brightYellow = (mkColor "#F78C6C" "173" "11"); # dark yellow
-
-
blue = (mkColor "#82B1FF" "39" "4");
-
brightBlue = (mkColor "#939EDE" "39" "4"); # blue purple
-
-
purple = (mkColor "#C792EA" "170" "5");
-
brightPurple = (mkColor "#FF45AE" "170" "5");
-
-
cyan = (mkColor "#89DDFF" "38" "6");
-
brightCyan = (mkColor "#20D6E3" "38" "6");
-
-
white = (mkColor "#ECEFF1" "145" "7");
-
brightWhite = (mkColor "#697098" "59" "15"); # comment grey
-
darkWhite = (mkColor "#F8F8F2" "59" "15");
-
};
-
-
vim-hardline = mkVimHardlineColors colors;
-
lua = mkLuaSyntax colors;
-
-
vim = with colors; mkVimSyntax "theme" {
-
# Syntax Groups (descriptions and ordering from `:h w18`)
-
Comment = { fg = brightWhite; style = "italic"; };
-
Constant = { fg = cyan; };
-
String = { fg = green; };
-
Character = { fg = green; };
-
Number = { fg = brightYellow; };
-
Boolean = { fg = red; };
-
Float = { fg = brightYellow; };
-
Identifier = { fg = red; };
-
Function = { fg = blue; };
-
Statement = { fg = purple; };
-
Conditional = { fg = purple; };
-
Repeat = { fg = purple; };
-
Label = { fg = purple; };
-
Operator = { fg = cyan; };
-
Keyword = { fg = red; };
-
Exception = { fg = purple; };
-
PreProc = { fg = yellow; };
-
Include = { fg = blue; };
-
Define = { fg = purple; };
-
Macro = { fg = purple; };
-
PreCondit = { fg = yellow; };
-
Type = { fg = yellow; };
-
StorageClass = { fg = yellow; };
-
Structure = { fg = yellow; };
-
Typedef = { fg = yellow; };
-
Special = { fg = blue; };
-
SpecialChar = mkHighlight {};
-
Tag = mkHighlight {};
-
Delimiter = mkHighlight {};
-
Debug = mkHighlight {};
-
Ignore = mkHighlight {};
-
SpecialComment = { fg = brightWhite; };
-
Underlined = mkHighlight { style = "underline"; };
-
Error = { fg = brightRed; };
-
Todo = { fg = purple; };
-
-
# Highlighting Groups (descriptions and ordering from `:h hitest.vim`)
-
ColorColumn = { bg = cursor; };
-
Conceal = mkHighlight {};
-
Cursor = { fg = black; bg=blue; };
-
CursorIM = mkHighlight {};
-
CursorColumn = { bg = cursor; };
-
CursorLine = { bg = gutter; };
-
Directory = { fg = blue; };
-
-
Diff = {
-
Add = { bg = gutter; };
-
Change = mkHighlight {};
-
Delete = { fg = brightWhite; };
-
Text = { style = "strikethrough"; };
-
};
-
-
Pmenu = {
-
base = { bg = grey; };
-
Sel = { fg = black; bg = blue; };
-
Sbar = { bg = element; };
-
Thumb = { bg = white; };
-
};
-
-
ErrorMsg = { fg = brightRed; };
-
WarningMsg = { fg = yellow; };
-
VertSplit = { fg = gutter; };
-
Folded = { bg = gutter; fg = brightWhite; };
-
FoldColumn = mkHighlight {};
-
SignColumn = mkHighlight {};
-
IncSearch = { fg = blue; style = "reverse"; };
-
LineNr = { fg = black; bg = black; };
-
CursorLineNr = { fg = brightWhite; bg = gutter; style = "bold"; };
-
MatchParen = { fg = blue; style = "underline"; };
-
ModeMsg = mkHighlight {};
-
MoreMsg = mkHighlight {};
-
NonText = { fg = element; };
-
Normal = { fg = darkWhite; };
-
Question = { fg = purple; };
-
Search = { fg = black; bg = yellow; };
-
SpecialKey = { fg = element; };
-
-
Spell = {
-
Bad = { fg = red; style = "underline"; };
-
Cap = { fg = brightYellow; };
-
Local = { fg = brightYellow; };
-
Rare = { fg = brightYellow; };
-
};
-
-
TabLine = {
-
base = { fg = brightWhite; };
-
Fill = mkHighlight {};
-
Sel = { fg = white; };
-
};
-
-
StatusLine = { fg = white; bg = cursor; };
-
StatusLineNC = { fg = brightWhite; };
-
Title = { fg = green; };
-
Visual = { bg = grey; };
-
VisualNOS = { fg = grey; };
-
WildMenu = { fg = black; bg = blue; };
-
NormalFloat = { bg = split; };
-
TreesitterContext = { bg = gutter; };
-
-
dockerfile.Keyword = { fg = purple; };
-
-
sh = {
-
Set = { fg = cyan; };
-
SetOption = { fg = white; };
-
Statement = { fg = cyan; };
-
FunctionKey = { fg = purple; };
-
};
-
-
css = {
-
AttrComma = { fg = purple; };
-
AttributeSelector = { fg = green; };
-
Braces = { fg = white; };
-
ClassName = { fg = brightYellow; };
-
ClassNameDot = { fg = brightYellow; };
-
Definition = { fg = purple; };
-
FontAttr = { fg = brightYellow; };
-
FontDescriptor = { fg = purple; };
-
FunctionName = { fg = blue; };
-
Identifier = { fg = blue; };
-
Important = { fg = purple; };
-
Include = { fg = white; };
-
IncludeKeyword = { fg = purple; };
-
MediaType = { fg = brightYellow; };
-
Prop = { fg = purple; };
-
PseudoClassId = { fg = brightYellow; };
-
SelectorOp = { fg = purple; };
-
SelectorOp2 = { fg = purple; };
-
TagName = { fg = red; };
-
Color = { fg = brightYellow; };
-
CommonAttr = { fg = blue; };
-
UnitDecorators = { fg = yellow; };
-
};
-
-
go.Declaration = { fg = purple; };
-
-
html = {
-
Title = { fg = white; };
-
Arg = { fg = yellow; };
-
EndTag = { fg = cyan; };
-
Link = { fg = purple; };
-
SpecialChar = { fg = brightYellow; };
-
SpecialTagName = { fg = red; };
-
Tag = { fg = cyan; };
-
TagName = { fg = red; };
-
H1 = { fg = blue; };
-
H2 = { fg = blue; };
-
H3 = { fg = blue; };
-
H4 = { fg = blue; };
-
H5 = { fg = blue; };
-
H6 = { fg = blue; };
-
};
-
-
javaScript = {
-
Braces = { fg = white; };
-
Function = { fg = purple; };
-
Identifier = { fg = purple; };
-
Null = { fg = brightYellow; };
-
Number = { fg = brightYellow; };
-
Require = { fg = cyan; };
-
Reserved = { fg = purple; };
-
};
-
-
# For: https://github.com/pangloss/vim-javascript
-
js = {
-
ArrowFunction = { fg = purple; };
-
ClassKeyword = { fg = purple; };
-
ClassDefinition = { fg = yellow; };
-
ClassMethodType = { fg = purple; };
-
ClassFuncName = { fg = blue; };
-
DestructuringBlock = { fg = blue; };
-
DocParam = { fg = blue; };
-
DocTags = { fg = purple; };
-
Export = { fg = purple; };
-
ExportDefault = { fg = red; };
-
ExtendsKeyword = { fg = purple; };
-
Conditional = { fg = purple; };
-
Operator = { fg = purple; };
-
From = { fg = purple; };
-
FuncArgs = { fg = blue; };
-
FuncCall = { fg = blue; };
-
ObjectProp = { fg = cyan; };
-
Function = { fg = purple; };
-
Generator = { fg = yellow; };
-
GlobalObjects = { fg = yellow; };
-
Import = { fg = purple; };
-
ModuleAs = { fg = purple; };
-
ModuleWords = { fg = purple; };
-
ModuleKeyword = { fg = blue; };
-
Modules = { fg = purple; };
-
Null = { fg = brightYellow; };
-
StorageClass = { fg = purple; };
-
Super = { fg = red; };
-
TemplateBraces = { fg = brightRed; };
-
TemplateVar = { fg = green; };
-
This = { fg = red; };
-
Undefined = { fg = brightYellow; };
-
};
-
-
# For: https://github.com/othree/yajs.vim
-
javascript = {
-
ArrowFunc = { fg = purple; };
-
ClassExtends = { fg = purple; };
-
ClassKeyword = { fg = purple; };
-
DocNotation = { fg = purple; };
-
DocParamName = { fg = blue; };
-
DocTags = { fg = purple; };
-
EndColons = { fg = white; };
-
Export = { fg = purple; };
-
FuncArg = { fg = white; };
-
FuncKeyword = { fg = purple; };
-
Identifier = { fg = red; };
-
Import = { fg = purple; };
-
MethodName = { fg = white; };
-
ObjectLabel = { fg = white; };
-
OpSymbol = { fg = cyan; };
-
OpSymbols = { fg = cyan; };
-
PropertyName = { fg = green; };
-
TemplateSB = { fg = brightRed; };
-
Variable = { fg = purple; };
-
};
-
-
typescript = {
-
Identifier = { fg = red; };
-
Reserved = { fg = purple; };
-
EndColons = { fg = white; };
-
Braces = { fg = white; };
-
};
-
-
json = {
-
CommentError = { fg = white; };
-
Keyword = { fg = blue; };
-
Boolean = { fg = red; };
-
Number = { fg = brightYellow; };
-
Quote = { fg = white; };
-
String = { fg = green; };
-
MissingCommaError = { fg = brightRed; style = "reverse"; };
-
NoQuotesError = { fg = brightRed; style = "reverse"; };
-
NumError = { fg = brightRed; style = "reverse"; };
-
StringSQError = { fg = brightRed; style = "reverse"; };
-
SemicolonError = { fg = brightRed; style = "reverse"; };
-
};
-
-
markdown = {
-
Code = { fg = green; };
-
LinkReference = { fg = brightWhite; };
-
JekyllFrontMatter = { fg = brightWhite; };
-
CodeBlock = { fg = green; };
-
CodeDelimiter = { fg = green; };
-
HeadingDelimiter = { fg = red; };
-
Rule = { fg = brightWhite; };
-
HeadingRule = { fg = brightWhite; };
-
Delimiter = { fg = cyan; };
-
Id = { fg = purple; };
-
Blockquote = { fg = brightWhite; };
-
Italic = { fg = purple; style = "italic"; };
-
Bold = { fg = purple; style = "bold"; };
-
OrderedListMarker = { fg = red; };
-
IdDeclaration = { fg = blue; };
-
LinkDelimiter = { fg = white; };
-
};
-
-
mkd = {
-
Italic = { fg = purple; style = "italic"; };
-
Bold = { fg = purple; style = "bold"; };
-
InlineURL = { fg = red; };
-
ListItem = { fg = yellow; };
-
Link = { fg = white; };
-
URL = { fg = red; };
-
};
-
-
xml = {
-
Attrib = { fg = yellow; };
-
EndTag = { fg = red; };
-
Tag = { fg = red; };
-
TagName = { fg = red; };
-
};
-
-
php = {
-
Include = { fg = purple; };
-
Class = { fg = yellow; };
-
Classes = { fg = yellow; };
-
Function = { fg = blue; };
-
Type = { fg = purple; };
-
Keyword = { fg = purple; };
-
VarSelector = { fg = purple; };
-
Identifier = { fg = white; };
-
Method = { fg = blue; };
-
Boolean = { fg = blue; };
-
Parent = { fg = white; };
-
Operator = { fg = purple; };
-
Region = { fg = purple; };
-
UseNamespaceSeparator = { fg = white; };
-
ClassNamespaceSeparator = { fg = white; };
-
DocTags = { fg = purple; style="italic"; };
-
DocParam = { fg = purple; style="italic"; };
-
};
-
-
debug = {
-
Breakpoint = { fg = brightBlue; };
-
PC = { bg = brightBlue; fg = black; };
-
};
-
-
gitcommit = {
-
Comment = { fg = brightWhite; };
-
Untracked = { fg = brightWhite; };
-
Discarded = { fg = brightWhite; };
-
Selected = { fg = brightWhite; };
-
Unmerged = { fg = green; };
-
OnBranch = mkHighlight {};
-
Branch = { fg = purple; };
-
NoBranch = { fg = purple; };
-
DiscardedType = { fg = red; };
-
SelectedType = { fg = green; };
-
Header = mkHighlight {};
-
UntrackedFile = { fg = cyan; };
-
DiscardedFile = { fg = red; };
-
SelectedFile = { fg = green; };
-
UntrackedArrow = { fg = cyan; };
-
DiscardedArrow = { fg = red; };
-
SelectedArrow = { fg = green; };
-
UnmergedFile = { fg = yellow; };
-
File = mkHighlight {};
-
Summary = { fg = white; };
-
Overflow = { fg = red; };
-
};
-
-
terminal = {
-
background = { fg = black; };
-
foreground = { fg = white; };
-
black = { fg = black; };
-
red = { fg = red; };
-
green = { fg = green; };
-
yellow = { fg = yellow; };
-
blue = { fg = blue; };
-
purple = { fg = purple; };
-
cyan = { fg = cyan; };
-
white = { fg = white; };
-
grey = { fg = grey; };
-
brightRed = { fg = brightRed; };
-
brightGreen = { fg = brightGreen; };
-
brightYellow = { fg = brightYellow; };
-
brightBlue = { fg = brightBlue; };
-
brightPurple = { fg = brightPurple; };
-
brightCyan = { fg = brightCyan; };
-
brightWhite = { fg = brightWhite; };
-
};
-
-
GitSigns = {
-
Add = { fg = green; };
-
Change = { fg = brightBlue; };
-
Delete = { fg = brightRed; };
-
};
-
-
Signify = {
-
Add = { fg = green; };
-
Change = { fg = brightBlue; };
-
Delete = { fg = brightRed; };
-
};
-
-
GitGutter = {
-
Add = { fg = green; };
-
Change = { fg = brightBlue; };
-
Delete = { fg = brightRed; };
-
};
-
-
Neomake = {
-
WarningSign = { fg = yellow; };
-
ErrorSign = { fg = brightRed; };
-
InfoSign = { fg = blue; };
-
};
-
-
DiagnosticSign = {
-
Warn = { fg = yellow; };
-
Error = { fg = brightRed; };
-
Information = { fg = blue; };
-
Hint = { fg = yellow; };
-
};
-
-
Telescope = {
-
Border = { fg = split; };
-
Matching = { fg = blue; style = "bold"; };
-
};
-
-
TS.Definition = { fg = blue; bg = brightWhite; };
-
EasyMotion.IncSearch = { fg = blue; style = "bold"; };
-
};
-
}
-61
config/fonts.nix
···
-
{ pkgs, lib, ... }:
-
-
let
-
inherit (import ../nix/secrets.nix) readSecretFile;
-
inherit (import ../nix/derivations.nix) copyFiles;
-
-
inherit (lib) mkMerge mkIf optional flatten;
-
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
-
-
dank-mono = copyFiles "font-dank-mono" [
-
{
-
target = "share/fonts/opentype/DankMono-Regular.otf";
-
source = readSecretFile ../assets/DankMono-Regular.otf;
-
}
-
{
-
target = "share/fonts/opentype/DankMono-Italic.otf";
-
source = readSecretFile ../assets/DankMono-Italic.otf;
-
}
-
{
-
target = "share/fonts/opentype/DankMono-Bold.otf";
-
source = readSecretFile ../assets/DankMono-Bold.otf;
-
}
-
];
-
-
monolisa = copyFiles "font-monolisa" [
-
{
-
target = "share/fonts/opentype/MonoLisa-Regular.otf";
-
source = readSecretFile ../assets/MonoLisa-Regular.otf;
-
}
-
{
-
target = "share/fonts/opentype/MonoLisa-Bold.otf";
-
source = readSecretFile ../assets/MonoLisa-Bold.otf;
-
}
-
{
-
target = "share/fonts/opentype/MonoLisa-BoldItalic.otf";
-
source = readSecretFile ../assets/MonoLisa-BoldItalic.otf;
-
}
-
];
-
-
codicons = copyFiles "font-codicon" [
-
{
-
target = "share/fonts/opentype/codicon.otf";
-
source = readSecretFile ../assets/codicon.otf;
-
}
-
];
-
in
-
-
mkMerge [
-
{
-
fonts.fonts = with pkgs; flatten [
-
monolisa
-
dank-mono
-
codicons
-
(optional isLinux emojione)
-
];
-
}
-
-
(mkIf isDarwin {
-
fonts.enableFontDir = true;
-
})
-
]
config/gpg.nix modules/gpg.nix
-10
config/home/default.nix
···
-
{
-
imports = [
-
./git.nix
-
./zsh.nix
-
./gpg.nix
-
./tmux.nix
-
./npmrc.nix
-
./wezterm/default.nix
-
];
-
}
+3 -4
config/home/git.nix home/git.nix
···
-
{ pkgs, lib, ... }:
+
{ pkgs, lib, ... } @ inputs:
-
let
-
inherit (import ../../nix/secrets.nix) readSecretFileContents;
-
in {
+
{
programs.git = {
enable = true;
userName = "Phil Pluckthun";
···
recommit = "commit -a --amend --no-edit";
pushf = "push --force-with-lease";
glog = "log --pretty=longline --decorate --all --graph --date=relative";
+
journal = "!f() { git commit -a -m \"$(date +'%Y-%m-%d %H:%M:%S')\"; }; f";
};
extraConfig = {
-16
config/home/gpg.nix
···
-
let
-
inherit (import ../../nix/secrets.nix) readSecretFile;
-
in {
-
home.file.".gnupg/pubring.kbx".source =
-
readSecretFile ../../assets/pubring.kbx;
-
home.file.".gnupg/private-keys-v1.d/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key".source =
-
readSecretFile ../../assets/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key;
-
home.file.".gnupg/private-keys-v1.d/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key".source =
-
readSecretFile ../../assets/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key;
-
home.file.".gnupg/private-keys-v1.d/CA84692E3CC846C8EC7272468E962B63FC599E49.key".source =
-
readSecretFile ../../assets/CA84692E3CC846C8EC7272468E962B63FC599E49.key;
-
home.file.".gnupg/sshcontrol".text = ''
-
E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6
-
75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7
-
'';
-
}
-14
config/home/npmrc.nix
···
-
let
-
inherit (import ../../nix/secrets.nix) readSecretFileContents;
-
in {
-
home.file.".npmrc".text = ''
-
update-notifier = off
-
loglevel = warn
-
'' + (readSecretFileContents ../../assets/npmrc);
-
-
home.file.".yarnrc".text = ''
-
disable-self-update-check true
-
email phil@kitten.sh
-
username philpl
-
'';
-
}
+4 -4
config/home/tmux.nix home/tmux.nix
···
-
{ lib, pkgs, ... }:
+
{ lib, pkgs, ... } @ inputs:
let
-
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux;
-
colors = (import ../colors.nix).colors;
+
inherit (pkgs) stdenv;
+
inherit (import ../lib/colors.nix inputs) colors;
defaultActiveColor = colors.yellow.gui;
defaultInactiveColor = colors.brightWhite.gui;
···
terminal = "xterm-256color";
sensibleOnTop = false;
-
secureSocket = isLinux;
+
secureSocket = stdenv.hostPlatform.isLinux;
plugins = [ ];
-12
config/home/wezterm/default.nix
···
-
{ pkgs, ... }:
-
-
let
-
colors = (import ../../colors.nix);
-
in {
-
home.packages = [ pkgs.wezterm ];
-
-
xdg.configFile."wezterm/wezterm.lua".text = ''
-
local zsh_bin = "${pkgs.zsh}/bin/zsh";
-
local colors = ${colors.lua};
-
'' + (builtins.readFile ./init.lua);
-
}
config/home/wezterm/init.lua home/wezterm/init.lua
-1
config/home/zsh.nix home/zsh.nix
···
enableCompletion = false;
shellAliases = {
-
nix-encrypt = "openssl enc -e -aes-256-cbc -pbkdf2 -salt -base64 -kfile ${../../.nix-secret}";
ls = "ls --color=auto";
ll = "ls -l";
wx = "wezmux";
-12
config/mysql.nix
···
-
{ pkgs, ... }:
-
-
{
-
services.mysql = {
-
enable = true;
-
package = pkgs.mariadb_1010;
-
dataDir = "/var/lib/mysql";
-
settings.mysqld = {
-
bind-address = "127.0.0.1";
-
};
-
};
-
}
+1 -1
config/nodejs.nix modules/nodejs.nix
···
-
{ cfg, pkgs, ... }:
+
{ pkgs, ... }:
{
environment.variables.PNPM_HOME = "$HOME/.local/share/pnpm";
-427
config/nvim/colors.nix
···
-
let
-
inherit (import ../../modules/color-utils.nix) mkLuaSyntax mkVimSyntax mkVimHardlineColors mkColor mkHighlight;
-
in rec {
-
colors = {
-
gutter = (mkColor "#16171d" "232" "15"); # gutter fg grey
-
cursor = (mkColor "#2C323C" "236" "8"); # cursor grey
-
element = (mkColor "#404449" "238" "15"); # special grey
-
split = (mkColor "#282c34" "59" "15");
-
-
black = (mkColor "#13131a" "235" "0");
-
grey = (mkColor "#3E4452" "237" "15");
-
-
red = (mkColor "#ED95A8" "204" "1");
-
brightRed = (mkColor "#EF5350" "196" "9");
-
-
green = (mkColor "#C3E88D" "114" "2");
-
brightGreen = (mkColor "#C3E88D" "114" "2");
-
-
yellow = (mkColor "#FFCB6B" "180" "3");
-
brightYellow = (mkColor "#F78C6C" "173" "11"); # dark yellow
-
-
blue = (mkColor "#82B1FF" "39" "4");
-
brightBlue = (mkColor "#939EDE" "39" "4"); # blue purple
-
-
purple = (mkColor "#C792EA" "170" "5");
-
brightPurple = (mkColor "#FF45AE" "170" "5");
-
-
cyan = (mkColor "#89DDFF" "38" "6");
-
brightCyan = (mkColor "#20D6E3" "38" "6");
-
-
white = (mkColor "#ECEFF1" "145" "7");
-
brightWhite = (mkColor "#697098" "59" "15"); # comment grey
-
darkWhite = (mkColor "#F8F8F2" "59" "15");
-
};
-
-
vim-hardline = mkVimHardlineColors colors;
-
lua = mkLuaSyntax colors;
-
-
vim = with colors; mkVimSyntax "theme" {
-
# Syntax Groups (descriptions and ordering from `:h w18`)
-
Comment = { fg = brightWhite; style = "italic"; };
-
Constant = { fg = cyan; };
-
String = { fg = green; };
-
Character = { fg = green; };
-
Number = { fg = brightYellow; };
-
Boolean = { fg = red; };
-
Float = { fg = brightYellow; };
-
Identifier = { fg = red; };
-
Function = { fg = blue; };
-
Statement = { fg = purple; };
-
Conditional = { fg = purple; };
-
Repeat = { fg = purple; };
-
Label = { fg = purple; };
-
Operator = { fg = cyan; };
-
Keyword = { fg = red; };
-
Exception = { fg = purple; };
-
PreProc = { fg = yellow; };
-
Include = { fg = blue; };
-
Define = { fg = purple; };
-
Macro = { fg = purple; };
-
PreCondit = { fg = yellow; };
-
Type = { fg = yellow; };
-
StorageClass = { fg = yellow; };
-
Structure = { fg = yellow; };
-
Typedef = { fg = yellow; };
-
Special = { fg = blue; };
-
SpecialChar = mkHighlight {};
-
Tag = mkHighlight {};
-
Delimiter = mkHighlight {};
-
Debug = mkHighlight {};
-
Ignore = mkHighlight {};
-
SpecialComment = { fg = brightWhite; };
-
Underlined = mkHighlight { style = "underline"; };
-
Error = { fg = brightRed; };
-
Todo = { fg = purple; };
-
-
# Highlighting Groups (descriptions and ordering from `:h hitest.vim`)
-
ColorColumn = { bg = cursor; };
-
Conceal = mkHighlight {};
-
Cursor = { fg = black; bg=blue; };
-
CursorIM = mkHighlight {};
-
CursorColumn = { bg = cursor; };
-
CursorLine = { bg = gutter; };
-
Directory = { fg = blue; };
-
-
Diff = {
-
Add = { bg = gutter; };
-
Change = mkHighlight {};
-
Delete = { fg = brightWhite; };
-
Text = { style = "strikethrough"; };
-
};
-
-
Pmenu = {
-
base = { bg = grey; };
-
Sel = { fg = black; bg = blue; };
-
Sbar = { bg = element; };
-
Thumb = { bg = white; };
-
};
-
-
ErrorMsg = { fg = brightRed; };
-
WarningMsg = { fg = yellow; };
-
VertSplit = { fg = gutter; };
-
Folded = { bg = gutter; fg = brightWhite; };
-
FoldColumn = mkHighlight {};
-
SignColumn = mkHighlight {};
-
IncSearch = { fg = blue; style = "reverse"; };
-
LineNr = { fg = black; bg = black; };
-
CursorLineNr = { fg = brightWhite; bg = gutter; style = "bold"; };
-
MatchParen = { fg = blue; style = "underline"; };
-
ModeMsg = mkHighlight {};
-
MoreMsg = mkHighlight {};
-
NonText = { fg = element; };
-
Normal = { fg = darkWhite; };
-
Question = { fg = purple; };
-
Search = { fg = black; bg = yellow; };
-
SpecialKey = { fg = element; };
-
-
Spell = {
-
Bad = { fg = red; style = "underline"; };
-
Cap = { fg = brightYellow; };
-
Local = { fg = brightYellow; };
-
Rare = { fg = brightYellow; };
-
};
-
-
TabLine = {
-
base = { fg = brightWhite; };
-
Fill = mkHighlight {};
-
Sel = { fg = white; };
-
};
-
-
StatusLine = { fg = white; bg = cursor; };
-
StatusLineNC = { fg = brightWhite; };
-
Title = { fg = green; };
-
Visual = { bg = grey; };
-
VisualNOS = { fg = grey; };
-
WildMenu = { fg = black; bg = blue; };
-
NormalFloat = { bg = split; };
-
TreesitterContext = { bg = gutter; };
-
-
dockerfile.Keyword = { fg = purple; };
-
-
sh = {
-
Set = { fg = cyan; };
-
SetOption = { fg = white; };
-
Statement = { fg = cyan; };
-
FunctionKey = { fg = purple; };
-
};
-
-
css = {
-
AttrComma = { fg = purple; };
-
AttributeSelector = { fg = green; };
-
Braces = { fg = white; };
-
ClassName = { fg = brightYellow; };
-
ClassNameDot = { fg = brightYellow; };
-
Definition = { fg = purple; };
-
FontAttr = { fg = brightYellow; };
-
FontDescriptor = { fg = purple; };
-
FunctionName = { fg = blue; };
-
Identifier = { fg = blue; };
-
Important = { fg = purple; };
-
Include = { fg = white; };
-
IncludeKeyword = { fg = purple; };
-
MediaType = { fg = brightYellow; };
-
Prop = { fg = purple; };
-
PseudoClassId = { fg = brightYellow; };
-
SelectorOp = { fg = purple; };
-
SelectorOp2 = { fg = purple; };
-
TagName = { fg = red; };
-
Color = { fg = brightYellow; };
-
CommonAttr = { fg = blue; };
-
UnitDecorators = { fg = yellow; };
-
};
-
-
go.Declaration = { fg = purple; };
-
-
html = {
-
Title = { fg = white; };
-
Arg = { fg = yellow; };
-
EndTag = { fg = cyan; };
-
Link = { fg = purple; };
-
SpecialChar = { fg = brightYellow; };
-
SpecialTagName = { fg = red; };
-
Tag = { fg = cyan; };
-
TagName = { fg = red; };
-
H1 = { fg = blue; };
-
H2 = { fg = blue; };
-
H3 = { fg = blue; };
-
H4 = { fg = blue; };
-
H5 = { fg = blue; };
-
H6 = { fg = blue; };
-
};
-
-
javaScript = {
-
Braces = { fg = white; };
-
Function = { fg = purple; };
-
Identifier = { fg = purple; };
-
Null = { fg = brightYellow; };
-
Number = { fg = brightYellow; };
-
Require = { fg = cyan; };
-
Reserved = { fg = purple; };
-
};
-
-
# For: https://github.com/pangloss/vim-javascript
-
js = {
-
ArrowFunction = { fg = purple; };
-
ClassKeyword = { fg = purple; };
-
ClassDefinition = { fg = yellow; };
-
ClassMethodType = { fg = purple; };
-
ClassFuncName = { fg = blue; };
-
DestructuringBlock = { fg = blue; };
-
DocParam = { fg = blue; };
-
DocTags = { fg = purple; };
-
Export = { fg = purple; };
-
ExportDefault = { fg = red; };
-
ExtendsKeyword = { fg = purple; };
-
Conditional = { fg = purple; };
-
Operator = { fg = purple; };
-
From = { fg = purple; };
-
FuncArgs = { fg = blue; };
-
FuncCall = { fg = blue; };
-
ObjectProp = { fg = cyan; };
-
Function = { fg = purple; };
-
Generator = { fg = yellow; };
-
GlobalObjects = { fg = yellow; };
-
Import = { fg = purple; };
-
ModuleAs = { fg = purple; };
-
ModuleWords = { fg = purple; };
-
ModuleKeyword = { fg = blue; };
-
Modules = { fg = purple; };
-
Null = { fg = brightYellow; };
-
StorageClass = { fg = purple; };
-
Super = { fg = red; };
-
TemplateBraces = { fg = brightRed; };
-
TemplateVar = { fg = green; };
-
This = { fg = red; };
-
Undefined = { fg = brightYellow; };
-
};
-
-
# For: https://github.com/othree/yajs.vim
-
javascript = {
-
ArrowFunc = { fg = purple; };
-
ClassExtends = { fg = purple; };
-
ClassKeyword = { fg = purple; };
-
DocNotation = { fg = purple; };
-
DocParamName = { fg = blue; };
-
DocTags = { fg = purple; };
-
EndColons = { fg = white; };
-
Export = { fg = purple; };
-
FuncArg = { fg = white; };
-
FuncKeyword = { fg = purple; };
-
Identifier = { fg = red; };
-
Import = { fg = purple; };
-
MethodName = { fg = white; };
-
ObjectLabel = { fg = white; };
-
OpSymbol = { fg = cyan; };
-
OpSymbols = { fg = cyan; };
-
PropertyName = { fg = green; };
-
TemplateSB = { fg = brightRed; };
-
Variable = { fg = purple; };
-
};
-
-
typescript = {
-
Identifier = { fg = red; };
-
Reserved = { fg = purple; };
-
EndColons = { fg = white; };
-
Braces = { fg = white; };
-
};
-
-
json = {
-
CommentError = { fg = white; };
-
Keyword = { fg = blue; };
-
Boolean = { fg = red; };
-
Number = { fg = brightYellow; };
-
Quote = { fg = white; };
-
String = { fg = green; };
-
MissingCommaError = { fg = brightRed; style = "reverse"; };
-
NoQuotesError = { fg = brightRed; style = "reverse"; };
-
NumError = { fg = brightRed; style = "reverse"; };
-
StringSQError = { fg = brightRed; style = "reverse"; };
-
SemicolonError = { fg = brightRed; style = "reverse"; };
-
};
-
-
markdown = {
-
Code = { fg = green; };
-
LinkReference = { fg = brightWhite; };
-
JekyllFrontMatter = { fg = brightWhite; };
-
CodeBlock = { fg = green; };
-
CodeDelimiter = { fg = green; };
-
HeadingDelimiter = { fg = red; };
-
Rule = { fg = brightWhite; };
-
HeadingRule = { fg = brightWhite; };
-
Delimiter = { fg = cyan; };
-
Id = { fg = purple; };
-
Blockquote = { fg = brightWhite; };
-
Italic = { fg = purple; style = "italic"; };
-
Bold = { fg = purple; style = "bold"; };
-
OrderedListMarker = { fg = red; };
-
IdDeclaration = { fg = blue; };
-
LinkDelimiter = { fg = white; };
-
};
-
-
mkd = {
-
Italic = { fg = purple; style = "italic"; };
-
Bold = { fg = purple; style = "bold"; };
-
InlineURL = { fg = red; };
-
ListItem = { fg = yellow; };
-
Link = { fg = white; };
-
URL = { fg = red; };
-
};
-
-
xml = {
-
Attrib = { fg = yellow; };
-
EndTag = { fg = red; };
-
Tag = { fg = red; };
-
TagName = { fg = red; };
-
};
-
-
php = {
-
Include = { fg = purple; };
-
Class = { fg = yellow; };
-
Classes = { fg = yellow; };
-
Function = { fg = blue; };
-
Type = { fg = purple; };
-
Keyword = { fg = purple; };
-
VarSelector = { fg = purple; };
-
Identifier = { fg = white; };
-
Method = { fg = blue; };
-
Boolean = { fg = blue; };
-
Parent = { fg = white; };
-
Operator = { fg = purple; };
-
Region = { fg = purple; };
-
UseNamespaceSeparator = { fg = white; };
-
ClassNamespaceSeparator = { fg = white; };
-
DocTags = { fg = purple; style="italic"; };
-
DocParam = { fg = purple; style="italic"; };
-
};
-
-
debug = {
-
Breakpoint = { fg = brightBlue; };
-
PC = { bg = brightBlue; fg = black; };
-
};
-
-
gitcommit = {
-
Comment = { fg = brightWhite; };
-
Untracked = { fg = brightWhite; };
-
Discarded = { fg = brightWhite; };
-
Selected = { fg = brightWhite; };
-
Unmerged = { fg = green; };
-
OnBranch = mkHighlight {};
-
Branch = { fg = purple; };
-
NoBranch = { fg = purple; };
-
DiscardedType = { fg = red; };
-
SelectedType = { fg = green; };
-
Header = mkHighlight {};
-
UntrackedFile = { fg = cyan; };
-
DiscardedFile = { fg = red; };
-
SelectedFile = { fg = green; };
-
UntrackedArrow = { fg = cyan; };
-
DiscardedArrow = { fg = red; };
-
SelectedArrow = { fg = green; };
-
UnmergedFile = { fg = yellow; };
-
File = mkHighlight {};
-
Summary = { fg = white; };
-
Overflow = { fg = red; };
-
};
-
-
terminal = {
-
background = { fg = black; };
-
foreground = { fg = white; };
-
black = { fg = black; };
-
red = { fg = red; };
-
green = { fg = green; };
-
yellow = { fg = yellow; };
-
blue = { fg = blue; };
-
purple = { fg = purple; };
-
cyan = { fg = cyan; };
-
white = { fg = white; };
-
grey = { fg = grey; };
-
brightRed = { fg = brightRed; };
-
brightGreen = { fg = brightGreen; };
-
brightYellow = { fg = brightYellow; };
-
brightBlue = { fg = brightBlue; };
-
brightPurple = { fg = brightPurple; };
-
brightCyan = { fg = brightCyan; };
-
brightWhite = { fg = brightWhite; };
-
};
-
-
GitSigns = {
-
Add = { fg = green; };
-
Change = { fg = brightBlue; };
-
Delete = { fg = brightRed; };
-
};
-
-
Signify = {
-
Add = { fg = green; };
-
Change = { fg = brightBlue; };
-
Delete = { fg = brightRed; };
-
};
-
-
GitGutter = {
-
Add = { fg = green; };
-
Change = { fg = brightBlue; };
-
Delete = { fg = brightRed; };
-
};
-
-
Neomake = {
-
WarningSign = { fg = yellow; };
-
ErrorSign = { fg = brightRed; };
-
InfoSign = { fg = blue; };
-
};
-
-
DiagnosticSign = {
-
Warn = { fg = yellow; };
-
Error = { fg = brightRed; };
-
Information = { fg = blue; };
-
Hint = { fg = yellow; };
-
};
-
-
Telescope = {
-
Border = { fg = split; };
-
Matching = { fg = blue; style = "bold"; };
-
};
-
-
TS.Definition = { fg = blue; bg = brightWhite; };
-
EasyMotion.IncSearch = { fg = blue; style = "bold"; };
-
};
-
}
+11 -22
config/nvim/default.nix modules/nvim/default.nix
···
-
{ pkgs, fetchgit, ... }:
+
{ pkgs, ... } @ inputs:
let
-
colors = import ../colors.nix;
-
plugins = import ./plugins.nix {
-
inherit (pkgs) fetchFromGitHub;
-
inherit (pkgs.vimUtils) buildVimPluginFrom2Nix;
-
};
-
-
my-theme = pkgs.vimUtils.buildVimPluginFrom2Nix {
-
pname = "my-theme";
-
version = "2020-10-23";
-
src = pkgs.writeTextFile {
-
name = "theme.vim";
-
text = colors.vim;
-
destination = "/colors/theme.vim";
-
};
-
};
+
inherit (import ../../lib/colors.nix inputs) colors mkVimHardlineColors;
+
inherit (import ./theme.nix inputs) my-theme;
+
plugins = (import ./plugins.nix inputs);
initContents = "
\nlua <<EOF\n" + ''
nix_bins = {
+
tsserver = '${pkgs.typescript-language-server}/bin/typescript-language-server',
+
eslintls = '${pkgs.vscode-langservers-extracted}/bin/vscode-eslint-language-server',
+
cssls = '${pkgs.vscode-langservers-extracted}/bin/vscode-css-language-server',
+
htmlls = '${pkgs.vscode-langservers-extracted}/bin/vscode-html-language-server',
+
jsonls = '${pkgs.vscode-langservers-extracted}/bin/vscode-json-language-server',
+
ripgrep = '${pkgs.ripgrep}/bin/rg',
-
tsserver = '${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server',
-
eslintls = '${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-eslint-language-server',
-
cssls = '${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server',
-
htmlls = '${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-html-language-server',
-
jsonls = '${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-json-language-server',
astrols = '${pkgs.nodePackages."@astrojs/language-server"}/bin/astro-ls',
rustanalyzer = '${pkgs.rust-analyzer}/bin/rust-analyzer',
zk = '${pkgs.zk}/bin/zk',
}
-
hardline_colors = ${colors.vim-hardline}
+
hardline_colors = ${mkVimHardlineColors colors}
'' + (builtins.readFile ./init.lua) + "\nEOF";
in {
environment.variables = { EDITOR = "vim"; };
config/nvim/init.lua modules/nvim/init.lua
+5 -5
config/nvim/plugins.nix modules/nvim/plugins.nix
···
-
{
-
fetchFromGitHub,
-
buildVimPluginFrom2Nix,
-
}:
+
{ pkgs, ... }:
-
{
+
let
+
inherit (pkgs) fetchFromGitHub;
+
inherit (pkgs.vimUtils) buildVimPluginFrom2Nix;
+
in {
vim-repeat = buildVimPluginFrom2Nix {
pname = "vim-fugitive";
version = "2022-01-25";
+3 -3
config/postgres.nix modules/postgres.nix
···
port = 5434;
package = pkgs.postgresql_13;
dataDir = "/var/lib/postgres/13";
-
extraConfig = ''
-
autovacuum = off
-
'';
+
settings = {
+
autovacuum = "off";
+
};
};
}
-35
config/shell.nix
···
-
{ lib, pkgs, ... }:
-
-
let
-
inherit (lib) mkMerge mkForce optionalAttrs;
-
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
-
inherit (import ../nix/channels.nix) nixPath;
-
inherit (import ../nix/secrets.nix) readSecretFileContents;
-
in
-
-
mkMerge [
-
{
-
environment.systemPackages = with pkgs; [
-
zsh
-
];
-
-
environment.pathsToLink = [ "/share/zsh" ];
-
environment.variables = {
-
NIX_PATH = mkForce nixPath;
-
SHELL = "${pkgs.zsh}/bin/zsh";
-
};
-
-
programs.zsh = {
-
enable = true;
-
promptInit = lib.mkDefault "";
-
};
-
}
-
-
(optionalAttrs isDarwin {
-
environment.shells = [ pkgs.zsh ];
-
})
-
-
(optionalAttrs isLinux {
-
users.defaultUserShell = pkgs.zsh;
-
})
-
]
-7
configuration.nix
···
-
{
-
imports = [
-
./nix/nix-path.nix
-
./modules/default.nix
-
./profiles/common.nix
-
];
-
}
+494
flake.lock
···
+
{
+
"nodes": {
+
"agenix": {
+
"inputs": {
+
"darwin": "darwin",
+
"home-manager": "home-manager",
+
"nixpkgs": "nixpkgs"
+
},
+
"locked": {
+
"lastModified": 1684153753,
+
"narHash": "sha256-PVbWt3qrjYAK+T5KplFcO+h7aZWfEj1UtyoKlvcDxh0=",
+
"owner": "ryantm",
+
"repo": "agenix",
+
"rev": "db5637d10f797bb251b94ef9040b237f4702cde3",
+
"type": "github"
+
},
+
"original": {
+
"owner": "ryantm",
+
"repo": "agenix",
+
"type": "github"
+
}
+
},
+
"darwin": {
+
"inputs": {
+
"nixpkgs": [
+
"agenix",
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1673295039,
+
"narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=",
+
"owner": "lnl7",
+
"repo": "nix-darwin",
+
"rev": "87b9d090ad39b25b2400029c64825fc2a8868943",
+
"type": "github"
+
},
+
"original": {
+
"owner": "lnl7",
+
"ref": "master",
+
"repo": "nix-darwin",
+
"type": "github"
+
}
+
},
+
"darwin_2": {
+
"inputs": {
+
"nixpkgs": [
+
"nixpkgs-darwin"
+
]
+
},
+
"locked": {
+
"lastModified": 1687110393,
+
"narHash": "sha256-SnkdWeZ8PZd3Dc74iFF8xiE7qDp5+z3Yps2mE79tsM0=",
+
"owner": "lnl7",
+
"repo": "nix-darwin",
+
"rev": "8a5af0da9d8dab8a188436750489e304ac682085",
+
"type": "github"
+
},
+
"original": {
+
"owner": "lnl7",
+
"repo": "nix-darwin",
+
"type": "github"
+
}
+
},
+
"flake-compat": {
+
"locked": {
+
"lastModified": 1680531544,
+
"narHash": "sha256-8qbiDTYb1kGaDADRXTItpcMKQ1TeQVkuof6oEwHUvVA=",
+
"owner": "nix-community",
+
"repo": "flake-compat",
+
"rev": "95e78dc12268c5e4878621845c511077f3798729",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "flake-compat",
+
"type": "github"
+
}
+
},
+
"flake-parts": {
+
"inputs": {
+
"nixpkgs-lib": [
+
"nixpkgs-wayland",
+
"nix-eval-jobs",
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1685662779,
+
"narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=",
+
"owner": "hercules-ci",
+
"repo": "flake-parts",
+
"rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3",
+
"type": "github"
+
},
+
"original": {
+
"owner": "hercules-ci",
+
"repo": "flake-parts",
+
"type": "github"
+
}
+
},
+
"flake-utils": {
+
"inputs": {
+
"systems": "systems"
+
},
+
"locked": {
+
"lastModified": 1685518550,
+
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
+
"type": "github"
+
},
+
"original": {
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"type": "github"
+
}
+
},
+
"flake-utils_2": {
+
"inputs": {
+
"systems": "systems_2"
+
},
+
"locked": {
+
"lastModified": 1685518550,
+
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
+
"type": "github"
+
},
+
"original": {
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"type": "github"
+
}
+
},
+
"home-manager": {
+
"inputs": {
+
"nixpkgs": [
+
"agenix",
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1682203081,
+
"narHash": "sha256-kRL4ejWDhi0zph/FpebFYhzqlOBrk0Pl3dzGEKSAlEw=",
+
"owner": "nix-community",
+
"repo": "home-manager",
+
"rev": "32d3e39c491e2f91152c84f8ad8b003420eab0a1",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "home-manager",
+
"type": "github"
+
}
+
},
+
"home-manager_2": {
+
"inputs": {
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1687041925,
+
"narHash": "sha256-Zfn/SphInZ9PEIHWdQk+wGQ0XGlwAgRUp/Qso+8vDOY=",
+
"owner": "nix-community",
+
"repo": "home-manager",
+
"rev": "a8d549351d4b87ab80665f35e57bee2a04201245",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"ref": "release-23.05",
+
"repo": "home-manager",
+
"type": "github"
+
}
+
},
+
"hyprland": {
+
"inputs": {
+
"hyprland-protocols": "hyprland-protocols",
+
"nixpkgs": [
+
"nixpkgs"
+
],
+
"wlroots": "wlroots",
+
"xdph": "xdph"
+
},
+
"locked": {
+
"lastModified": 1685380658,
+
"narHash": "sha256-LPih0Q//p8IurXG9kGRVGAqV4AUKVYj9xkk3sYYAj6I=",
+
"owner": "hyprwm",
+
"repo": "Hyprland",
+
"rev": "51a930f802c71a0e67f05e7b176ded74e8e95f87",
+
"type": "github"
+
},
+
"original": {
+
"owner": "hyprwm",
+
"ref": "v0.26.0",
+
"repo": "Hyprland",
+
"type": "github"
+
}
+
},
+
"hyprland-protocols": {
+
"inputs": {
+
"nixpkgs": [
+
"hyprland",
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1681065697,
+
"narHash": "sha256-QPzwwlGKX95tl6ZEshboZbEwwAXww6lNLdVYd6T9Mrc=",
+
"owner": "hyprwm",
+
"repo": "hyprland-protocols",
+
"rev": "4d29e48433270a2af06b8bc711ca1fe5109746cd",
+
"type": "github"
+
},
+
"original": {
+
"owner": "hyprwm",
+
"repo": "hyprland-protocols",
+
"type": "github"
+
}
+
},
+
"language-servers": {
+
"inputs": {
+
"flake-utils": [
+
"flake-utils"
+
],
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1686611059,
+
"narHash": "sha256-4LHWWXVyMEdCYbFxPEU41VkXbLcTtSEr9ENfm80IWLo=",
+
"ref": "refs/heads/main",
+
"rev": "7e289d96e73c7d2038486143218b17b0292a2077",
+
"revCount": 1,
+
"type": "git",
+
"url": "https://github.com/fxcl/language-servers.nix"
+
},
+
"original": {
+
"type": "git",
+
"url": "https://github.com/fxcl/language-servers.nix"
+
}
+
},
+
"lib-aggregate": {
+
"inputs": {
+
"flake-utils": "flake-utils_2",
+
"nixpkgs-lib": "nixpkgs-lib"
+
},
+
"locked": {
+
"lastModified": 1687090161,
+
"narHash": "sha256-WeUFiVRzcm6MfqbJ91zSw6E+P5bnRvjpYxpc0XC2THI=",
+
"owner": "nix-community",
+
"repo": "lib-aggregate",
+
"rev": "3ed1afb7a79ab6d2f105f72e5404e7a419004220",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "lib-aggregate",
+
"type": "github"
+
}
+
},
+
"nix-eval-jobs": {
+
"inputs": {
+
"flake-parts": "flake-parts",
+
"nixpkgs": "nixpkgs_3"
+
},
+
"locked": {
+
"lastModified": 1686821120,
+
"narHash": "sha256-tCdS6vvvUvg5JeFNgrq6I0COoKi6QZ8JDXorUxOf/RI=",
+
"owner": "nix-community",
+
"repo": "nix-eval-jobs",
+
"rev": "8fca52c06fa2131422811bc6e1e441220cfb97d5",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "nix-eval-jobs",
+
"type": "github"
+
}
+
},
+
"nixpkgs": {
+
"locked": {
+
"lastModified": 1677676435,
+
"narHash": "sha256-6FxdcmQr5JeZqsQvfinIMr0XcTyTuR7EXX0H3ANShpQ=",
+
"owner": "NixOS",
+
"repo": "nixpkgs",
+
"rev": "a08d6979dd7c82c4cef0dcc6ac45ab16051c1169",
+
"type": "github"
+
},
+
"original": {
+
"owner": "NixOS",
+
"ref": "nixos-unstable",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"nixpkgs-darwin": {
+
"locked": {
+
"lastModified": 1687093939,
+
"narHash": "sha256-zw9ztAI3G7ayjRFK9G18yiy4NceLZMF6QKWZC+eyWs0=",
+
"owner": "nixos",
+
"repo": "nixpkgs",
+
"rev": "572d26930456132e7f2035340e3d88b36a5e9b6e",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nixos",
+
"ref": "nixpkgs-23.05-darwin",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"nixpkgs-lib": {
+
"locked": {
+
"lastModified": 1687049841,
+
"narHash": "sha256-FBNZQfWtA7bb/rwk92mfiWc85x4hXta2OAouDqO5W8w=",
+
"owner": "nix-community",
+
"repo": "nixpkgs.lib",
+
"rev": "908af6d1fa3643c5818ea45aa92b21d6385fbbe5",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "nixpkgs.lib",
+
"type": "github"
+
}
+
},
+
"nixpkgs-unstable": {
+
"locked": {
+
"lastModified": 1686960236,
+
"narHash": "sha256-AYCC9rXNLpUWzD9hm+askOfpliLEC9kwAo7ITJc4HIw=",
+
"owner": "nixos",
+
"repo": "nixpkgs",
+
"rev": "04af42f3b31dba0ef742d254456dc4c14eedac86",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nixos",
+
"ref": "nixos-unstable",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"nixpkgs-wayland": {
+
"inputs": {
+
"flake-compat": "flake-compat",
+
"lib-aggregate": "lib-aggregate",
+
"nix-eval-jobs": "nix-eval-jobs",
+
"nixpkgs": [
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1687091260,
+
"narHash": "sha256-zrMyeg3ZS/R9S8OqkmtLjuJNMeIUUdMVr7nmeobRQ4k=",
+
"owner": "nix-community",
+
"repo": "nixpkgs-wayland",
+
"rev": "b6964d30d02be53a9a6d0c1d3b6bbd76ae5a1d6d",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-community",
+
"repo": "nixpkgs-wayland",
+
"type": "github"
+
}
+
},
+
"nixpkgs_2": {
+
"locked": {
+
"lastModified": 1686960236,
+
"narHash": "sha256-AYCC9rXNLpUWzD9hm+askOfpliLEC9kwAo7ITJc4HIw=",
+
"owner": "nixos",
+
"repo": "nixpkgs",
+
"rev": "04af42f3b31dba0ef742d254456dc4c14eedac86",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nixos",
+
"ref": "nixos-unstable",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"nixpkgs_3": {
+
"locked": {
+
"lastModified": 1686819257,
+
"narHash": "sha256-RYrWGRd7XfaZDYy8lnrHQjSky+OaChI9UOMLmGkUgmY=",
+
"owner": "NixOS",
+
"repo": "nixpkgs",
+
"rev": "66e3d3b8d9cf3ebf0d2326b8267f71fe38e7f1b8",
+
"type": "github"
+
},
+
"original": {
+
"owner": "NixOS",
+
"ref": "master",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"root": {
+
"inputs": {
+
"agenix": "agenix",
+
"darwin": "darwin_2",
+
"flake-utils": "flake-utils",
+
"home-manager": "home-manager_2",
+
"hyprland": "hyprland",
+
"language-servers": "language-servers",
+
"nixpkgs": "nixpkgs_2",
+
"nixpkgs-darwin": "nixpkgs-darwin",
+
"nixpkgs-unstable": "nixpkgs-unstable",
+
"nixpkgs-wayland": "nixpkgs-wayland"
+
}
+
},
+
"systems": {
+
"locked": {
+
"lastModified": 1681028828,
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+
"owner": "nix-systems",
+
"repo": "default",
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-systems",
+
"repo": "default",
+
"type": "github"
+
}
+
},
+
"systems_2": {
+
"locked": {
+
"lastModified": 1681028828,
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+
"owner": "nix-systems",
+
"repo": "default",
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-systems",
+
"repo": "default",
+
"type": "github"
+
}
+
},
+
"wlroots": {
+
"flake": false,
+
"locked": {
+
"host": "gitlab.freedesktop.org",
+
"lastModified": 1682436395,
+
"narHash": "sha256-GGEjkQO9m7YLYIXIXM76HWdhjg4Ye+oafOtyaFAYKI4=",
+
"owner": "wlroots",
+
"repo": "wlroots",
+
"rev": "6830bfc17fd94709e2cdd4da0af989f102a26e59",
+
"type": "gitlab"
+
},
+
"original": {
+
"host": "gitlab.freedesktop.org",
+
"owner": "wlroots",
+
"repo": "wlroots",
+
"type": "gitlab"
+
}
+
},
+
"xdph": {
+
"inputs": {
+
"hyprland-protocols": [
+
"hyprland",
+
"hyprland-protocols"
+
],
+
"nixpkgs": [
+
"hyprland",
+
"nixpkgs"
+
]
+
},
+
"locked": {
+
"lastModified": 1682439384,
+
"narHash": "sha256-zHDa8LCZs05TZHQSIZ3ucwyMPglBGHcqTBzfkLjYXTM=",
+
"owner": "hyprwm",
+
"repo": "xdg-desktop-portal-hyprland",
+
"rev": "c0e233955568fbea4e859336f6d3d14d51294d7c",
+
"type": "github"
+
},
+
"original": {
+
"owner": "hyprwm",
+
"repo": "xdg-desktop-portal-hyprland",
+
"type": "github"
+
}
+
}
+
},
+
"root": "root",
+
"version": 7
+
}
+59
flake.nix
···
+
{
+
nixConfig = {
+
experimental-features = [ "nix-command" "flakes" ];
+
};
+
+
inputs = {
+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
+
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.05-darwin";
+
+
agenix.url = "github:ryantm/agenix";
+
+
flake-utils.url = "github:numtide/flake-utils";
+
+
home-manager = {
+
url = "github:nix-community/home-manager/release-23.05";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
+
darwin = {
+
url = "github:lnl7/nix-darwin";
+
inputs.nixpkgs.follows = "nixpkgs-darwin";
+
};
+
+
hyprland = {
+
url = "github:hyprwm/Hyprland/v0.26.0";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
+
nixpkgs-wayland = {
+
url = "github:nix-community/nixpkgs-wayland";
+
inputs.nixpkgs.follows = "nixpkgs";
+
};
+
+
language-servers = {
+
url = "git+https://github.com/fxcl/language-servers.nix";
+
inputs = {
+
nixpkgs.follows = "nixpkgs";
+
flake-utils.follows = "flake-utils";
+
};
+
};
+
};
+
+
outputs = inputs: let
+
inherit (import ./lib/system.nix inputs) mkSystem;
+
+
overlays = [
+
(self: super: {
+
inherit (inputs.language-servers.packages.${self.system}) typescript-language-server vscode-langservers-extracted;
+
})
+
];
+
in {
+
darwinConfigurations."sprite" = mkSystem {
+
inherit overlays;
+
system = "aarch64-darwin";
+
hostname = "sprite";
+
};
+
};
+
}
+13
home/default.nix
···
+
{ ... }:
+
+
{
+
imports = [
+
./secrets.nix
+
./git.nix
+
./zsh.nix
+
./tmux.nix
+
./wezterm
+
./npm
+
./gpg
+
];
+
}
+32
home/gpg/default.nix
···
+
{ config, pkgs, ... } @ inputs:
+
+
{
+
age.secrets."pubring.kbx" = {
+
symlink = true;
+
path = "${config.home.homeDirectory}/.gnupg/pubring.kbx";
+
file = ./encrypt/pubring.kbx.age;
+
};
+
+
age.secrets."75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key" = {
+
symlink = true;
+
path = "${config.home.homeDirectory}/.gnupg/private-keys-v1.d/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key";
+
file = ./encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age;
+
};
+
+
age.secrets."E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key" = {
+
symlink = true;
+
path = "${config.home.homeDirectory}/.gnupg/private-keys-v1.d/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key";
+
file = ./encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age;
+
};
+
+
age.secrets."CA84692E3CC846C8EC7272468E962B63FC599E49.key" = {
+
symlink = true;
+
path = "${config.home.homeDirectory}/.gnupg/private-keys-v1.d/CA84692E3CC846C8EC7272468E962B63FC599E49.key";
+
file = ./encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age;
+
};
+
+
home.file.".gnupg/sshcontrol".text = ''
+
E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6
+
75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7
+
'';
+
}
home/gpg/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age

This is a binary file and will not be displayed.

home/gpg/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age

This is a binary file and will not be displayed.

home/gpg/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age

This is a binary file and will not be displayed.

home/gpg/encrypt/pubring.kbx.age

This is a binary file and will not be displayed.

+17
home/npm/default.nix
···
+
{ config, ... } @ inputs:
+
+
let
+
inherit (import ../../lib/secrets.nix inputs) readSecretFileContents;
+
in {
+
age.secrets."npmrc" = {
+
symlink = true;
+
path = "${config.home.homeDirectory}/.npmrc";
+
file = ./encrypt/npmrc.age;
+
};
+
+
home.file.".yarnrc".text = ''
+
disable-self-update-check true
+
email phil@kitten.sh
+
username philpl
+
'';
+
}
+9
home/npm/encrypt/npmrc.age
···
+
age-encryption.org/v1
+
-> ssh-ed25519 QwbpPw HFxtYuBgoGIC+jMdwR0RoPat5ZPYFmBeuW6YsDR6gBk
+
47ZgT0KHE9/pBBfcNoowTYpEpK4CRwQ6jKYhXPET3P0
+
-> 3#-grease E|S' T : \7mw<QvZ
+
C56j3YvaVZpmFVw29rAK6zQEQlt5dgDnlYA2UtmlkHAtmZEmAVtkr7P6xIZfI/LU
+
Ypi52RsrdVl8SswbmI0693RVzgyrqLgb88aBWXrdBKihwc6iHAl0SRhZyzBQSeSA
+
2Q
+
--- xHgvFD9SRYAfRuXsx7xIxro8gMBHR0F1ghehZ0Uq9uQ
+
9 ����P�zPh]Sd^x��=�����}Zr�-$��6XK5v��x�'�,�Ly���GH�Qu�sj���r1��愲<�ס���o]^�M�(�J�C�A>^͚|I`�a���\J=@���L�˽�}�"�Q&��ْ�y)j��
+7
home/secrets.nix
···
+
{ config, ... }:
+
+
{
+
age = {
+
identityPaths = ["/var/lib/persistent/agenix"];
+
};
+
}
+12
home/wezterm/default.nix
···
+
{ pkgs, ... } @ inputs:
+
+
let
+
inherit (import ../../lib/colors.nix inputs) colors mkLuaSyntax;
+
in {
+
home.packages = [ pkgs.wezterm ];
+
+
xdg.configFile."wezterm/wezterm.lua".text = ''
+
local zsh_bin = "${pkgs.zsh}/bin/zsh";
+
local colors = ${mkLuaSyntax colors};
+
'' + (builtins.readFile ./init.lua);
+
}
+72
lib/system.nix
···
+
{ agenix, nixpkgs, darwin, home-manager, ... } @ inputs:
+
+
let
+
inherit (nixpkgs) lib;
+
in {
+
mkSystem = { system, hostname, user ? "phil", overlays }: let
+
inherit (lib.systems.elaborate { inherit system; }) isDarwin;
+
lib = (import nixpkgs { inherit overlays system; }).lib;
+
modules = [
+
../machines/common.nix
+
../machines/${hostname}/configuration.nix
+
../modules/default.nix
+
({ config, ... }: {
+
nixpkgs = {
+
inherit overlays;
+
config.allowUnfree = true;
+
};
+
+
age.identityPaths = ["/var/lib/persistent/agenix"];
+
networking.hostName = hostname;
+
nix.extraOptions = "extra-experimental-features = nix-command flakes";
+
})
+
];
+
home = { ... }: {
+
manual.manpages.enable = false;
+
home.stateVersion = "23.05";
+
xdg.enable = true;
+
age.identityPaths = ["/var/lib/persistent/agenix"];
+
imports = [
+
agenix.homeManagerModules.default
+
../home/default.nix
+
../machines/${hostname}/home.nix
+
];
+
};
+
specialArgs = inputs // {
+
inherit hostname user;
+
};
+
in if isDarwin then (
+
darwin.lib.darwinSystem {
+
inherit system lib;
+
inputs = specialArgs;
+
modules = modules ++ [
+
agenix.darwinModules.default
+
home-manager.darwinModules.home-manager {
+
home-manager.useGlobalPkgs = true;
+
home-manager.useUserPackages = true;
+
home-manager.users."${user}" = home;
+
}
+
({ pkgs, ... }: {
+
environment.shells = [pkgs.zsh];
+
users.users."${user}".home = "/Users/${user}";
+
})
+
];
+
}
+
) else (
+
nixpkgs.lib.nixosSystem {
+
inherit system specialArgs lib;
+
modules = modules ++ [
+
agenix.nixosModules.default
+
home-manager.nixosModules.home-manager {
+
home-manager.useGlobalPkgs = true;
+
home-manager.useUserPackages = true;
+
home-manager.users."${user}" = home;
+
}
+
({ pkgs, ... }: {
+
users.defaultUserShell = pkgs.zsh;
+
users.users."${user}".home = "/home/${user}";
+
})
+
];
+
}
+
);
+
}
+3
machines/common.nix
···
+
{ ... }: {
+
+
}
+64
machines/sprite/configuration.nix
···
+
{ pkgs, ... }:
+
+
{
+
imports = [
+
../../modules/services/mysql.nix
+
];
+
+
system.stateVersion = 4;
+
# Disable path verification of $NIX_PATH
+
system.checks.verifyNixPath = false;
+
# Auto upgrade nix package and the daemon service.
+
services.nix-daemon.enable = true;
+
# Auto-configure build users
+
nix.configureBuildUsers = true;
+
# Disable documentation until https://github.com/LnL7/nix-darwin/issues/217 is fixed.
+
documentation.enable = false;
+
+
# Use built-in TouchID PAM
+
security.pam.enableSudoTouchIdAuth = true;
+
+
system = {
+
keyboard = {
+
enableKeyMapping = true;
+
remapCapsLockToControl = true;
+
nonUS.remapTilde = true;
+
};
+
+
defaults = {
+
finder.CreateDesktop = false;
+
screencapture.location = "~/Screenshots";
+
loginwindow = {
+
GuestEnabled = false;
+
DisableConsoleAccess = true;
+
};
+
dock = {
+
autohide = true;
+
tilesize = 46;
+
};
+
NSGlobalDomain = {
+
AppleShowAllExtensions = true;
+
InitialKeyRepeat = 10;
+
KeyRepeat = 2;
+
};
+
};
+
};
+
+
environment.systemPackages = with pkgs; [
+
coreutils
+
openssl
+
imagemagick
+
ffmpeg
+
pngquant
+
ripgrep
+
xh
+
curl
+
sd
+
fd
+
cloudflared
+
woff2
+
temporal
+
dive
+
caddy
+
];
+
}
+1
machines/sprite/home.nix
···
+
{ ... }: {}
+37 -4
modules/color-utils.nix lib/colors.nix
···
+
{ lib, ... }:
+
let
-
inherit (import ../nix/channels.nix) __nixPath nixPath;
-
lib = import <nixpkgs/lib>;
-
inherit (lib.strings) concatStrings;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.lists) last init;
inherit (builtins) hasAttr isAttrs length head concatStringsSep;
+
+
mkColor = gui: cterm: cterm16: { gui=gui; cterm=cterm; cterm16=cterm16; };
in rec {
-
mkColor = gui: cterm: cterm16: { gui=gui; cterm=cterm; cterm16=cterm16; };
+
colors = {
+
gutter = (mkColor "#16171d" "232" "15"); # gutter fg grey
+
cursor = (mkColor "#2C323C" "236" "8"); # cursor grey
+
element = (mkColor "#404449" "238" "15"); # special grey
+
split = (mkColor "#282c34" "59" "15");
+
+
black = (mkColor "#13131a" "235" "0");
+
grey = (mkColor "#3E4452" "237" "15");
+
+
red = (mkColor "#ED95A8" "204" "1");
+
brightRed = (mkColor "#EF5350" "196" "9");
+
+
green = (mkColor "#C3E88D" "114" "2");
+
brightGreen = (mkColor "#C3E88D" "114" "2");
+
+
yellow = (mkColor "#FFCB6B" "180" "3");
+
brightYellow = (mkColor "#F78C6C" "173" "11"); # dark yellow
+
+
blue = (mkColor "#82B1FF" "39" "4");
+
brightBlue = (mkColor "#939EDE" "39" "4"); # blue purple
+
+
purple = (mkColor "#C792EA" "170" "5");
+
brightPurple = (mkColor "#FF45AE" "170" "5");
+
+
cyan = (mkColor "#89DDFF" "38" "6");
+
brightCyan = (mkColor "#20D6E3" "38" "6");
+
+
white = (mkColor "#ECEFF1" "145" "7");
+
brightWhite = (mkColor "#697098" "59" "15"); # comment grey
+
darkWhite = (mkColor "#F8F8F2" "59" "15");
+
};
+
transparent = (mkColor "NONE" "NONE" "0");
+
mkHighlight = { fg ? transparent, bg ? transparent, style ? "NONE" }: { fg=fg; bg=bg; style=style; };
mkVimHighlight = group: { fg ? transparent, bg ? transparent, style ? "NONE" }:
"highlight ${group} guifg=${fg.gui} guibg=${bg.gui} gui=${style} ctermfg=${fg.cterm} ctermbg=${bg.cterm} cterm=${style}";
-20
modules/darwin.nix
···
-
{ options, pkgs, ... }:
-
-
{
-
system.stateVersion = 3;
-
# Disable path verification of $NIX_PATH
-
system.checks.verifyNixPath = false;
-
# Auto upgrade nix package and the daemon service.
-
services.nix-daemon.enable = true;
-
# Auto-configure build users
-
users.nix.configureBuildUsers = true;
-
# Manage Nix package via channels
-
nix.package = pkgs.nix;
-
# Disable documentation until https://github.com/LnL7/nix-darwin/issues/217 is fixed.
-
documentation.enable = false;
-
# Ensure aarch64 is selected as the default
-
nix.extraOptions = ''
-
system = aarch64-darwin
-
extra-platforms = aarch64-darwin x86_64-darwin
-
'';
-
}
+10 -9
modules/default.nix
···
-
{ pkgs, lib, ... }:
+
{ ... }:
-
let
-
inherit (lib) optional flatten;
-
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
-
in {
-
imports = flatten [
-
./home-manager.nix
-
(optional isDarwin ./darwin.nix)
-
(optional isDarwin ./mysql.nix)
+
{
+
imports = [
+
./shell.nix
+
./nodejs.nix
+
./postgres.nix
+
./mysql.nix
+
./gpg.nix
+
./nvim
+
./fonts
];
}
+40
modules/fonts/default.nix
···
+
{ config, pkgs, lib, ... } @ inputs:
+
+
let
+
inherit (pkgs) stdenv;
+
+
symlink = stdenv.hostPlatform.isLinux;
+
+
fontsDir = if stdenv.hostPlatform.isDarwin then
+
"/Library/Fonts" else "/share/fonts/opentype";
+
in
+
+
{
+
age.secrets."DankMono-Regular.otf" = {
+
inherit symlink;
+
file = ./encrypt/DankMono-Regular.otf.age;
+
path = "${fontsDir}/DankMono-Regular.otf";
+
mode = "755";
+
};
+
+
age.secrets."DankMono-Italic.otf" = {
+
inherit symlink;
+
file = ./encrypt/DankMono-Italic.otf.age;
+
path = "${fontsDir}/DankMono-Italic.otf";
+
mode = "755";
+
};
+
+
age.secrets."DankMono-Bold.otf" = {
+
inherit symlink;
+
file = ./encrypt/DankMono-Bold.otf.age;
+
path = "${fontsDir}/DankMono-Bold.otf";
+
mode = "755";
+
};
+
+
age.secrets."codicon.otf" = {
+
inherit symlink;
+
file = ./encrypt/codicon.otf.age;
+
path = "${fontsDir}/codicon.otf";
+
mode = "755";
+
};
+
}
modules/fonts/encrypt/DankMono-Bold.otf.age

This is a binary file and will not be displayed.

modules/fonts/encrypt/DankMono-Italic.otf.age

This is a binary file and will not be displayed.

modules/fonts/encrypt/DankMono-Regular.otf.age

This is a binary file and will not be displayed.

modules/fonts/encrypt/codicon.otf.age

This is a binary file and will not be displayed.

-12
modules/home-manager.nix
···
-
{ lib, ... }:
-
-
let
-
inherit (lib) optional flatten;
-
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
-
inherit (import ../nix/channels.nix) __nixPath nixPath;
-
in {
-
imports = flatten [
-
(optional isDarwin <home-manager/nix-darwin>)
-
(optional isLinux <home-manager/nixos>)
-
];
-
}
+7 -155
modules/mysql.nix
···
-
{ config, lib, pkgs, ... }:
-
-
with lib;
-
-
let
-
cfg = config.services.mysql;
-
-
isMariaDB = lib.getName cfg.package == lib.getName pkgs.mariadb;
-
-
mysqldOptions =
-
"--defaults-file=${configFile} --datadir=${cfg.dataDir} --basedir=${cfg.package}";
-
-
format = pkgs.formats.ini { listsAsDuplicateKeys = true; };
-
configFile = format.generate "my.cnf" cfg.settings;
-
-
preStart = if isMariaDB then ''
-
if ! test -e ${cfg.dataDir}/mysql_init; then
-
${cfg.package}/bin/mysql_install_db ${mysqldOptions}
-
touch ${cfg.dataDir}/mysql_init
-
fi
-
'' else ''
-
if ! test -e ${cfg.dataDir}/mysql_init; then
-
${cfg.package}/bin/mysqld ${mysqldOptions} --initialize-insecure
-
touch ${cfg.dataDir}/mysql_init
-
fi
-
'';
-
in
+
{ pkgs, ... }:
{
-
options = {
-
-
services.mysql = {
-
-
enable = mkEnableOption (lib.mdDoc "MySQL server");
-
-
package = mkOption {
-
type = types.package;
-
example = literalExpression "pkgs.mariadb";
-
description = lib.mdDoc ''
-
Which MySQL derivation to use. MariaDB packages are supported too.
-
'';
-
};
-
-
dataDir = mkOption {
-
type = types.path;
-
example = "/var/lib/mysql";
-
description = lib.mdDoc ''
-
The data directory for MySQL.
-
-
::: {.note}
-
If left as the default value of `/var/lib/mysql` this directory will automatically be created before the MySQL
-
server starts, otherwise you are responsible for ensuring the directory exists with appropriate ownership and permissions.
-
:::
-
'';
-
};
-
-
configFile = mkOption {
-
type = types.path;
-
default = configFile;
-
defaultText = ''
-
A configuration file automatically generated by NixOS.
-
'';
-
description = lib.mdDoc ''
-
Override the configuration file used by MySQL. By default,
-
NixOS generates one automatically from {option}`services.mysql.settings`.
-
'';
-
example = literalExpression ''
-
pkgs.writeText "my.cnf" '''
-
[mysqld]
-
datadir = /var/lib/mysql
-
bind-address = 127.0.0.1
-
port = 3336
-
-
!includedir /etc/mysql/conf.d/
-
''';
-
'';
-
};
-
-
settings = mkOption {
-
type = format.type;
-
default = {};
-
description = lib.mdDoc ''
-
MySQL configuration. Refer to
-
<https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html>,
-
<https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html>,
-
and <https://mariadb.com/kb/en/server-system-variables/>
-
for details on supported values.
-
-
::: {.note}
-
MySQL configuration options such as `--quick` should be treated as
-
boolean options and provided values such as `true`, `false`,
-
`1`, or `0`. See the provided example below.
-
:::
-
'';
-
example = literalExpression ''
-
{
-
mysqld = {
-
key_buffer_size = "6G";
-
table_cache = 1600;
-
log-error = "/var/log/mysql_err.log";
-
plugin-load-add = [ "server_audit" "ed25519=auth_ed25519" ];
-
};
-
mysqldump = {
-
quick = true;
-
max_allowed_packet = "16M";
-
};
-
}
-
'';
-
};
+
services.mysql = {
+
enable = true;
+
package = pkgs.mariadb_1010;
+
dataDir = "/var/lib/mysql";
+
settings.mysqld = {
+
bind-address = "127.0.0.1";
};
};
-
-
-
###### implementation
-
-
config = mkIf cfg.enable {
-
-
services.mysql.dataDir =
-
mkDefault (if versionAtLeast config.system.stateVersion "17.09" then "/var/lib/mysql"
-
else "/var/mysql");
-
-
services.mysql.settings.mysqld = mkMerge [
-
{
-
datadir = cfg.dataDir;
-
port = mkDefault 3306;
-
}
-
(mkIf (!isMariaDB) {
-
plugin-load-add = "auth_socket.so";
-
})
-
];
-
-
environment.systemPackages = [ cfg.package ];
-
environment.etc."my.cnf".source = cfg.configFile;
-
-
launchd.user.agents.mysql = {
-
path = [ cfg.package ];
-
-
script = ''
-
${preStart}
-
exec ${cfg.package}/bin/mysqld ${mysqldOptions}
-
'';
-
-
serviceConfig.KeepAlive = true;
-
serviceConfig.RunAtLoad = true;
-
};
-
-
system.activationScripts.postActivation.text = ''
-
if [ ! -d "${cfg.dataDir}" ]; then
-
mkdir -p "${cfg.dataDir}"
-
chmod -R 777 "${cfg.dataDir}"
-
fi
-
-
if [ ! -d "/run/mysqld" ]; then
-
mkdir -p "/run/mysqld"
-
chmod -R 777 "/run/mysqld"
-
fi
-
'';
-
};
}
-
+402
modules/nvim/theme.nix
···
+
{ pkgs, ... } @ inputs:
+
+
let
+
inherit (import ../../lib/colors.nix inputs) colors mkVimSyntax mkHighlight;
+
in {
+
my-theme = pkgs.vimUtils.buildVimPluginFrom2Nix {
+
pname = "my-theme";
+
version = "2020-10-23";
+
src = pkgs.writeTextFile {
+
name = "theme.vim";
+
destination = "/colors/theme.vim";
+
text = with colors; mkVimSyntax "theme" {
+
# Syntax Groups (descriptions and ordering from `:h w18`)
+
Comment = { fg = brightWhite; style = "italic"; };
+
Constant = { fg = cyan; };
+
String = { fg = green; };
+
Character = { fg = green; };
+
Number = { fg = brightYellow; };
+
Boolean = { fg = red; };
+
Float = { fg = brightYellow; };
+
Identifier = { fg = red; };
+
Function = { fg = blue; };
+
Statement = { fg = purple; };
+
Conditional = { fg = purple; };
+
Repeat = { fg = purple; };
+
Label = { fg = purple; };
+
Operator = { fg = cyan; };
+
Keyword = { fg = red; };
+
Exception = { fg = purple; };
+
PreProc = { fg = yellow; };
+
Include = { fg = blue; };
+
Define = { fg = purple; };
+
Macro = { fg = purple; };
+
PreCondit = { fg = yellow; };
+
Type = { fg = yellow; };
+
StorageClass = { fg = yellow; };
+
Structure = { fg = yellow; };
+
Typedef = { fg = yellow; };
+
Special = { fg = blue; };
+
SpecialChar = mkHighlight {};
+
Tag = mkHighlight {};
+
Delimiter = mkHighlight {};
+
Debug = mkHighlight {};
+
Ignore = mkHighlight {};
+
SpecialComment = { fg = brightWhite; };
+
Underlined = mkHighlight { style = "underline"; };
+
Error = { fg = brightRed; };
+
Todo = { fg = purple; };
+
+
# Highlighting Groups (descriptions and ordering from `:h hitest.vim`)
+
ColorColumn = { bg = cursor; };
+
Conceal = mkHighlight {};
+
Cursor = { fg = black; bg=blue; };
+
CursorIM = mkHighlight {};
+
CursorColumn = { bg = cursor; };
+
CursorLine = { bg = gutter; };
+
Directory = { fg = blue; };
+
+
Diff = {
+
Add = { bg = gutter; };
+
Change = mkHighlight {};
+
Delete = { fg = brightWhite; };
+
Text = { style = "strikethrough"; };
+
};
+
+
Pmenu = {
+
base = { bg = grey; };
+
Sel = { fg = black; bg = blue; };
+
Sbar = { bg = element; };
+
Thumb = { bg = white; };
+
};
+
+
ErrorMsg = { fg = brightRed; };
+
WarningMsg = { fg = yellow; };
+
VertSplit = { fg = gutter; };
+
Folded = { bg = gutter; fg = brightWhite; };
+
FoldColumn = mkHighlight {};
+
SignColumn = mkHighlight {};
+
IncSearch = { fg = blue; style = "reverse"; };
+
LineNr = { fg = black; bg = black; };
+
CursorLineNr = { fg = brightWhite; bg = gutter; style = "bold"; };
+
MatchParen = { fg = blue; style = "underline"; };
+
ModeMsg = mkHighlight {};
+
MoreMsg = mkHighlight {};
+
NonText = { fg = element; };
+
Normal = { fg = darkWhite; };
+
Question = { fg = purple; };
+
Search = { fg = black; bg = yellow; };
+
SpecialKey = { fg = element; };
+
+
Spell = {
+
Bad = { fg = red; style = "underline"; };
+
Cap = { fg = brightYellow; };
+
Local = { fg = brightYellow; };
+
Rare = { fg = brightYellow; };
+
};
+
+
TabLine = {
+
base = { fg = brightWhite; };
+
Fill = mkHighlight {};
+
Sel = { fg = white; };
+
};
+
+
StatusLine = { fg = white; bg = cursor; };
+
StatusLineNC = { fg = brightWhite; };
+
Title = { fg = green; };
+
Visual = { bg = grey; };
+
VisualNOS = { fg = grey; };
+
WildMenu = { fg = black; bg = blue; };
+
NormalFloat = { bg = split; };
+
TreesitterContext = { bg = gutter; };
+
+
dockerfile.Keyword = { fg = purple; };
+
+
sh = {
+
Set = { fg = cyan; };
+
SetOption = { fg = white; };
+
Statement = { fg = cyan; };
+
FunctionKey = { fg = purple; };
+
};
+
+
css = {
+
AttrComma = { fg = purple; };
+
AttributeSelector = { fg = green; };
+
Braces = { fg = white; };
+
ClassName = { fg = brightYellow; };
+
ClassNameDot = { fg = brightYellow; };
+
Definition = { fg = purple; };
+
FontAttr = { fg = brightYellow; };
+
FontDescriptor = { fg = purple; };
+
FunctionName = { fg = blue; };
+
Identifier = { fg = blue; };
+
Important = { fg = purple; };
+
Include = { fg = white; };
+
IncludeKeyword = { fg = purple; };
+
MediaType = { fg = brightYellow; };
+
Prop = { fg = purple; };
+
PseudoClassId = { fg = brightYellow; };
+
SelectorOp = { fg = purple; };
+
SelectorOp2 = { fg = purple; };
+
TagName = { fg = red; };
+
Color = { fg = brightYellow; };
+
CommonAttr = { fg = blue; };
+
UnitDecorators = { fg = yellow; };
+
};
+
+
go.Declaration = { fg = purple; };
+
+
html = {
+
Title = { fg = white; };
+
Arg = { fg = yellow; };
+
EndTag = { fg = cyan; };
+
Link = { fg = purple; };
+
SpecialChar = { fg = brightYellow; };
+
SpecialTagName = { fg = red; };
+
Tag = { fg = cyan; };
+
TagName = { fg = red; };
+
H1 = { fg = blue; };
+
H2 = { fg = blue; };
+
H3 = { fg = blue; };
+
H4 = { fg = blue; };
+
H5 = { fg = blue; };
+
H6 = { fg = blue; };
+
};
+
+
javaScript = {
+
Braces = { fg = white; };
+
Function = { fg = purple; };
+
Identifier = { fg = purple; };
+
Null = { fg = brightYellow; };
+
Number = { fg = brightYellow; };
+
Require = { fg = cyan; };
+
Reserved = { fg = purple; };
+
};
+
+
# For: https://github.com/pangloss/vim-javascript
+
js = {
+
ArrowFunction = { fg = purple; };
+
ClassKeyword = { fg = purple; };
+
ClassDefinition = { fg = yellow; };
+
ClassMethodType = { fg = purple; };
+
ClassFuncName = { fg = blue; };
+
DestructuringBlock = { fg = blue; };
+
DocParam = { fg = blue; };
+
DocTags = { fg = purple; };
+
Export = { fg = purple; };
+
ExportDefault = { fg = red; };
+
ExtendsKeyword = { fg = purple; };
+
Conditional = { fg = purple; };
+
Operator = { fg = purple; };
+
From = { fg = purple; };
+
FuncArgs = { fg = blue; };
+
FuncCall = { fg = blue; };
+
ObjectProp = { fg = cyan; };
+
Function = { fg = purple; };
+
Generator = { fg = yellow; };
+
GlobalObjects = { fg = yellow; };
+
Import = { fg = purple; };
+
ModuleAs = { fg = purple; };
+
ModuleWords = { fg = purple; };
+
ModuleKeyword = { fg = blue; };
+
Modules = { fg = purple; };
+
Null = { fg = brightYellow; };
+
StorageClass = { fg = purple; };
+
Super = { fg = red; };
+
TemplateBraces = { fg = brightRed; };
+
TemplateVar = { fg = green; };
+
This = { fg = red; };
+
Undefined = { fg = brightYellow; };
+
};
+
+
# For: https://github.com/othree/yajs.vim
+
javascript = {
+
ArrowFunc = { fg = purple; };
+
ClassExtends = { fg = purple; };
+
ClassKeyword = { fg = purple; };
+
DocNotation = { fg = purple; };
+
DocParamName = { fg = blue; };
+
DocTags = { fg = purple; };
+
EndColons = { fg = white; };
+
Export = { fg = purple; };
+
FuncArg = { fg = white; };
+
FuncKeyword = { fg = purple; };
+
Identifier = { fg = red; };
+
Import = { fg = purple; };
+
MethodName = { fg = white; };
+
ObjectLabel = { fg = white; };
+
OpSymbol = { fg = cyan; };
+
OpSymbols = { fg = cyan; };
+
PropertyName = { fg = green; };
+
TemplateSB = { fg = brightRed; };
+
Variable = { fg = purple; };
+
};
+
+
typescript = {
+
Identifier = { fg = red; };
+
Reserved = { fg = purple; };
+
EndColons = { fg = white; };
+
Braces = { fg = white; };
+
};
+
+
json = {
+
CommentError = { fg = white; };
+
Keyword = { fg = blue; };
+
Boolean = { fg = red; };
+
Number = { fg = brightYellow; };
+
Quote = { fg = white; };
+
String = { fg = green; };
+
MissingCommaError = { fg = brightRed; style = "reverse"; };
+
NoQuotesError = { fg = brightRed; style = "reverse"; };
+
NumError = { fg = brightRed; style = "reverse"; };
+
StringSQError = { fg = brightRed; style = "reverse"; };
+
SemicolonError = { fg = brightRed; style = "reverse"; };
+
};
+
+
markdown = {
+
Code = { fg = green; };
+
LinkReference = { fg = brightWhite; };
+
JekyllFrontMatter = { fg = brightWhite; };
+
CodeBlock = { fg = green; };
+
CodeDelimiter = { fg = green; };
+
HeadingDelimiter = { fg = red; };
+
Rule = { fg = brightWhite; };
+
HeadingRule = { fg = brightWhite; };
+
Delimiter = { fg = cyan; };
+
Id = { fg = purple; };
+
Blockquote = { fg = brightWhite; };
+
Italic = { fg = purple; style = "italic"; };
+
Bold = { fg = purple; style = "bold"; };
+
OrderedListMarker = { fg = red; };
+
IdDeclaration = { fg = blue; };
+
LinkDelimiter = { fg = white; };
+
};
+
+
mkd = {
+
Italic = { fg = purple; style = "italic"; };
+
Bold = { fg = purple; style = "bold"; };
+
InlineURL = { fg = red; };
+
ListItem = { fg = yellow; };
+
Link = { fg = white; };
+
URL = { fg = red; };
+
};
+
+
xml = {
+
Attrib = { fg = yellow; };
+
EndTag = { fg = red; };
+
Tag = { fg = red; };
+
TagName = { fg = red; };
+
};
+
+
php = {
+
Include = { fg = purple; };
+
Class = { fg = yellow; };
+
Classes = { fg = yellow; };
+
Function = { fg = blue; };
+
Type = { fg = purple; };
+
Keyword = { fg = purple; };
+
VarSelector = { fg = purple; };
+
Identifier = { fg = white; };
+
Method = { fg = blue; };
+
Boolean = { fg = blue; };
+
Parent = { fg = white; };
+
Operator = { fg = purple; };
+
Region = { fg = purple; };
+
UseNamespaceSeparator = { fg = white; };
+
ClassNamespaceSeparator = { fg = white; };
+
DocTags = { fg = purple; style="italic"; };
+
DocParam = { fg = purple; style="italic"; };
+
};
+
+
debug = {
+
Breakpoint = { fg = brightBlue; };
+
PC = { bg = brightBlue; fg = black; };
+
};
+
+
gitcommit = {
+
Comment = { fg = brightWhite; };
+
Untracked = { fg = brightWhite; };
+
Discarded = { fg = brightWhite; };
+
Selected = { fg = brightWhite; };
+
Unmerged = { fg = green; };
+
OnBranch = mkHighlight {};
+
Branch = { fg = purple; };
+
NoBranch = { fg = purple; };
+
DiscardedType = { fg = red; };
+
SelectedType = { fg = green; };
+
Header = mkHighlight {};
+
UntrackedFile = { fg = cyan; };
+
DiscardedFile = { fg = red; };
+
SelectedFile = { fg = green; };
+
UntrackedArrow = { fg = cyan; };
+
DiscardedArrow = { fg = red; };
+
SelectedArrow = { fg = green; };
+
UnmergedFile = { fg = yellow; };
+
File = mkHighlight {};
+
Summary = { fg = white; };
+
Overflow = { fg = red; };
+
};
+
+
terminal = {
+
background = { fg = black; };
+
foreground = { fg = white; };
+
black = { fg = black; };
+
red = { fg = red; };
+
green = { fg = green; };
+
yellow = { fg = yellow; };
+
blue = { fg = blue; };
+
purple = { fg = purple; };
+
cyan = { fg = cyan; };
+
white = { fg = white; };
+
grey = { fg = grey; };
+
brightRed = { fg = brightRed; };
+
brightGreen = { fg = brightGreen; };
+
brightYellow = { fg = brightYellow; };
+
brightBlue = { fg = brightBlue; };
+
brightPurple = { fg = brightPurple; };
+
brightCyan = { fg = brightCyan; };
+
brightWhite = { fg = brightWhite; };
+
};
+
+
GitSigns = {
+
Add = { fg = green; };
+
Change = { fg = brightBlue; };
+
Delete = { fg = brightRed; };
+
};
+
+
Signify = {
+
Add = { fg = green; };
+
Change = { fg = brightBlue; };
+
Delete = { fg = brightRed; };
+
};
+
+
GitGutter = {
+
Add = { fg = green; };
+
Change = { fg = brightBlue; };
+
Delete = { fg = brightRed; };
+
};
+
+
Neomake = {
+
WarningSign = { fg = yellow; };
+
ErrorSign = { fg = brightRed; };
+
InfoSign = { fg = blue; };
+
};
+
+
DiagnosticSign = {
+
Warn = { fg = yellow; };
+
Error = { fg = brightRed; };
+
Information = { fg = blue; };
+
Hint = { fg = yellow; };
+
};
+
+
Telescope = {
+
Border = { fg = split; };
+
Matching = { fg = blue; style = "bold"; };
+
};
+
+
TS.Definition = { fg = blue; bg = brightWhite; };
+
EasyMotion.IncSearch = { fg = blue; style = "bold"; };
+
};
+
};
+
};
+
}
+160
modules/services/mysql.nix
···
+
{ config, lib, pkgs, ... }:
+
+
with lib;
+
+
let
+
cfg = config.services.mysql;
+
+
isMariaDB = lib.getName cfg.package == lib.getName pkgs.mariadb;
+
+
mysqldOptions =
+
"--defaults-file=${configFile} --datadir=${cfg.dataDir} --basedir=${cfg.package}";
+
+
format = pkgs.formats.ini { listsAsDuplicateKeys = true; };
+
configFile = format.generate "my.cnf" cfg.settings;
+
+
preStart = if isMariaDB then ''
+
if ! test -e ${cfg.dataDir}/mysql_init; then
+
${cfg.package}/bin/mysql_install_db ${mysqldOptions}
+
touch ${cfg.dataDir}/mysql_init
+
fi
+
'' else ''
+
if ! test -e ${cfg.dataDir}/mysql_init; then
+
${cfg.package}/bin/mysqld ${mysqldOptions} --initialize-insecure
+
touch ${cfg.dataDir}/mysql_init
+
fi
+
'';
+
in
+
+
{
+
options = {
+
+
services.mysql = {
+
+
enable = mkEnableOption (lib.mdDoc "MySQL server");
+
+
package = mkOption {
+
type = types.package;
+
example = literalExpression "pkgs.mariadb";
+
description = lib.mdDoc ''
+
Which MySQL derivation to use. MariaDB packages are supported too.
+
'';
+
};
+
+
dataDir = mkOption {
+
type = types.path;
+
example = "/var/lib/mysql";
+
description = lib.mdDoc ''
+
The data directory for MySQL.
+
+
::: {.note}
+
If left as the default value of `/var/lib/mysql` this directory will automatically be created before the MySQL
+
server starts, otherwise you are responsible for ensuring the directory exists with appropriate ownership and permissions.
+
:::
+
'';
+
};
+
+
configFile = mkOption {
+
type = types.path;
+
default = configFile;
+
defaultText = ''
+
A configuration file automatically generated by NixOS.
+
'';
+
description = lib.mdDoc ''
+
Override the configuration file used by MySQL. By default,
+
NixOS generates one automatically from {option}`services.mysql.settings`.
+
'';
+
example = literalExpression ''
+
pkgs.writeText "my.cnf" '''
+
[mysqld]
+
datadir = /var/lib/mysql
+
bind-address = 127.0.0.1
+
port = 3336
+
+
!includedir /etc/mysql/conf.d/
+
''';
+
'';
+
};
+
+
settings = mkOption {
+
type = format.type;
+
default = {};
+
description = lib.mdDoc ''
+
MySQL configuration. Refer to
+
<https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html>,
+
<https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html>,
+
and <https://mariadb.com/kb/en/server-system-variables/>
+
for details on supported values.
+
+
::: {.note}
+
MySQL configuration options such as `--quick` should be treated as
+
boolean options and provided values such as `true`, `false`,
+
`1`, or `0`. See the provided example below.
+
:::
+
'';
+
example = literalExpression ''
+
{
+
mysqld = {
+
key_buffer_size = "6G";
+
table_cache = 1600;
+
log-error = "/var/log/mysql_err.log";
+
plugin-load-add = [ "server_audit" "ed25519=auth_ed25519" ];
+
};
+
mysqldump = {
+
quick = true;
+
max_allowed_packet = "16M";
+
};
+
}
+
'';
+
};
+
};
+
};
+
+
+
###### implementation
+
+
config = mkIf cfg.enable {
+
+
services.mysql.dataDir =
+
mkDefault (if versionAtLeast config.system.stateVersion "17.09" then "/var/lib/mysql"
+
else "/var/mysql");
+
+
services.mysql.settings.mysqld = mkMerge [
+
{
+
datadir = cfg.dataDir;
+
port = mkDefault 3306;
+
}
+
(mkIf (!isMariaDB) {
+
plugin-load-add = "auth_socket.so";
+
})
+
];
+
+
environment.systemPackages = [ cfg.package ];
+
environment.etc."my.cnf".source = cfg.configFile;
+
+
launchd.user.agents.mysql = {
+
path = [ cfg.package ];
+
+
script = ''
+
${preStart}
+
exec ${cfg.package}/bin/mysqld ${mysqldOptions}
+
'';
+
+
serviceConfig.KeepAlive = true;
+
serviceConfig.RunAtLoad = true;
+
};
+
+
system.activationScripts.postActivation.text = ''
+
if [ ! -d "${cfg.dataDir}" ]; then
+
mkdir -p "${cfg.dataDir}"
+
chmod -R 777 "${cfg.dataDir}"
+
fi
+
+
if [ ! -d "/run/mysqld" ]; then
+
mkdir -p "/run/mysqld"
+
chmod -R 777 "/run/mysqld"
+
fi
+
'';
+
};
+
}
+
+17
modules/shell.nix
···
+
{ lib, pkgs, ... }:
+
+
{
+
environment.systemPackages = [
+
pkgs.zsh
+
];
+
+
environment.pathsToLink = [ "/share/zsh" ];
+
environment.variables = {
+
SHELL = "${pkgs.zsh}/bin/zsh";
+
};
+
+
programs.zsh = {
+
enable = true;
+
promptInit = lib.mkDefault "";
+
};
+
}
-2
nix/binary-caches/nixpkgs
···
-
https://hydra.nixos.org
-
https://cache.nixos.org
-40
nix/channels.nix
···
-
let
-
inherit (import <nixpkgs> {}) fetchFromGitHub;
-
-
darwin_src = fetchFromGitHub {
-
owner = "LnL7";
-
repo = "nix-darwin";
-
rev = "b8c286c82c6b47826a6c0377e7017052ad91353c";
-
sha256 = "0cg2zv1avmqjymkynmgc2c5v9yk9wzl2kb66jrzc1kaqhz1xm544";
-
};
-
-
/* release-22.11 */
-
home-manager_src = fetchFromGitHub {
-
owner = "nix-community";
-
repo = "home-manager";
-
rev = "f9edbedaf015013eb35f8caacbe0c9666bbc16af";
-
sha256 = "1cp2rpprcfl4mjsrsrpfg6278nf05a0mpl3m0snksvdalfmc5si5";
-
};
-
-
/* nixpkgs-23.05-darwin */
-
nixpkgs_src = fetchFromGitHub {
-
owner = "NixOS";
-
repo = "nixpkgs";
-
rev = "8c5f01ab09866caa80e2876c9dfd922100984c7e";
-
sha256 = "1i56m4mj55qqsdcbmzwvi9pcz3i9cjjd5wqlv5srs331kwbsdg00";
-
};
-
in
-
-
rec {
-
__nixPath = [
-
{ prefix = "binary-caches"; path = ./binary-caches; }
-
{ prefix = "darwin"; path = darwin_src; }
-
{ prefix = "darwin-config"; path = ../configuration.nix; }
-
{ prefix = "home-manager"; path = home-manager_src; }
-
{ prefix = "nixos"; path = nixpkgs_src; }
-
{ prefix = "nixos-config"; path = ../configuration.nix; }
-
{ prefix = "nixpkgs"; path = nixpkgs_src; }
-
];
-
-
nixPath = map ({ prefix, path }: "${prefix}=${__replaceStrings [ "/mnt/" ] [ "/" ] (toString path)}") __nixPath;
-
}
-14
nix/derivations.nix
···
-
let
-
lib = import <nixpkgs/lib>;
-
pkgs = import <nixpkgs> { system = builtins.currentSystem; };
-
in {
-
copyFiles = name: entries: pkgs.runCommand name { preferLocalBuild = true; allowSubstitutes = false; }
-
''
-
mkdir -p $out
-
cd $out
-
${lib.concatMapStrings (x: ''
-
mkdir -p "$(dirname ${lib.escapeShellArg x.target})"
-
cp ${lib.escapeShellArg x.source} ${lib.escapeShellArg x.target}
-
'') entries}
-
'';
-
}
-20
nix/hostname.nix
···
-
{ lib, ... }:
-
-
let
-
-
inherit (lib) maybeEnv fileContents;
-
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
-
-
in
-
-
maybeEnv "HOST" (fileContents (
-
if !isDarwin then
-
/etc/hostname
-
else
-
derivation {
-
name = "hostname";
-
system = builtins.currentSystem;
-
builder = "/bin/sh";
-
args = [ "-c" "/usr/sbin/scutil --get LocalHostName > $out" ];
-
}
-
))
-35
nix/nix-path.nix
···
-
{ config, lib, ... }:
-
-
let
-
-
inherit (import ./channels.nix) __nixPath nixPath;
-
inherit (lib) mkForce;
-
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
-
-
in
-
-
rec {
-
nixpkgs = {
-
config.allowUnfree = true;
-
config.allowBroken = true;
-
};
-
-
nix.nixPath = mkForce nixPath;
-
-
_module.args =
-
let
-
pkgsConf = {
-
inherit (config.nixpkgs) localSystem crossSystem;
-
overlays = config.nixpkgs.overlays;
-
config = config.nixpkgs.config // nixpkgs.config;
-
};
-
in rec {
-
pkgs = (lib.mkForce (import <nixpkgs> (
-
if isLinux then {
-
inherit (pkgsConf) overlays config localSystem crossSystem;
-
} else {
-
inherit (pkgsConf) overlays config;
-
}
-
)));
-
};
-
}
-14
nix/secrets.nix
···
-
let
-
inherit (import ./channels.nix) __nixPath nixPath;
-
pkgs = import <nixpkgs> { system = builtins.currentSystem; };
-
in rec {
-
readSecretFile = path :
-
pkgs.runCommand (baseNameOf (toString path)) {
-
buildInputs = [ pkgs.openssl ];
-
} ''
-
openssl enc -d -aes-256-cbc -pbkdf2 -salt -base64 -in ${path} -out $out -kfile ${../.nix-secret}
-
'';
-
-
readSecretFileContents = path :
-
builtins.readFile (readSecretFile path);
-
}
-25
profiles/common.nix
···
-
{ lib, pkgs, ... }:
-
-
let
-
inherit (lib) optional flatten;
-
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
-
in {
-
environment.systemPackages = [
-
pkgs.openssl
-
];
-
-
imports = flatten [
-
../config/shell.nix
-
../config/nvim/default.nix
-
../config/nodejs.nix
-
../config/gpg.nix
-
../config/fonts.nix
-
../config/postgres.nix
-
../config/mysql.nix
-
-
./tools.nix
-
./users.nix
-
-
(optional isDarwin ./darwin.nix)
-
];
-
}
-35
profiles/darwin.nix
···
-
{ pkgs, ... }:
-
-
{
-
security.pam.enableSudoTouchIdAuth = true;
-
-
system = {
-
keyboard = {
-
enableKeyMapping = true;
-
remapCapsLockToControl = true;
-
nonUS.remapTilde = true;
-
};
-
-
defaults = {
-
finder.CreateDesktop = false;
-
screencapture.location = "~/Screenshots";
-
loginwindow = {
-
GuestEnabled = false;
-
DisableConsoleAccess = true;
-
};
-
dock = {
-
autohide = true;
-
tilesize = 46;
-
};
-
NSGlobalDomain = {
-
AppleShowAllExtensions = true;
-
InitialKeyRepeat = 10;
-
KeyRepeat = 2;
-
};
-
};
-
};
-
-
environment.systemPackages = [
-
pkgs.coreutils
-
];
-
}
-21
profiles/tools.nix
···
-
{ pkgs, ... }:
-
-
{
-
environment.systemPackages = with pkgs; [
-
imagemagick
-
ffmpeg
-
pngquant
-
ripgrep
-
xh
-
curl
-
sd
-
fd
-
awscli
-
cloudflared
-
woff2
-
temporal
-
dive
-
caddy
-
wasmtime
-
];
-
}
-31
profiles/users.nix
···
-
{ pkgs, config, lib, ... }:
-
-
let
-
inherit (lib) optionalAttrs mkMerge mkIf mkDefault;
-
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
-
in
-
-
mkMerge [
-
{
-
home-manager = {
-
useGlobalPkgs = true;
-
useUserPackages = true;
-
users.phil = _: {
-
manual.manpages.enable = false;
-
home.stateVersion = "22.11";
-
xdg.enable = true;
-
imports = [ ../config/home/default.nix ];
-
};
-
};
-
-
users.users.phil.home = mkIf isDarwin "/Users/phil";
-
}
-
-
(optionalAttrs isLinux {
-
users.users.phil = {
-
isNormalUser = true;
-
uid = 1000;
-
home = "/home/phil";
-
};
-
})
-
]
+19
secrets.nix
···
+
let
+
keys = [
+
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF2TB8awz+vq4oPbzztPLBBRKjgu1LvNoTBLVLgTbBmT"
+
];
+
in
+
{
+
"./modules/fonts/encrypt/DankMono-Regular.otf.age".publicKeys = keys;
+
"./modules/fonts/encrypt/DankMono-Bold.otf.age".publicKeys = keys;
+
"./modules/fonts/encrypt/DankMono-Italic.otf.age".publicKeys = keys;
+
+
"./modules/fonts/encrypt/codicon.otf.age".publicKeys = keys;
+
+
"./home/gpg/encrypt/pubring.kbx.age".publicKeys = keys;
+
"./home/gpg/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age".publicKeys = keys;
+
"./home/gpg/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age".publicKeys = keys;
+
"./home/gpg/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age".publicKeys = keys;
+
+
"./home/npm/encrypt/npmrc.age".publicKeys = keys;
+
}