feat: added themes and other stuff

This commit is contained in:
Nick 2024-12-19 19:56:45 -06:00
parent 951928150e
commit c7b32f0f31
18 changed files with 248 additions and 61 deletions

View file

@ -8,6 +8,9 @@
listType = lib.mkOption { listType = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
}; };
attrList = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
};
numOptions = 20; numOptions = 20;
@ -83,6 +86,13 @@
// genOptions mountConfig "samba" // genOptions mountConfig "samba"
// genOptions mountConfig "storage"; // genOptions mountConfig "storage";
}; };
themesSubmodule = lib.types.submodule {
options = {
colors = attrList;
font = stringType;
};
};
in { in {
options = { options = {
services = lib.mkOption { services = lib.mkOption {
@ -122,11 +132,23 @@ in {
}; };
}; };
}; };
aesthetics = lib.mkOption {
type = lib.types.submodule {
options =
mkOptionsFromDir ./themes/config
// {
themes = lib.mkOption {
type = lib.types.attrsOf themesSubmodule;
};
};
};
};
}; };
config = { config = {
people = import ./users; people = import ./users;
services = import ./instances; services = import ./instances;
machines = import ./devices; machines = import ./devices;
aesthetics = import ./themes;
}; };
} }

31
config/themes/config/theme.nix Executable file
View file

@ -0,0 +1,31 @@
{themeFunctions}: {
colors = {
rosewater = "f4dbd6";
flamingo = "f0c6c6";
pink = "f5bde6";
mauve = "c6a0f6";
red = "ed8796";
maroon = "ee99a0";
peach = "f5a97f";
yellow = "eed49f";
green = "a6da95";
teal = "8bd5ca";
sky = "91d7e3";
sapphire = "7dc4e4";
blue = "8aadf4";
lavender = "b7bdf8";
text = "cad3f5";
subtext1 = "b8c0e0";
subtext0 = "a5adcb";
overlay2 = "939ab7";
overlay1 = "8087a2";
overlay0 = "6e738d";
surface2 = "5b6078";
surface1 = "494d64";
surface0 = "363a4f";
base = "24273a";
mantle = "1e2030";
crust = "181926";
};
font = "MonaspiceRn Nerd Font";
}

17
config/themes/default.nix Executable file
View file

@ -0,0 +1,17 @@
let
configPath = ./config;
themeFunctions = {
dummy = [];
};
themes = builtins.listToAttrs (map (name: {
name = builtins.substring 0 (builtins.stringLength name - 4) name;
value = import (configPath + "/${name}") {inherit themeFunctions;};
})
(builtins.filter (name:
builtins.match ".*\\.nix$" name != null) (builtins.attrNames
(builtins.readDir configPath))));
in {
themes = themes;
}

84
flake.lock generated
View file

@ -11,11 +11,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1733663126, "lastModified": 1734342536,
"narHash": "sha256-hsmuCRS1eCEL5/V06thNje/GVDcnogefkcrK3v1cTSk=", "narHash": "sha256-ofvzJJG/aW4GFlCx4AF+ZV2sSpQyTcna45XItu6SLf8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "buildbot-nix", "repo": "buildbot-nix",
"rev": "00b597260df14f06997f0ab86b3ba1610bb7e37c", "rev": "8dc24d5432b02a44b34f42916676b60b62dd3478",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -124,11 +124,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730504689, "lastModified": 1733312601,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90", "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -269,11 +269,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730903510, "lastModified": 1733333617,
"narHash": "sha256-mnynlrPeiW0nUQ8KGZHb3WyxAxA3Ye/BH8gMjdoKP6E=", "narHash": "sha256-nMMQXREGvLOLvUa0ByhYFdaL0Jov0t1wzLbKjr05P2w=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-effects", "repo": "hercules-ci-effects",
"rev": "b89ac4d66d618b915b1f0a408e2775fe3821d141", "rev": "56f8ea8d502c87cf62444bec4ee04512e8ea24ea",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -289,11 +289,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734093295, "lastModified": 1734622215,
"narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=", "narHash": "sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8", "rev": "1395379a7a36e40f2a76e7b9936cc52950baa1be",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -349,11 +349,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1733751617, "lastModified": 1734391563,
"narHash": "sha256-+r65QeqajIQOL7BJ5ko+x7chjbReGyTKwgnocAsgUbU=", "narHash": "sha256-L2MTQEXOpXc5nWPWAKiOyugGl2MwIHIA3IztVNiTSfg=",
"owner": "ngi-nix", "owner": "ngi-nix",
"repo": "ngipkgs", "repo": "ngipkgs",
"rev": "1afffc1a1279fbbc15c9969e41e5b553c8ab6e4b", "rev": "40be4af909abc7e0e11ab45b90f34c8f8714aa56",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -364,11 +364,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1733376361, "lastModified": 1734126203,
"narHash": "sha256-aLJxoTDDSqB+/3orsulE6/qdlX6MzDLIITLZqdgMpqo=", "narHash": "sha256-0XovF7BYP50rTD2v4r55tR5MuBLet7q4xIz6Rgh3BBU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "929116e316068c7318c54eb4d827f7d9756d5e9c", "rev": "71a6392e367b08525ee710a93af2e80083b5b3e2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -380,11 +380,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1733384649, "lastModified": 1734202038,
"narHash": "sha256-K5DJ2LpPqht7K76bsxetI+YHhGGRyVteTPRQaIIKJpw=", "narHash": "sha256-LwcGIkORU8zfQ/8jAgptgPY8Zf9lGKB0vtNdQyEkaN8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "190c31a89e5eec80dd6604d7f9e5af3802a58a13", "rev": "bcba2fbf6963bf6bed3a749f9f4cf5bff4adb96d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -412,11 +412,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1733940404, "lastModified": 1734424634,
"narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=", "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5d67ea6b4b63378b9c13be21e2ec9d1afc921713", "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -435,11 +435,11 @@
"treefmt-nix": "treefmt-nix_2" "treefmt-nix": "treefmt-nix_2"
}, },
"locked": { "locked": {
"lastModified": 1734161914, "lastModified": 1734656871,
"narHash": "sha256-ExfXU3QblJezWnfHSxKSe5k4zC08jfuNvwZxDOtKSOY=", "narHash": "sha256-SnAL5IMs8K35xrKJFBqVAHDomXTkveaXk7aftqglXcc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "3a6a25e030e226a50877d6b9bd64f6743c4ebb0a", "rev": "646b957d7d1d1aef1e5b0d59ecbe2661a56722d9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -462,11 +462,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733665616, "lastModified": 1734379367,
"narHash": "sha256-+XTFXYlFJBxohhMGLDpYdEnhUNdxN8dyTA8WAd+lh2A=", "narHash": "sha256-Keu8z5VgT5gnCF4pmB+g7XZFftHpfl4qOn7nqBcywdE=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "d8c02f0ffef0ef39f6063731fc539d8c71eb463a", "rev": "0bb4be58f21ff38fc3cdbd6c778eb67db97f0b99",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -485,11 +485,11 @@
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1733665616, "lastModified": 1734425854,
"narHash": "sha256-+XTFXYlFJBxohhMGLDpYdEnhUNdxN8dyTA8WAd+lh2A=", "narHash": "sha256-nzE5UbJ41aPEKf8R2ZFYtLkqPmF7EIUbNEdHMBLg0Ig=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "d8c02f0ffef0ef39f6063731fc539d8c71eb463a", "rev": "0ddd26d0925f618c3a5d85a4fa5eb1e23a09491d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -583,11 +583,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733128155, "lastModified": 1733965552,
"narHash": "sha256-m6/qwJAJYcidGMEdLqjKzRIjapK4nUfMq7rDCTmZajc=", "narHash": "sha256-GZ4YtqkfyTjJFVCub5yAFWsHknG1nS/zfk7MuHht4Fs=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c6134b6fff6bda95a1ac872a2a9d5f32e3c37856", "rev": "2d73fc6ac4eba4b9a83d3cb8275096fbb7ab4004",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -603,11 +603,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733965552, "lastModified": 1734546875,
"narHash": "sha256-GZ4YtqkfyTjJFVCub5yAFWsHknG1nS/zfk7MuHht4Fs=", "narHash": "sha256-6OvJbqQ6qPpNw3CA+W8Myo5aaLhIJY/nNFDk3zMXLfM=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "2d73fc6ac4eba4b9a83d3cb8275096fbb7ab4004", "rev": "ed091321f4dd88afc28b5b4456e0a15bd8374b4d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -670,11 +670,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730321837, "lastModified": 1733761991,
"narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=", "narHash": "sha256-s4DalCDepD22jtKL5Nw6f4LP5UwoMcPzPZgHWjAfqbQ=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "746901bb8dba96d154b66492a29f5db0693dbfcc", "rev": "0ce9d149d99bc383d1f2d85f31f6ebd146e46085",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -4,5 +4,9 @@
configFile.text = '' configFile.text = ''
$env.config = {show_banner: false} $env.config = {show_banner: false}
''; '';
shellAliases = {
y = "yy";
lg = "lazygit";
};
}; };
} }

View file

@ -1,9 +1,63 @@
{ {
flake,
lib,
...
}: let
inherit (flake.config.aesthetics.themes.theme) colors;
makeColor = c: "#" + c;
makeStyle = bg: fg: "bg:" + bg + " fg:" + fg + " bold";
surround = fg: text: "[](fg:" + makeColor colors.base + " bg:" + fg + ")" + "[](fg:" + fg + ")" + text + "[](fg:" + fg + ")";
in {
settings = { settings = {
add_newline = false; add_newline = false;
character = { character = let
success_symbol = "[ ](bold #8bd5ca)"; makeChar = bg: c: surround (makeColor bg) ("[" + c + "](" + makeStyle (makeColor bg) (makeColor colors.crust) + ")");
error_symbol = "[ ¬](bold #ee99a0)"; in {
error_symbol = makeChar colors.maroon "";
format = "$symbol";
success_symbol = makeChar colors.teal "λ";
}; };
cmd_duration = {
format = surround (makeColor colors.mauve) "[ $duration]($style)";
min_time = 0;
show_milliseconds = true;
style = makeStyle (makeColor colors.mauve) (makeColor colors.crust);
};
directory = {
format = surround (makeColor colors.blue) "[󰉋 $path]($style)[$read_only]($read_only_style)";
read_only = " ";
read_only_style = makeStyle (makeColor colors.blue) (makeColor colors.crust);
style = makeStyle (makeColor colors.blue) (makeColor colors.crust);
truncation_length = 1;
truncate_to_repo = false;
};
git_branch = {
format = surround (makeColor colors.peach) "[$symbol $branch]($style)";
style = makeStyle (makeColor colors.peach) (makeColor colors.crust);
symbol = "";
};
git_status = {
format = "[ \\[$all_status$ahead_behind\\]]($style)";
style = makeStyle (makeColor colors.yellow) (makeColor colors.crust);
};
hostname = {
format = surround (makeColor colors.sapphire) "[$ssh_symbol$hostname]($style)";
ssh_symbol = "󰖟 ";
style = makeStyle (makeColor colors.sapphire) (makeColor colors.crust);
};
pijul_channel = {
disabled = false;
format = surround (makeColor colors.peach) "[$symbol $channel]($style)";
style = makeStyle (makeColor colors.peach) (makeColor colors.crust);
symbol = "";
};
format = lib.concatStrings [
"$hostname"
"$directory"
"$pijul_channel"
"$git_branch"
"$cmd_duration"
"$character "
];
}; };
} }

View file

@ -1,9 +1,16 @@
{ {
flake,
lib,
...
}: {
programs.starship = let programs.starship = let
configPath = ./config; configPath = ./config;
in in
{ {
enable = true; enable = true;
} }
// (import (configPath + /settings.nix)); // (import (configPath + /settings.nix) {
inherit flake;
inherit lib;
});
} }

View file

@ -1,8 +1,11 @@
{ {
lib, lib,
pkgs, pkgs,
flake,
... ...
}: { }: let
inherit (flake.config.aesthetics.themes.theme) font;
in {
userSettings = { userSettings = {
"git.confirmSync" = false; "git.confirmSync" = false;
"editor.insertSpaces" = false; "editor.insertSpaces" = false;
@ -20,5 +23,10 @@
"elmLS.disableElmLSDiagnostics" = true; "elmLS.disableElmLSDiagnostics" = true;
"elmLS.elmReviewDiagnostics" = "warning"; "elmLS.elmReviewDiagnostics" = "warning";
"editor.wordWrap" = "on"; "editor.wordWrap" = "on";
"editor.fontSize" = 14;
"editor.fontFamily" = "'${font}', 'monospace', monospace";
"terminal.integrated.fontSize" = 14;
"terminal.integrated.fontFamily" = "'${font}', 'monospace', monospace";
"editor.fontLigatures" = true;
}; };
} }

View file

@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
lib, lib,
flake,
... ...
}: { }: {
programs = { programs = {
@ -13,6 +14,6 @@
} }
// (import (configPath + /keybindings.nix)) // (import (configPath + /keybindings.nix))
// (import (configPath + /extensions.nix)) {inherit pkgs;} // (import (configPath + /extensions.nix)) {inherit pkgs;}
// (import (configPath + /userSettings.nix)) {inherit pkgs lib;}; // (import (configPath + /userSettings.nix)) {inherit pkgs lib flake;};
}; };
} }

View file

@ -1,12 +1,15 @@
{ {flake, ...}: let
inherit (flake.config.aesthetics.themes.theme) font;
in {
extraConfig = '' extraConfig = ''
return { return {
color_scheme = "Catppuccin Macchiato", color_scheme = "Catppuccin Macchiato",
font_size = 10, font_size = 11,
font = wezterm.font('${font}'),
enable_tab_bar = false, enable_tab_bar = false,
window_close_confirmation = 'NeverPrompt', window_close_confirmation = 'NeverPrompt',
term = 'wezterm', term = 'wezterm',
enable_wayland = false, enable_wayland = true,
front_end = "WebGpu", front_end = "WebGpu",
max_fps = 200 max_fps = 200
} }

View file

@ -1,9 +1,9 @@
{ {flake, ...}: {
programs.wezterm = let programs.wezterm = let
configPath = ./config; configPath = ./config;
in in
{ {
enable = true; enable = true;
} }
// (import (configPath + /extraConfig.nix)); // (import (configPath + /extraConfig.nix) {inherit flake;});
} }

View file

@ -0,0 +1,12 @@
{
keymap.manager.prepend_keymap = [
{
on = ["Q"];
run = "quit";
}
{
on = ["q"];
run = "quit --no-cwd-file";
}
];
}

View file

@ -6,6 +6,7 @@
enable = true; enable = true;
enableNushellIntegration = true; enableNushellIntegration = true;
} }
// (import (configPath + /keymap.nix))
// (import (configPath + /settings.nix)); // (import (configPath + /settings.nix));
# Keymap # Keymap
# https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/keymap.toml # https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/keymap.toml

View file

@ -13,7 +13,7 @@
}; };
variables = { variables = {
VIDEO_PLAYER = "vlc"; VIDEO_PLAYER = "vlc";
EDITOR = "nano"; EDITOR = "hx";
WLR_NO_HARDWARE_CURSORS = "1"; WLR_NO_HARDWARE_CURSORS = "1";
WLR_DRM_NO_ATOMIC = "1"; WLR_DRM_NO_ATOMIC = "1";
NIXPKGS_ALLOW_INSECURE = "1"; NIXPKGS_ALLOW_INSECURE = "1";

View file

@ -1,11 +1,26 @@
{pkgs, ...}: { {pkgs, ...}: {
fonts = { fonts = {
fontconfig.defaultFonts.emoji = ["Noto Fonts Color Emoji"]; fontconfig = {
enable = true;
defaultFonts = {
# serif = [];
# monospace = [];
# sansSerif = [];
emoji = ["Noto Fonts Color Emoji"];
};
antialias = true;
};
packages = builtins.attrValues { packages = builtins.attrValues {
inherit inherit
(pkgs) (pkgs)
noto-fonts-color-emoji noto-fonts-color-emoji
open-dyslexic ;
inherit
(pkgs.nerd-fonts)
jetbrains-mono
droid-sans-mono
victor-mono
monaspace
; ;
}; };
}; };

View file

@ -2,7 +2,7 @@
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
backupFileExtension = "backup"; backupFileExtension = "backup2";
extraSpecialArgs = { extraSpecialArgs = {
inherit flake; inherit flake;
}; };

View file

@ -14,12 +14,23 @@ in {
virtualHosts = { virtualHosts = {
"${host}" = { "${host}" = {
extraConfig = '' extraConfig = ''
redir /.well-known/carddav /remote.php/dav/ 301
redir /.well-known/caldav /remote.php/dav/ 301
reverse_proxy ${localhost}:${toString service.ports.port1} root * /var/lib/website
tls ${service.ssl.cert} ${service.ssl.key} file_server
try_files {path} /index.html
encode gzip
header {
# Disable FLoC tracking
Permissions-Policy interest-cohort=()
# Enable HSTS
Strict-Transport-Security "max-age=31536000; includeSubDomains"
# Prevent MIME-type sniffing
X-Content-Type-Options nosniff
tls ${service.ssl.cert} ${service.ssl.key}
''; '';
}; };
}; };

View file

@ -17,6 +17,7 @@ in {
4333 # Feishin 4333 # Feishin
2234 # Soulseek 2234 # Soulseek
3131 # Deskreen 3131 # Deskreen
1234 # Elm-land server
55473 55473
]; ];
}; };