home: sorting

This commit is contained in:
Guanran Wang 2023-11-28 13:40:22 +08:00
parent 97072e8eae
commit df32f205ce
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
72 changed files with 186 additions and 145 deletions

View file

@ -17,7 +17,6 @@
### Options
myFlake.darwin.networking.dns.provider = lib.mkDefault "alidns";
### Flakes
imports = [
../../../../../darwin/flake-modules/home-manager.nix

View file

@ -1,47 +0,0 @@
{lib, ...}: {
# 3 terminals, one module.
# -- The Orange Box (wtf)
# FAQ (for future myself):
#
# - Q: font?
# A: use fontconfig.
#
# - Q: WezTerm?
# A: - I don't use it.
# - I don't know Lua.
# - extraConfig is probably not enough if you want customize it yourself.
#
# - Q: which terminal should I use?
# A: - Alacritty - rusty
# - Foot - fast
# - Kitty - feature rich
#
# - Q: why does kitty's font look bold
# A: I dont know, might be related to this: https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.text_composition_strategy
options = {
myFlake.home-manager.terminal = {
cursorStyle = lib.mkOption {
type = lib.types.enum ["block" "beam" "underline"];
default = "beam";
example = "block";
description = "Select desired terminal cursor style.";
};
fontSize = lib.mkOption {
type = lib.types.int;
default = 12;
example = 8;
description = "Select desired terminal font size.";
};
padding = lib.mkOption {
type = lib.types.int;
default = 12;
example = 8;
description = "Select desired terminal padding size (in px).";
};
};
};
}

View file

@ -0,0 +1,6 @@
{...}: {
programs.alacritty = {
enable = true;
settings.env.WINIT_X11_SCALE_FACTOR = "1"; # workaround for scaling in X11
};
}

View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
home.packages = [pkgs.amberol];
}

View file

@ -1,11 +1,11 @@
{pkgs, ...}: {
imports = [
./components/dunst
./components/picom.nix
./components/polybar.nix
./components/rofi
./components/sxhkd.nix
./components/udiskie.nix
../dunst
../picom
../polybar
../rofi
../sxhkd
../udiskie
];
home.packages = with pkgs; [flameshot feh];

View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
home.packages = [pkgs.cava];
}

View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
home.packages = [pkgs.easyeffects];
}

View file

@ -1,16 +1,16 @@
{
inputs,
#inputs,
pkgs,
...
}: {
imports = [
../components/dunst
../components/rofi
../components/swayidle.nix
../components/swaylock.nix
../components/swww.nix
../components/udiskie.nix
../components/waybar.nix
../dunst
../rofi
../swayidle
../swaylock
../swww
../udiskie
../waybar
];
home.packages = with pkgs; [swww];

View file

@ -0,0 +1,6 @@
{...}: {
programs.kitty = {
enable = true;
settings.confirm_os_window_close = 0;
};
}

View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
home.packages = [pkgs.loupe];
}

View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
home.packages = [pkgs.mousai];
}

View file

@ -0,0 +1,3 @@
{...}: {
programs.mpv.enable = true;
}

View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
home.packages = [pkgs.netease-cloud-music-gtk];
}

View file

@ -1,17 +1,10 @@
{
pkgs,
lib,
inputs,
...
}: let
spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default;
in {
# allow spotify to be installed if you don't have unfree enabled already
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"spotify"
];
# import the flake's module for your system
imports = [inputs.spicetify-nix.homeManagerModule];

View file

@ -5,12 +5,12 @@
...
}: {
imports = [
./components/dunst
./components/rofi
./components/swayidle.nix
./components/swaylock.nix
./components/udiskie.nix
./components/waybar.nix
../dunst
../rofi
../swayidle
../swaylock
../udiskie
../waybar
];
# https://wiki.archlinux.org/title/Fish#Start_X_at_login

View file

@ -1,6 +1,6 @@
{pkgs, ...}: {
imports = [
./swaylock.nix
../swaylock
];
services = {

View file

@ -25,6 +25,6 @@
programs.home-manager.enable = true;
imports = [
./actual-modules
./modules
];
}

View file

@ -0,0 +1,86 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myFlake.home-manager.terminal;
in {
# 3 terminals, one module.
# -- The Orange Box (wtf)
# FAQ (for future myself):
#
# - Q: font?
# A: use fontconfig.
#
# - Q: WezTerm?
# A: - I don't use it.
# - I don't know Lua.
# - extraConfig is probably not enough if you want customize it yourself.
#
# - Q: which terminal should I use?
# A: - Alacritty - rusty
# - Foot - fast
# - Kitty - feature rich
#
# - Q: why does kitty's font look bold
# A: I dont know, might be related to this: https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.text_composition_strategy
options = {
myFlake.home-manager.terminal = {
cursorStyle = lib.mkOption {
type = lib.types.enum ["block" "beam" "underline"];
default = "beam";
example = "block";
description = "Select desired terminal cursor style.";
};
fontSize = lib.mkOption {
type = lib.types.int;
default = 12;
example = 8;
description = "Select desired terminal font size.";
};
padding = lib.mkOption {
type = lib.types.int;
default = 12;
example = 8;
description = "Select desired terminal padding size (in px).";
};
};
};
config = {
programs = {
alacritty.settings = {
import =
lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight")
["${pkgs.vimPlugins.tokyonight-nvim}/extras/alacritty/tokyonight_night.yml"];
cursor.style = cfg.cursorStyle;
font.size = cfg.fontSize;
window.padding.x = cfg.padding;
window.padding.y = cfg.padding;
};
kitty.settings = {
include =
lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight")
"${pkgs.vimPlugins.tokyonight-nvim}/extras/kitty/tokyonight_night.conf";
cursor_shape = cfg.cursorStyle;
font_size = cfg.fontSize;
window_padding_width = builtins.toString (cfg.padding * (3.0 / 4.0)); # px -> pt
};
foot.settings = {
main.include =
lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight")
"${pkgs.vimPlugins.tokyonight-nvim}/extras/foot/tokyonight_night.ini";
cursor.style = cfg.cursorStyle;
main.font = "monospace:size=${builtins.toString cfg.fontSize}";
main.pad = "${builtins.toString cfg.padding}x${builtins.toString cfg.padding}";
};
};
};
}

View file

@ -1,23 +0,0 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myFlake.home-manager.terminal;
in {
programs.alacritty = {
enable = true;
settings = {
import =
lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight")
["${pkgs.vimPlugins.tokyonight-nvim}/extras/alacritty/tokyonight_night.yml"];
cursor.style = cfg.cursorStyle;
font.size = cfg.fontSize;
window.padding.x = cfg.padding;
window.padding.y = cfg.padding;
#env.WINIT_X11_SCALE_FACTOR = "1"; # workaround for.. something?
};
};
}

View file

@ -1,22 +0,0 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myFlake.home-manager.terminal;
in {
programs.kitty = {
enable = true;
settings = {
include =
lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight")
"${pkgs.vimPlugins.tokyonight-nvim}/extras/kitty/tokyonight_night.conf";
cursor_shape = cfg.cursorStyle;
font_size = cfg.fontSize;
window_padding_width = builtins.toString (cfg.padding * (3.0 / 4.0)); # px -> pt
confirm_os_window_close = 0;
};
};
}

View file

@ -1,5 +1,6 @@
{...}: {
imports = [
imports =
[
./fonts
./scripts
./wallpapers
@ -8,5 +9,40 @@
./input-method.nix
./theme.nix
./xdg-mime.nix
]
++ map (n: ../../../../home-manager/applications/${n}) [
# Terminal
"alacritty"
# Shell
"fish"
"bash"
# Editor
"helix"
"neovim"
"vscode"
# Browser
"chromium"
"librewolf"
# Language
"nix"
"go"
# Media
"loupe"
"mpv"
"spotify"
"amberol"
"mousai"
# WM
"sway"
# Misc
"irssi"
"mumble"
];
}

View file

@ -20,20 +20,6 @@
home-manager.users.guanranwang.imports = map (n: ../../../../home-manager/${n}) [
"profiles/command-line/nixos/fancy-stuff.nix"
"profiles/graphical-stuff/nixos"
"profiles/media/nixos"
"modules/terms/alacritty.nix"
"modules/shell/fish.nix"
"modules/shell/bash.nix"
"modules/editor/helix.nix"
"modules/editor/neovim.nix"
"modules/editor/vscode.nix"
"modules/browser/chromium.nix"
"modules/browser/librewolf.nix"
"modules/lang/nix.nix"
"modules/lang/go.nix"
"modules/wm/sway.nix"
"modules/misc/irssi.nix"
"modules/misc/mumble.nix"
];
fonts.enableDefaultPackages = false;