mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-11 09:44:08 -05:00
work
This commit is contained in:
parent
2091fb1fdc
commit
79e25fcdc8
5 changed files with 142 additions and 2 deletions
|
|
@ -13,8 +13,7 @@
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
];
|
];
|
||||||
# Extend lib with lib.custom
|
# Extend lib with lib.custom
|
||||||
# make sure to inherit this once we do lib extensions
|
lib = nixpkgs.lib.extend (self: super: {custom = import ./lib {inherit (nixpkgs) lib;};});
|
||||||
#lib = nixpkgs.lib.extend (self: super: {custom = import ./lib {inherit (nixpkgs) lib;};});
|
|
||||||
in {
|
in {
|
||||||
# Overlays
|
# Overlays
|
||||||
# overlays = import ./overlays {inherit inputs;};
|
# overlays = import ./overlays {inherit inputs;};
|
||||||
|
|
|
||||||
3
hosts/common/core/default.nix
Normal file
3
hosts/common/core/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{lib, ...}: {
|
||||||
|
imports = lib.custom.scanPaths ./.;
|
||||||
|
}
|
||||||
89
hosts/common/core/shell.nix
Normal file
89
hosts/common/core/shell.nix
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
config = lib.mkIf config.software.usershell.enable {
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
autosuggestions = {
|
||||||
|
enable = true;
|
||||||
|
async = true;
|
||||||
|
};
|
||||||
|
syntaxHighlighting = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
shellAliases = {
|
||||||
|
lah = "ls -lah";
|
||||||
|
set-nixpkgs-upstream = "git remote add upstream https://github.com/NixOS/nixpkgs.git";
|
||||||
|
nup = "sudo nixos-rebuild switch --flake .";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.starship = let
|
||||||
|
raisin_black = "#262932";
|
||||||
|
blood_red = "#710000";
|
||||||
|
rich_lemon = "#FDF500";
|
||||||
|
keppel = "#1AC5B0";
|
||||||
|
electric_blue = "#36EBF3";
|
||||||
|
blushing_purple = "#9370DB";
|
||||||
|
frostbite = "#E455AE";
|
||||||
|
steel_pink = "#CB1DCD";
|
||||||
|
pale_silver = "#D1C5C0";
|
||||||
|
in {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
format = "[ ](${rich_lemon})[ CrOS](bg:${rich_lemon} fg:${raisin_black})$username$hostname[ ](fg:${rich_lemon} bg:${blushing_purple})$directory[ ](fg:${blushing_purple} bg:${frostbite})$git_branch$git_status[ ](fg:${frostbite} bg:${steel_pink})$nix_shell[ ](${steel_pink})";
|
||||||
|
right_format = "[ ](${rich_lemon})$time[ ](${rich_lemon})";
|
||||||
|
|
||||||
|
# Left Modules
|
||||||
|
username = {
|
||||||
|
disabled = false;
|
||||||
|
format = "[ $user]($style)";
|
||||||
|
style_user = "fg:${keppel} bg:${rich_lemon}";
|
||||||
|
style_root = "fg:${blood_red} bg:${rich_lemon}";
|
||||||
|
};
|
||||||
|
hostname = {
|
||||||
|
disabled = false;
|
||||||
|
format = "[@$hostname ]($style)";
|
||||||
|
style = "fg:${keppel} bg:${rich_lemon}";
|
||||||
|
ssh_only = false;
|
||||||
|
ssh_symbol = "";
|
||||||
|
};
|
||||||
|
directory = {
|
||||||
|
disabled = false;
|
||||||
|
format = "[ $path ]($style)";
|
||||||
|
style = "bg:${blushing_purple} fg:${raisin_black}";
|
||||||
|
truncation_length = 3;
|
||||||
|
truncation_symbol = "…/";
|
||||||
|
};
|
||||||
|
git_branch = {
|
||||||
|
disabled = false;
|
||||||
|
format = "[ $symbol $branch ]($style)";
|
||||||
|
symbol = "";
|
||||||
|
style = "fg:${raisin_black} bg:${frostbite}";
|
||||||
|
};
|
||||||
|
git_status = {
|
||||||
|
disabled = false;
|
||||||
|
format = "[$all_status$ahead_behind]($style)";
|
||||||
|
style = "fg:${raisin_black} bg:${frostbite}";
|
||||||
|
};
|
||||||
|
nix_shell = {
|
||||||
|
disabled = false;
|
||||||
|
format = "[$symbol $name]($style)";
|
||||||
|
style = "bg:${steel_pink} fg:${electric_blue}";
|
||||||
|
symbol = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Right Modules
|
||||||
|
time = {
|
||||||
|
disabled = false;
|
||||||
|
format = "[$time]($style)";
|
||||||
|
style = "fg:${raisin_black} bg:${rich_lemon}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
users.defaultUserShell = pkgs.zsh;
|
||||||
|
};
|
||||||
|
}
|
||||||
31
hosts/common/optional/keyd.nix
Normal file
31
hosts/common/optional/keyd.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
services.keyd = {
|
||||||
|
enable = true;
|
||||||
|
keyboards.default = {
|
||||||
|
ids = ["*"];
|
||||||
|
settings = {
|
||||||
|
main = {
|
||||||
|
capslock = "layer(standardL2)";
|
||||||
|
};
|
||||||
|
standardL2 = {
|
||||||
|
w = "up";
|
||||||
|
s = "down";
|
||||||
|
a = "left";
|
||||||
|
d = "right";
|
||||||
|
|
||||||
|
b = "C-b";
|
||||||
|
|
||||||
|
space = "playpause";
|
||||||
|
"." = "nextsong";
|
||||||
|
"," = "previoussong";
|
||||||
|
|
||||||
|
"[" = "delete";
|
||||||
|
"]" = "end";
|
||||||
|
escape = "~";
|
||||||
|
|
||||||
|
home = "end";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
18
lib/default.nix
Normal file
18
lib/default.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
# FIXME(lib.custom): Add some stuff from hmajid2301/dotfiles/lib/module/default.nix, as simplifies option declaration
|
||||||
|
{lib, ...}: {
|
||||||
|
# use path relative to the root of the project
|
||||||
|
relativeToRoot = lib.path.append ../.;
|
||||||
|
scanPaths = path:
|
||||||
|
builtins.map (f: (path + "/${f}")) (
|
||||||
|
builtins.attrNames (
|
||||||
|
lib.attrsets.filterAttrs (
|
||||||
|
path: _type:
|
||||||
|
(_type == "directory") # include directories
|
||||||
|
|| (
|
||||||
|
(path != "default.nix") # ignore default.nix
|
||||||
|
&& (lib.strings.hasSuffix ".nix" path) # include .nix files
|
||||||
|
)
|
||||||
|
) (builtins.readDir path)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue