This commit is contained in:
coast 2025-10-04 17:47:25 +03:30
parent 9b34335777
commit ac71ee2529
12 changed files with 193 additions and 92 deletions

View file

@ -1,4 +1,4 @@
font=UbuntuMono:size=14
font=JetBrains Mono NF:size=14
pad=8x8
[colors]

View file

@ -25,3 +25,12 @@ if executable('nil')
\ 'whitelist': ['nix'],
\ })
endif
if executable('clangd')
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'clangd',
\ 'cmd': {server_info-> ['clangd']},
\ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],
\ 'root_markers': ['compile_commands.json', 'Makefile', '.git'],
\ })
endif

View file

@ -14,5 +14,7 @@ CONFIG = {
"lilydjwg/colorizer",
"prabirshrestha/vim-lsp",
"mattn/vim-lsp-settings",
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-nvim-lsp",
]
}

View file

@ -5,14 +5,11 @@ from libqtile.utils import guess_terminal
from libqtile.bar import Bar, Gap
import subprocess
#run commands on startup
subprocess.run("/home/coast/.local/src/local/bin/start_qtile.sh")
#define terminal and super key
mod = "mod4"
terminal = "footclient"
#keybinds
keys = [
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "j", lazy.layout.right(), desc="Move focus to right"),
@ -44,8 +41,8 @@ keys = [
Key([mod], "space", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"),
Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "shift"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
Key([mod], "r", lazy.spawn("wmenu-run -f \"Ubuntu 14\" -N #000000"), desc="Spawn a command using wmenu"),
Key([mod], "Print", lazy.spawn("/home/coast/.local/src/local/bin/screenie-wl")),
Key([mod], "r", lazy.spawn("wmenu-run -f \"JetBrainsMono NF 12\" -N #000000 -b"), desc="Spawn a command using wmenu"),
Key([mod], "Print", lazy.spawn("/home/coast/.local/src/local/bin/screenie-wlr")),
]
for vt in range(1, 8):
@ -77,30 +74,25 @@ for i in groups:
)
layouts = [
layout.MonadTall(
font = "Ubuntu", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]),
layout.MonadTall(font = "JetBrains Mono Nerd Font", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]),
# Try more layouts by unleashing below layouts.
# layout.Stack(num_stacks=2),
# layout.Bsp(),
# layout.Matrix(),
layout.MonadWide(font = "Ubuntu", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]),
# layout.RatioTile(),
layout.MonadWide(font = "JetBrains Mono Nerd Font", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]),
layout.RatioTile(font = "JetBrains Mono Nerd Font", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]),
# layout.Tile(),
# layout.TreeTab(),
# layout.VerticalTile(),
# layout.Zoomy(),
]
widget_defaults = dict(
font="sans",
fontsize=12,
padding=3,
)
widget_defaults = dict(font="sans", fontsize=12, padding=3)
extension_defaults = widget_defaults.copy()
screens = [
Screen(
top=bar.Bar(
bottom=bar.Bar(
[
widget.GroupBox(font = "JetBrains Mono Nerd Font", margin_y = 5, margin_x = 5, padding_y = 0, padding_x = 2, borderwidth = 3, rounded = False, highlight_method = "line", inactive = ["#ffffff"], ),
widget.TextBox(text = '|', font = "JetBrains Mono Nerd Font", padding = 2,),
@ -114,8 +106,9 @@ screens = [
},
name_transform=lambda name: name.upper()),
widget.StatusNotifier(),
widget.Clock(format="%I:%M %p"),
widget.QuickExit(),
widget.TextBox(text = '|', font = "JetBrains Mono Nerd Font", padding = 2,),
widget.Clock(format="%I:%M %p", font = "JetBrains Mono Nerd Font", fontsize = 14, padding = 2),
widget.QuickExit(font = "JetBrains Mono Nerd Font", padding = 2, rounded = False, fontsize = 14),
],
24,
),

View file

@ -1,37 +1,26 @@
{ config, lib, pkgs, ... }: let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz";
in {
imports =
[
./hardware-configuration.nix
(import "${home-manager}/nixos")
];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
backupFileExtension = "backup";
users.coast = import ./home.nix;
};
{ config, pkgs, ... }: {
imports = [ ./hardware-configuration.nix ];
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
kernelModules = ["kvm-intel"];
};
networking.hostName = "core";
networking.enableIPv6 = false;
time.timeZone = "Asia/Tehran";
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
services = {
xserver = {
enable = true;
videoDrivers = ["nvidia"];
windowManager.qtile.enable = true;
};
flatpak.enable = true;
displayManager.ly.enable = true;
blueman.enable = true;
printing.enable = false;
jellyfin.enable = true;
@ -52,36 +41,19 @@ in {
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
virtualisation.virtualbox.host.enable = true;
users.extraGroups.vboxusers.members = [ "coast" ];
virtualisation.virtualbox.host.enableExtensionPack = true;
security.sudo.enable = false;
security.doas = {
enable = true;
extraRules = [{ users = [ "coast" ]; keepEnv = true; persist = true; }];
};
environment.systemPackages = with pkgs; [
neovim
wget
adwaita-icon-theme
qemu
nil
(pkgs.runCommand "vim-wrapper" { } ''
mkdir -p $out/bin
ln -s ${pkgs.neovim}/bin/nvim $out/bin/vim
'')
];
programs = {
zsh.enable = true;
zsh.syntaxHighlighting.enable = true;
foot.enable = true;
nano.enable = false;
nekoray.enable = true;
nekoray.tunMode.enable = true;
nano.enable = false;
sway.enable = true;
};
fonts.packages = with pkgs; [
@ -89,6 +61,7 @@ in {
ubuntu_font_family
nerd-fonts._0xproto
nerd-fonts.droid-sans-mono
nerd-fonts.jetbrains-mono
];
hardware.graphics.enable = true;
@ -100,6 +73,7 @@ in {
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
services.openssh.enable = true;
system.stateVersion = "25.05";
}

66
etc/nixos/flake.lock generated Normal file
View file

@ -0,0 +1,66 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1758463745,
"narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1759281824,
"narHash": "sha256-FIBE1qXv9TKvSNwst6FumyHwCRH3BlWDpfsnqRDCll0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5b5be50345d4113d04ba58c444348849f5585b4a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1759381078,
"narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}
}
},
"root": "root",
"version": 7
}

41
etc/nixos/flake.nix Normal file
View file

@ -0,0 +1,41 @@
{
description = "Flakes once again";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-25.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { nixpkgs, nixpkgs-unstable, home-manager, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
pkgs-unstable = import nixpkgs-unstable { inherit system; };
in {
nixosConfigurations.core = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.coast = import ./home.nix;
home-manager.backupFileExtension = "backup";
}
{
environment.systemPackages = with pkgs; [
git
(lib.hiPrio pkgs.uutils-coreutils-noprefix)
(pkgs.runCommand "vim-wrapper" { } ''
mkdir -p $out/bin
ln -s ${pkgs.neovim}/bin/nvim $out/bin/vim
'')
pkgs-unstable.firefox
];
}
];
};
};
}

View file

@ -0,0 +1,33 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/8a574ece-d362-484c-b72a-bd17ce935986";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,35 +1,26 @@
{ config, pkgs, ... }: let
dotDir = "${config.home.homeDirectory}/.local/src/config/";
mkSymlink = path: config.lib.file.mkOutOfStoreSymlink path;
mkSl = path: config.lib.file.mkOutOfStoreSymlink path;
configs = {
sway = "sway";
kitty = "kitty";
foot = "foot";
qtile = "qtile";
mako = "mako";
nvim = "nvim";
};
utilPkgs = with pkgs; [
alsa-utils nix-search-cli neofetch dysk nsxiv tree wl-clipboard appimage-run libnotify grim slurp yazi mate.caja htop
];
windowManagerPkgs = with pkgs; [
mako nsxiv autotiling nwg-look
];
devPkgs = with pkgs; [
gcc ruby_3_4 git nodejs
];
utilPkgs = with pkgs; [ alsa-utils nix-search-cli neofetch dysk nsxiv tree wl-clipboard appimage-run libnotify grim slurp yazi mate.caja htop nixpkgs-fmt ];
windowManagerPkgs = with pkgs; [ wmenu mako nsxiv autotiling nwg-look xorg.xkill ];
devPkgs = with pkgs; [ emacs-gtk gcc clang-tools ruby_3_4 nodejs ];
otherPkgs = with pkgs; [ mpv vesktop wlr-randr swaybg ];
in {
home.username = "coast";
home.homeDirectory = "/home/coast";
home.stateVersion = "25.05";
xdg.configFile = builtins.mapAttrs (name: subpath: {
source = mkSymlink "${dotDir}/${subpath}";
recursive = true;
}) configs;
xdg.configFile = builtins.mapAttrs (name: subpath: { source = mkSl "${dotDir}/${subpath}"; recursive = true; }) configs;
home.packages = windowManagerPkgs ++ devPkgs ++ utilPkgs;
programs.firefox.enable = true;
programs.vesktop.enable = true;
home.packages = windowManagerPkgs ++ devPkgs ++ utilPkgs ++ otherPkgs;
programs.zsh = {
enable = true;
@ -70,11 +61,12 @@ in {
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=12"
autoload -U colors && colors && setopt prompt_subst
PROMPT="[%n@%m %~]$ "
PROMPT="[%n@%m %~]%% "
export LIBCLANG_PATH=/usr/lib/llvm/20/lib64
export PATH=$PATH:/home/coast/.spicetify
source ~/.local/src/zsh.d/zsh-autosuggestions.zsh
export PATH="/usr/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
'';
};
}

View file

@ -1,19 +0,0 @@
#!/usr/bin/env zsh
DIR=~/Pictures/Screenshots
mkdir -p "$DIR"
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
FILENAME="screenshot_${TIMESTAMP}.png"
FILEPATH="${DIR}/${FILENAME}"
REGION=$(slurp)
if [[ -z "$REGION" ]]; then
notify-send "Screenshot canceled" "No region selected"
exit 1
fi
grim -g "$REGION" "$FILEPATH"
wl-copy < "$FILEPATH"
notify-send "Screenshot saved" "$FILEPATH"
echo "$FILEPATH"

9
local/bin/screenie-wlr Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
SAVEDIR="$HOME/Pictures/Screenshots"
mkdir -p "$SAVEDIR"
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
SCREENSHOT_PATH="$SAVEDIR/screenshot_$TIMESTAMP.png"
grim -g "$(slurp)" "$SCREENSHOT_PATH"
wl-copy < "$SCREENSHOT_PATH"
echo "Screenshot saved to $SCREENSHOT_PATH"
notify-send -i "$SCREENSHOT_PATH" "Saved to $SCREENSHOT_PATH and copied to clipboard."

View file

@ -1,4 +1,5 @@
#!/bin/sh
wlr-randr --output eDP-1 --off &
swaybg -i ~/Pictures/nature4.png &
foot -s &
sleep 1 &
swaybg -i ~/Pictures/nature4.png &