nya
This commit is contained in:
parent
dbef8a31b2
commit
07a07ab45e
8 changed files with 171 additions and 160 deletions
|
@ -56,36 +56,3 @@ function fish_prompt
|
|||
|
||||
echo -n -s $prompt_host $cwd $pwd $normal $prompt_status $delim
|
||||
end
|
||||
|
||||
function fish_right_prompt
|
||||
set -g __fish_git_prompt_showdirtystate 1
|
||||
set -g __fish_git_prompt_showuntrackedfiles 1
|
||||
set -g __fish_git_prompt_showupstream informative
|
||||
set -g __fish_git_prompt_showcolorhints 1
|
||||
set -g __fish_git_prompt_use_informative_chars 1
|
||||
# Unfortunately this only works if we have a sensible locale
|
||||
string match -qi "*.utf-8" -- $LANG $LC_CTYPE $LC_ALL
|
||||
and set -g __fish_git_prompt_char_dirtystate \U1F4a9
|
||||
set -g __fish_git_prompt_char_untrackedfiles "?"
|
||||
|
||||
# The git prompt's default format is ' (%s)'.
|
||||
# We don't want the leading space.
|
||||
set -l vcs (fish_vcs_prompt '(%s)' 2>/dev/null)
|
||||
|
||||
set -l d (set_color brgrey)(date "+%R")(set_color normal)
|
||||
|
||||
set -l duration "$cmd_duration$CMD_DURATION"
|
||||
if test $duration -gt 100
|
||||
set duration (math $duration / 1000)s
|
||||
else
|
||||
set duration
|
||||
end
|
||||
|
||||
set -q VIRTUAL_ENV_DISABLE_PROMPT
|
||||
or set -g VIRTUAL_ENV_DISABLE_PROMPT true
|
||||
set -q VIRTUAL_ENV
|
||||
and set -l venv (string replace -r '.*/' '' -- "$VIRTUAL_ENV")
|
||||
|
||||
set_color normal
|
||||
string join " " -- $venv $duration $vcs $d
|
||||
end
|
32
files/config/fish/functions/fish_right_prompt.fish
Normal file
32
files/config/fish/functions/fish_right_prompt.fish
Normal file
|
@ -0,0 +1,32 @@
|
|||
function fish_right_prompt
|
||||
set -g __fish_git_prompt_showdirtystate 1
|
||||
set -g __fish_git_prompt_showuntrackedfiles 1
|
||||
set -g __fish_git_prompt_showupstream informative
|
||||
set -g __fish_git_prompt_showcolorhints 1
|
||||
set -g __fish_git_prompt_use_informative_chars 1
|
||||
# Unfortunately this only works if we have a sensible locale
|
||||
string match -qi "*.utf-8" -- $LANG $LC_CTYPE $LC_ALL
|
||||
and set -g __fish_git_prompt_char_dirtystate \U1F4a9
|
||||
set -g __fish_git_prompt_char_untrackedfiles "?"
|
||||
|
||||
# The git prompt's default format is ' (%s)'.
|
||||
# We don't want the leading space.
|
||||
set -l vcs (fish_vcs_prompt '(%s)' 2>/dev/null)
|
||||
|
||||
set -l d (set_color brgrey)(date "+%R")(set_color normal)
|
||||
|
||||
set -l duration "$cmd_duration$CMD_DURATION"
|
||||
if test $duration -gt 100
|
||||
set duration (math $duration / 1000)s
|
||||
else
|
||||
set duration
|
||||
end
|
||||
|
||||
set -q VIRTUAL_ENV_DISABLE_PROMPT
|
||||
or set -g VIRTUAL_ENV_DISABLE_PROMPT true
|
||||
set -q VIRTUAL_ENV
|
||||
and set -l venv (string replace -r '.*/' '' -- "$VIRTUAL_ENV")
|
||||
|
||||
set_color normal
|
||||
string join " " -- $venv $duration $vcs $d
|
||||
end
|
38
flake.nix
38
flake.nix
|
@ -8,15 +8,14 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
home-manager,
|
||||
...
|
||||
}: let
|
||||
system = "x86_64-linux";
|
||||
in {
|
||||
outputs =
|
||||
inputs @ { self
|
||||
, nixpkgs
|
||||
, nixpkgs-unstable
|
||||
, home-manager
|
||||
, ...
|
||||
}:
|
||||
{
|
||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
||||
colmena = {
|
||||
meta = {
|
||||
|
@ -26,11 +25,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
bengal = {
|
||||
name,
|
||||
nodes,
|
||||
pkgs,
|
||||
...
|
||||
bengal =
|
||||
{ name
|
||||
, nodes
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
./hosts/${name}/configuration.nix
|
||||
|
@ -44,11 +43,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
maine-coon = {
|
||||
name,
|
||||
nodes,
|
||||
pkgs,
|
||||
...
|
||||
maine-coon =
|
||||
{ name
|
||||
, nodes
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
./hosts/${name}/configuration.nix
|
||||
|
@ -62,7 +61,6 @@
|
|||
};
|
||||
};
|
||||
nixosConfigurations.test = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
./hosts/test-vm/configuration.nix
|
||||
(import "${home-manager}/nixos")
|
||||
|
|
10
misc/module-template.nix
Normal file
10
misc/module-template.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
cfg = config.cherrykitten;
|
||||
in
|
||||
{
|
||||
|
||||
options.cherrykitten = { };
|
||||
|
||||
config = { };
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
cfg = config.cherrykitten.common;
|
||||
in {
|
||||
imports = [
|
||||
../users
|
||||
./users.nix
|
||||
./security.nix
|
||||
./yubikey.nix
|
||||
../graphical
|
||||
|
|
75
modules/common/users.nix
Normal file
75
modules/common/users.nix
Normal file
|
@ -0,0 +1,75 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.cherrykitten;
|
||||
in
|
||||
{
|
||||
|
||||
options.cherrykitten.users = { };
|
||||
|
||||
config = {
|
||||
users.users = {
|
||||
sammy = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "networkmanager" "wheel" "docker" ];
|
||||
shell = pkgs.fish;
|
||||
ignoreShellProgramCheck = true;
|
||||
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZyQSZw+pExsx2RXB+yxbaJGB9mtvudbQ/BP7E1yKvr openpgp:0x6068FEBB" ];
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.sammy = {
|
||||
imports = [ ../nvim ];
|
||||
home.username = "sammy";
|
||||
home.homeDirectory = "/home/sammy";
|
||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
||||
home.packages = with pkgs; [
|
||||
bat
|
||||
lsd
|
||||
gnupg
|
||||
tmux
|
||||
colmena
|
||||
];
|
||||
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "CherryKitten";
|
||||
userEmail = "git@cherrykitten.dev";
|
||||
signing.key = "0xC01A7CBBA617BD5F";
|
||||
signing.signByDefault = true;
|
||||
extraConfig = {
|
||||
init = { defaultBranch = "main"; };
|
||||
core = { editor = "nvim"; };
|
||||
pull.rebase = true;
|
||||
};
|
||||
};
|
||||
|
||||
fish = {
|
||||
enable = true;
|
||||
functions = { };
|
||||
};
|
||||
};
|
||||
|
||||
home.file = {
|
||||
fish_prompt = {
|
||||
source = ../../files/config/fish/functions/fish_prompt.fish;
|
||||
target = ".config/fish/functions/fish_prompt.fish";
|
||||
};
|
||||
fish_right_prompt = {
|
||||
source = ../../files/config/fish/functions/fish_right_prompt.fish;
|
||||
target = ".config/fish/functions/fish_right_prompt.fish";
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
users.users = {
|
||||
sammy = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "networkmanager" "wheel" "docker" ];
|
||||
shell = pkgs.fish;
|
||||
ignoreShellProgramCheck = true;
|
||||
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZyQSZw+pExsx2RXB+yxbaJGB9mtvudbQ/BP7E1yKvr openpgp:0x6068FEBB" ];
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users = {
|
||||
sammy.imports = [ ./sammy.nix ];
|
||||
};
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [../nvim];
|
||||
home.username = "sammy";
|
||||
home.homeDirectory = "/home/sammy";
|
||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
||||
home.packages = with pkgs; [
|
||||
bat
|
||||
lsd
|
||||
gnupg
|
||||
tmux
|
||||
colmena
|
||||
];
|
||||
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "CherryKitten";
|
||||
userEmail = "git@cherrykitten.dev";
|
||||
signing.key = "0xC01A7CBBA617BD5F";
|
||||
signing.signByDefault = true;
|
||||
extraConfig = {
|
||||
init = {defaultBranch = "main";};
|
||||
core = {editor = "nvim";};
|
||||
pull.rebase = true;
|
||||
};
|
||||
};
|
||||
|
||||
fish = {
|
||||
enable = true;
|
||||
functions = {};
|
||||
};
|
||||
};
|
||||
|
||||
home.file = {
|
||||
fish_prompt = {
|
||||
source = ../fish/fish_prompt.fish;
|
||||
target = ".config/fish/functions/fish_prompt.fish";
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue