first commit
This commit is contained in:
commit
780ddcda1c
37 changed files with 981 additions and 0 deletions
15
home/modules/bspwm.nix
Normal file
15
home/modules/bspwm.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
xsession.windowManager.bspwm = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
focus_follows_pointer = true;
|
||||
pointer_follows_focus = true;
|
||||
pointer_follows_monitor = true;
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
feh --bg-fill "/home/benag/.nix-config/assets/pictures/bocchi_wallpaper.png"
|
||||
'';
|
||||
};
|
||||
}
|
||||
62
home/modules/create-project/create-project.nix
Normal file
62
home/modules/create-project/create-project.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = [
|
||||
(pkgs.writeScriptBin "create-project"
|
||||
''
|
||||
#!${pkgs.nushell}/bin/nu
|
||||
|
||||
def main [
|
||||
type?: string
|
||||
name?: string
|
||||
--local (-l)
|
||||
] {
|
||||
|
||||
if $name == null or $type == null {
|
||||
print "Usage: create-project <name> <type> [Options: -l]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($name | str contains "/") or ($name | str contains ".") {
|
||||
print "This is not a valid name for a project"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($type | str contains "/") or ($type | str contains ".") {
|
||||
print "This is not a valid project type"
|
||||
exit 1
|
||||
}
|
||||
|
||||
mkdir $name
|
||||
cd $name
|
||||
|
||||
if ($"~/.nix-config/home/modules/create-project/project-blueprints/($type)" | path expand | ls $in | length) > 0 {
|
||||
glob $"~/.nix-config/home/modules/create-project/project-blueprints/($type)/*" | each { |file| cp $file . }
|
||||
}
|
||||
|
||||
if ($"./init.sh" | path type) == "file" {
|
||||
bash $"./init.sh" $name
|
||||
rm "init.sh"
|
||||
}
|
||||
|
||||
echo "use flake" | save .envrc
|
||||
direnv allow
|
||||
|
||||
git init
|
||||
git add .
|
||||
git commit -m "Project setup"
|
||||
|
||||
if $local {
|
||||
print "You are all done"
|
||||
exit 0
|
||||
}
|
||||
|
||||
${pkgs.tea}/bin/tea repos create --name $name
|
||||
git remote add origin $"https://git.stribrny.org/ben_ag/($name).git"
|
||||
git push -u origin main
|
||||
|
||||
print "You are all done"
|
||||
exit 0
|
||||
|
||||
}
|
||||
'')
|
||||
];
|
||||
}
|
||||
1
home/modules/create-project/project-blueprints/rust/.gitignore
vendored
Normal file
1
home/modules/create-project/project-blueprints/rust/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
target
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
description = "My rust development shell";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {nixpkgs, ...} @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
overlays = [(import inputs.rust-overlay)];
|
||||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
};
|
||||
in {
|
||||
devShells."${system}" = {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
gcc
|
||||
gnumake
|
||||
rust-bin.stable.latest.default
|
||||
evcxr
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
nix develop . --command bash -c "cargo new $1"
|
||||
|
||||
cp -r "$1"/* .
|
||||
rm -fr "$1"
|
||||
88
home/modules/fastfetch.nix
Normal file
88
home/modules/fastfetch.nix
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
programs.fastfetch = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
logo = {
|
||||
source = "/home/benag/.nix-config/assets/bocchi/bocchi.txt";
|
||||
padding = {
|
||||
top = 1;
|
||||
left = 1;
|
||||
};
|
||||
};
|
||||
|
||||
display = {
|
||||
separator = " -> ";
|
||||
};
|
||||
|
||||
modules = [
|
||||
"break"
|
||||
{
|
||||
type = "custom";
|
||||
format = "┌──────────────────────Hardware──────────────────────┐";
|
||||
}
|
||||
{
|
||||
type = "title";
|
||||
key = " PC";
|
||||
keyColor = "green";
|
||||
}
|
||||
{
|
||||
type = "disk";
|
||||
key = "│ ├";
|
||||
device = "/dev/sdb";
|
||||
keyColor = "green";
|
||||
}
|
||||
|
||||
{
|
||||
type = "cpu";
|
||||
key = "│ ├";
|
||||
keyColor = "green";
|
||||
}
|
||||
{
|
||||
type = "gpu";
|
||||
key = "│ ├";
|
||||
keyColor = "green";
|
||||
}
|
||||
{
|
||||
type = "memory";
|
||||
key = "└ └";
|
||||
keyColor = "green";
|
||||
}
|
||||
{
|
||||
type = "custom";
|
||||
format = "└────────────────────────────────────────────────────┘";
|
||||
}
|
||||
"break"
|
||||
{
|
||||
type = "custom";
|
||||
format = "┌──────────────────────Software──────────────────────┐";
|
||||
}
|
||||
{
|
||||
type = "os";
|
||||
key = " OS";
|
||||
keyColor = "yellow";
|
||||
}
|
||||
{
|
||||
type = "kernel";
|
||||
key = "│ ├";
|
||||
keyColor = "yellow";
|
||||
}
|
||||
{
|
||||
type = "packages";
|
||||
key = "│ ├";
|
||||
keyColor = "yellow";
|
||||
}
|
||||
{
|
||||
type = "shell";
|
||||
key = "└ └";
|
||||
keyColor = "yellow";
|
||||
}
|
||||
|
||||
{
|
||||
type = "custom";
|
||||
format = "└────────────────────────────────────────────────────┘";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
13
home/modules/git.nix
Normal file
13
home/modules/git.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{pkgs, ...}: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitFull;
|
||||
settings = {
|
||||
user.name = "benstrb";
|
||||
user.email = "ben.stribrny@gmail.com";
|
||||
init.defaultBranch = "main";
|
||||
github.user = "benstrb";
|
||||
credential.helper = "store";
|
||||
};
|
||||
};
|
||||
}
|
||||
9
home/modules/kitty.nix
Normal file
9
home/modules/kitty.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
background_opacity = 0.75;
|
||||
};
|
||||
};
|
||||
}
|
||||
154
home/modules/nvf.nix
Normal file
154
home/modules/nvf.nix
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
inputs.nvf.homeManagerModules.default
|
||||
];
|
||||
|
||||
programs.nvf = {
|
||||
enable = true;
|
||||
enableManpages = true;
|
||||
|
||||
settings.vim = {
|
||||
theme = {
|
||||
enable = true;
|
||||
transparent = true;
|
||||
|
||||
name = "catppuccin";
|
||||
style = "mocha";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
null-ls.enable = false;
|
||||
|
||||
inlayHints.enable = true;
|
||||
formatOnSave = true;
|
||||
lspkind.enable = true;
|
||||
lspsaga.enable = true;
|
||||
trouble.enable = true;
|
||||
};
|
||||
|
||||
debugger = {
|
||||
nvim-dap = {
|
||||
enable = true;
|
||||
ui.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
options = {
|
||||
tabstop = 2;
|
||||
expandtab = false;
|
||||
autoindent = true;
|
||||
shiftwidth = 2;
|
||||
};
|
||||
|
||||
clipboard = {
|
||||
enable = true;
|
||||
registers = "unnamedplus";
|
||||
providers = {
|
||||
xclip = {
|
||||
enable = true;
|
||||
package = pkgs.xclip;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
languages = {
|
||||
enableFormat = true;
|
||||
enableTreesitter = false;
|
||||
enableExtraDiagnostics = true;
|
||||
|
||||
nix.enable = true;
|
||||
markdown.enable = true;
|
||||
|
||||
nu.enable = true;
|
||||
bash.enable = true;
|
||||
|
||||
css.enable = true;
|
||||
html = {
|
||||
enable = true;
|
||||
lsp.servers = [
|
||||
"emmet-ls"
|
||||
"superhtml"
|
||||
];
|
||||
};
|
||||
|
||||
python.enable = true;
|
||||
|
||||
sql.enable = true;
|
||||
ts.enable = true;
|
||||
zig.enable = true;
|
||||
csharp.enable = true;
|
||||
rust = {
|
||||
enable = true;
|
||||
extensions.crates-nvim.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
visuals = {
|
||||
nvim-web-devicons.enable = true;
|
||||
nvim-cursorline.enable = true;
|
||||
cinnamon-nvim.enable = true;
|
||||
fidget-nvim.enable = true;
|
||||
|
||||
highlight-undo.enable = true;
|
||||
indent-blankline.enable = true;
|
||||
};
|
||||
|
||||
statusline = {
|
||||
lualine = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
autopairs.nvim-autopairs.enable = true;
|
||||
|
||||
autocomplete = {
|
||||
nvim-cmp.enable = true;
|
||||
blink-cmp.enable = false;
|
||||
};
|
||||
|
||||
snippets.luasnip.enable = true;
|
||||
|
||||
telescope.enable = true;
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
gitsigns.enable = true;
|
||||
gitsigns.codeActions.enable = false;
|
||||
};
|
||||
|
||||
dashboard.alpha.enable = true;
|
||||
|
||||
notify.nvim-notify.enable = true;
|
||||
|
||||
projects.project-nvim.enable = true;
|
||||
|
||||
utility = {
|
||||
ccc.enable = true;
|
||||
diffview-nvim.enable = true;
|
||||
icon-picker.enable = true;
|
||||
surround.enable = true;
|
||||
|
||||
motion = {
|
||||
hop.enable = true;
|
||||
leap.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
comments.comment-nvim.enable = true;
|
||||
|
||||
ui = {
|
||||
noice.enable = true;
|
||||
colorizer.enable = true;
|
||||
illuminate.enable = true;
|
||||
|
||||
fastaction.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
7
home/modules/picom.nix
Normal file
7
home/modules/picom.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
services.picom = {
|
||||
enable = true;
|
||||
|
||||
backend = "glx";
|
||||
};
|
||||
}
|
||||
111
home/modules/shells.nix
Normal file
111
home/modules/shells.nix
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
bat
|
||||
fzf
|
||||
fd
|
||||
eza
|
||||
most
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = "neovim";
|
||||
PAGER = "most";
|
||||
MANPAGER = "most";
|
||||
MANROFFOPT = "-c";
|
||||
};
|
||||
|
||||
programs = {
|
||||
bash.enable = true;
|
||||
fzf.enable = true;
|
||||
eza.enable = true;
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
silent = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
nushell = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
show_banner = false;
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
cat = "bat -p -P";
|
||||
|
||||
system = "nvim /home/benag/.nix-config/flake.nix";
|
||||
home = "nvim /home/benag/.nix-config/home/home.nix";
|
||||
config = "nvim /home/benag/.nix-config/configuration/main/configuration.nix";
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
if "IN_NIX_SHELL" in $env == false {
|
||||
fastfetch
|
||||
}
|
||||
|
||||
def c [] {
|
||||
clear
|
||||
fastfetch
|
||||
}
|
||||
|
||||
def rebuild [message?: string] {
|
||||
cd /home/benag/.nix-config
|
||||
let commit_message = if $message != null {$message} else {"non important commit"}
|
||||
|
||||
try {
|
||||
git pull
|
||||
git add .
|
||||
git commit -m $commit_message
|
||||
git push
|
||||
}
|
||||
|
||||
sudo nixos-rebuild switch --flake .
|
||||
}
|
||||
|
||||
def --env fzf-cd [] {
|
||||
let dir = (fd -H -t d -L . | fzf --reverse --height 40% --border rounded --preview=("eza --color=always --group-directories-first --icons --long {}") --preview-window=border-left)
|
||||
|
||||
if $dir != null and $dir != "" {
|
||||
cd $dir
|
||||
}
|
||||
}
|
||||
|
||||
def --env fzf-nvim [] {
|
||||
let file = (fd -H -t f -L . | fzf --reverse --height 40% --border rounded --preview=("bat -p -P --color always {}") --preview-window=border-left)
|
||||
|
||||
if $file != null and $file != "" {
|
||||
nvim $file
|
||||
}
|
||||
}
|
||||
|
||||
$env.config.keybindings = ($env.config.keybindings | append {
|
||||
name: "fzf-cd"
|
||||
modifier: "control"
|
||||
keycode: "char_f"
|
||||
mode: "emacs"
|
||||
event: [
|
||||
{
|
||||
send: "executehostcommand"
|
||||
cmd: 'fzf-cd'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
$env.config.keybindings = ($env.config.keybindings | append {
|
||||
name: "fzf-nvim"
|
||||
modifier: "control"
|
||||
keycode: "char_e"
|
||||
mode: "emacs"
|
||||
event: [
|
||||
{
|
||||
send: "executehostcommand"
|
||||
cmd: 'fzf-nvim'
|
||||
}
|
||||
]
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
16
home/modules/sxhkd.nix
Normal file
16
home/modules/sxhkd.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
services.sxhkd = {
|
||||
enable = true;
|
||||
|
||||
keybindings = {
|
||||
"super + q" = "bspc node -c";
|
||||
"super + f" = "bspc node -t fullscreen";
|
||||
"super + t" = "bspc node -t tiled";
|
||||
|
||||
"super + Return" = "kitty";
|
||||
"super + b" = "firefox";
|
||||
"super + d" = "discord";
|
||||
"super + a" = "rofi -show drun";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue