This commit is contained in:
Sam 2024-06-02 14:30:14 +01:00
parent 2c8dcf74e4
commit 33d41f4256
10 changed files with 169 additions and 21 deletions

View File

@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"base16-schemes": {
"flake": false,
"locked": {
"lastModified": 1696158499,
"narHash": "sha256-5yIHgDTPjoX/3oDEfLSQ0eJZdFL1SaCfb9d6M0RmOTM=",
"owner": "tinted-theming",
"repo": "base16-schemes",
"rev": "a9112eaae86d9dd8ee6bb9445b664fba2f94037a",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-schemes",
"type": "github"
}
},
"devshell": { "devshell": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
@ -231,6 +247,25 @@
"type": "github" "type": "github"
} }
}, },
"nix-colors": {
"inputs": {
"base16-schemes": "base16-schemes",
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1707825078,
"narHash": "sha256-hTfge2J2W+42SZ7VHXkf4kjU+qzFqPeC9k66jAUBMHk=",
"owner": "misterio77",
"repo": "nix-colors",
"rev": "b01f024090d2c4fc3152cd0cf12027a7b8453ba1",
"type": "github"
},
"original": {
"owner": "misterio77",
"repo": "nix-colors",
"type": "github"
}
},
"nix-darwin": { "nix-darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -282,6 +317,21 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1697935651,
"narHash": "sha256-qOfWjQ2JQSQL15KLh6D7xQhx0qgZlYZTYlcEiRuAMMw=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "e1e11fdbb01113d85c7f41cada9d2847660e3902",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1716655032, "lastModified": 1716655032,
@ -347,6 +397,7 @@
"disko": "disko", "disko": "disko",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"nix-colors": "nix-colors",
"nix-secrets": "nix-secrets", "nix-secrets": "nix-secrets",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",

View File

@ -20,6 +20,9 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Nix colors
nix-colors.url = "github:misterio77/nix-colors";
# Declarative partitioning and formatting # Declarative partitioning and formatting
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko";
@ -49,7 +52,7 @@
disko, disko,
#impermanence, #impermanence,
... ...
} @ inputs: } @ inputs:
let let
inherit (self) outputs; inherit (self) outputs;
systems = [ systems = [

View File

@ -1,12 +1,12 @@
{ config, lib, pkgs, outputs, ... }: { config, lib, pkgs, outputs, inputs, ... }:
{ {
imports = [ imports = [
inputs.nix-colors.homeManagerModules.default
./zsh.nix ./zsh.nix
./nixvim.nix ./nixvim.nix
./fonts.nix ./fonts.nix
] ; ] ;
# Global home packages without config go here (for all hosts and users) # Global home packages without config go here (for all hosts and users)
home.packages = builtins.attrValues { home.packages = builtins.attrValues {
inherit (pkgs) inherit (pkgs)

View File

@ -1,4 +1,4 @@
{ inputs, pkgs, ... }: { { inputs, pkgs, config, ... }: {
imports = [ imports = [
inputs.nixvim.homeManagerModules.nixvim inputs.nixvim.homeManagerModules.nixvim
]; ];
@ -23,6 +23,29 @@
}; };
}; };
# Base16 colorscheme
# colorschemes.base16 = {
# enable = true;
# colorscheme = {
# base00 = "#${config.colorScheme.colors.base00}";
# base01 = "#${config.colorScheme.colors.base01}";
# base02 = "#${config.colorScheme.colors.base02}";
# base03 = "#${config.colorScheme.colors.base03}";
# base04 = "#${config.colorScheme.colors.base04}";
# base05 = "#${config.colorScheme.colors.base05}";
# base06 = "#${config.colorScheme.colors.base06}";
# base07 = "#${config.colorScheme.colors.base07}";
# base08 = "#${config.colorScheme.colors.base08}";
# base09 = "#${config.colorScheme.colors.base09}";
# base0A = "#${config.colorScheme.colors.base0A}";
# base0B = "#${config.colorScheme.colors.base0B}";
# base0C = "#${config.colorScheme.colors.base0C}";
# base0D = "#${config.colorScheme.colors.base0D}";
# base0E = "#${config.colorScheme.colors.base0E}";
# base0F = "#${config.colorScheme.colors.base0F}";
# };
# };
opts = { opts = {
# #
# ========= General Appearance ========= # ========= General Appearance =========
@ -101,6 +124,10 @@
fileTypes = [ "*" ]; fileTypes = [ "*" ];
}; };
plugins.treesitter = {
enable = true;
};
plugins.lualine = { plugins.lualine = {
enable = true; enable = true;
theme = "auto"; theme = "auto";

View File

@ -5,15 +5,15 @@
enableCompletion = true; enableCompletion = true;
autosuggestion.enable = true; autosuggestion.enable = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
shellAliases = { shellAliases = {
ll = "ls -l"; ll = "ls -l";
}; };
history.size = 10000; history.size = 10000;
history.path = "${config.xdg.dataHome}/zsh/history"; history.path = "${config.xdg.dataHome}/zsh/history";
initExtra = '' initExtra = ''
bindkey -v bindkey -v
bindkey "^H" backward-delete-char bindkey "^H" backward-delete-char
bindkey "^?" backward-delete-char bindkey "^?" backward-delete-char
set -o vi set -o vi
@ -22,11 +22,11 @@
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE="(ssh) " SESSION_TYPE="(ssh) "
fi fi
#### ####
# Format prompt # Format prompt
#### ####
# Define colors # Define colors
COLOR_RED="red" COLOR_RED="red"
COLOR_MAGENTA="92" COLOR_MAGENTA="92"
@ -34,20 +34,20 @@
COLOR_GREEN="36" COLOR_GREEN="36"
COLOR_BLUE="4" COLOR_BLUE="4"
COLOR_WHITE="7" COLOR_WHITE="7"
# Format git colors # Format git colors
autoload -Uz compinit && compinit autoload -Uz compinit && compinit
autoload -Uz add-zsh-hook autoload -Uz add-zsh-hook
autoload -Uz vcs_info autoload -Uz vcs_info
add-zsh-hook precmd vcs_info add-zsh-hook precmd vcs_info
zstyle ':vcs_info:*' enable git zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats " %F{cyan}%c%u(%b)%f" zstyle ':vcs_info:*' formats " %F{cyan}%c%u(%b)%f"
zstyle ':vcs_info:*' actionformats " %F{cyan}%c%u(%b)%f %a" zstyle ':vcs_info:*' actionformats " %F{cyan}%c%u(%b)%f %a"
zstyle ':vcs_info:*' stagedstr "%F{$COLOR_RED}" zstyle ':vcs_info:*' stagedstr "%F{$COLOR_RED}"
zstyle ':vcs_info:*' unstagedstr "%F{$COLOR_RED}" zstyle ':vcs_info:*' unstagedstr "%F{$COLOR_RED}"
zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
+vi-git-untracked() { +vi-git-untracked() {
if git --no-optional-locks status --porcelain 2> /dev/null | grep -q "^??"; then if git --no-optional-locks status --porcelain 2> /dev/null | grep -q "^??"; then
@ -58,7 +58,7 @@
hook_com[staged]+="%F{$COLOR_GREEN}" hook_com[staged]+="%F{$COLOR_GREEN}"
fi fi
} }
# Format prompt # Format prompt
setopt PROMPT_SUBST setopt PROMPT_SUBST
PROMPT='%F{'$COLOR_GREEN'}'$(echo "$SESSION_TYPE")''' PROMPT='%F{'$COLOR_GREEN'}'$(echo "$SESSION_TYPE")'''
@ -77,11 +77,28 @@
setopt autocd # Automatically cd into typed directory. setopt autocd # Automatically cd into typed directory.
stty stop undef # Disable ctrl-s to freeze terminal. stty stop undef # Disable ctrl-s to freeze terminal.
setopt interactive_comments setopt interactive_comments
# General opts # General opts
HISTSIZE=10000000 HISTSIZE=10000000
SAVEHIST=10000000 SAVEHIST=10000000
setopt appendhistory setopt appendhistory
# Change cursor shape for different vi modes.
function zle-keymap-select () {
case $KEYMAP in
vicmd) echo -ne '\e[1 q';; # block
viins|main) echo -ne '\e[5 q';; # beam
esac
}
zle -N zle-keymap-select
zle-line-init() {
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
echo -ne "\e[5 q"
}
zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
''; '';
}; };
} }

View File

@ -7,6 +7,37 @@ in
enable = true; enable = true;
settings = { settings = {
colors = with config.colorScheme.palette; {
bright = {
black = "0x${base03}";
blue = "0x${base04}";
cyan = "0x${base0F}";
green = "0x${base01}";
magenta = "0x${base06}";
red = "0x${base09}";
white = "0x${base07}";
yellow = "0x${base02}";
};
cursor = {
cursor = "0x${base05}";
text = "0x${base00}";
};
normal = {
black = "0x${base00}";
blue = "0x${base0D}";
cyan = "0x${base0C}";
green = "0x${base0B}";
magenta = "0x${base0E}";
red = "0x${base08}";
white = "0x${base05}";
yellow = "0x${base0A}";
};
primary = {
background = "0x${base00}";
foreground = "0x${base05}";
};
};
window.padding = { window.padding = {
x = 5; x = 5;
y = 5; y = 5;
@ -14,7 +45,6 @@ in
shell.program = "${pkgs.zsh}/bin/zsh"; shell.program = "${pkgs.zsh}/bin/zsh";
cursor.style = "Beam";
}; };
}; };
} }

View File

@ -6,6 +6,7 @@
# Global packages for desktop environments # Global packages for desktop environments
home.packages = [ home.packages = [
pkgs.alacritty pkgs.alacritty
pkgs.libnotify
pkgs.zathura pkgs.zathura
pkgs.xfce.thunar pkgs.xfce.thunar
pkgs.wofi pkgs.wofi

View File

@ -9,6 +9,7 @@
../wallpaper-changer/swww-wallpaper-changer ../wallpaper-changer/swww-wallpaper-changer
../common ../common
../waybar.nix ../waybar.nix
../mako.nix
]; ];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
@ -21,9 +22,12 @@
"systemctl --user start hyprland-session.target" "systemctl --user start hyprland-session.target"
]; ];
}; };
extraConfig = let extraConfig =
monitor = "${toString (builtins.map (m: "monitor=${ m.name },${ toString( m.width ) }x${ toString( m.height ) }@${ toString( m.refreshRate ) },${ toString( m.x ) }x${ toString( m.y ) },${ toString( m.scale ) }\n") config.monitors)}"; let
in '' monitor = "${toString (builtins.map (m: "monitor=${ m.name },${ toString( m.width ) }x${ toString( m.height ) }@${ toString( m.refreshRate ) },${ toString( m.x ) }x${ toString( m.y ) },${ toString( m.scale ) }\n") config.monitors)}";
active = "rgba(${config.colorScheme.colors.base08}ee)";
inactive = "rgba(${config.colorScheme.colors.base0C}ee)";
in ''
${monitor} ${monitor}
$terminal = alacritty $terminal = alacritty
@ -51,8 +55,8 @@
gaps_in = 10 gaps_in = 10
gaps_out = 10 gaps_out = 10
border_size = 2 border_size = 2
col.active_border = rgba(22ff00ee) col.active_border = ${active}
col.inactive_border = rgba(aecbb4ee) col.inactive_border = ${inactive}
layout = dwindle layout = dwindle
allow_tearing = false allow_tearing = false
} }

View File

@ -0,0 +1,12 @@
{ pkgs, config, ... }:
{
services.mako = {
enable = true;
backgroundColor = "#${config.colorScheme.colors.base00}";
borderColor = "#${config.colorScheme.colors.base0D}";
borderRadius = 5;
borderSize = 2;
textColor = "#${config.colorScheme.colors.base05}";
layer = "overlay";
};
}

View File

@ -2,6 +2,7 @@
pkgs, pkgs,
config, config,
lib, lib,
inputs,
... ...
}: { }: {
imports = [ imports = [
@ -18,6 +19,8 @@
]; ];
colorScheme = inputs.nix-colors.colorSchemes.kanagawa;
monitors = [ monitors = [
{ {
name = "DP-1"; name = "DP-1";