some formatting
This commit is contained in:
parent
c91faa5aaf
commit
57c3bb3e61
21 changed files with 472 additions and 360 deletions
46
README.md
46
README.md
|
|
@ -2,32 +2,40 @@
|
|||
|
||||
## Overview
|
||||
|
||||
This repository contains my NixOS configuration as a flake. This configuration is designed to provide a reproducible and declarative setup for my system. It includes system configuration, package management, and various other NixOS features.
|
||||
This repository contains my NixOS configuration as a flake. This configuration
|
||||
is designed to provide a reproducible and declarative setup for my system. It
|
||||
includes system configuration, package management, and various other NixOS
|
||||
features.
|
||||
|
||||
### Window Manager
|
||||
- hyrpland
|
||||
- waybar
|
||||
- swaylock
|
||||
- wofi
|
||||
- light
|
||||
- grimshot
|
||||
- mako
|
||||
|
||||
- hyrpland
|
||||
- waybar
|
||||
- swaylock
|
||||
- wofi
|
||||
- light
|
||||
- grimshot
|
||||
- mako
|
||||
|
||||
### Terminal
|
||||
- alacritty
|
||||
- zsh
|
||||
- starship
|
||||
- tmux
|
||||
- neovim(my configuration can be found [here](https://github.com/gwg313/nvim-nix))
|
||||
- eza
|
||||
- ripgrep
|
||||
- fd
|
||||
|
||||
- alacritty
|
||||
- zsh
|
||||
- starship
|
||||
- tmux
|
||||
- neovim(my configuration can be found
|
||||
[here](https://github.com/gwg313/nvim-nix))
|
||||
- eza
|
||||
- ripgrep
|
||||
- fd
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using this NixOS flake configuration, you should have the following prerequisites:
|
||||
Before using this NixOS flake configuration, you should have the following
|
||||
prerequisites:
|
||||
|
||||
- NixOs should be installed on your system.
|
||||
- Familiarity with Nix and NixOS concepts is helpful but not required.
|
||||
- NixOs should be installed on your system.
|
||||
- Familiarity with Nix and NixOS concepts is helpful but not required.
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
outputs,
|
||||
user,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./packages.nix
|
||||
./users.nix
|
||||
|
|
@ -16,12 +17,15 @@
|
|||
#
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
nix.settings.auto-optimise-store = true;
|
||||
nix.optimise.automatic = true;
|
||||
|
||||
nix.settings.trusted-users = ["${user}"];
|
||||
nix.settings.trusted-users = [ "${user}" ];
|
||||
|
||||
# Disable so comma can be installed
|
||||
programs.command-not-found.enable = false;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
ssh_client.enable = lib.mkEnableOption "enable ssh client settings";
|
||||
};
|
||||
|
|
@ -80,7 +81,7 @@
|
|||
|
||||
# display an ASCII art of the server's host key
|
||||
VisualHostKey yes
|
||||
";
|
||||
";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,21 @@
|
|||
inputs,
|
||||
outputs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||
programs.zsh.enable = true;
|
||||
users.users.gwg313 = {
|
||||
isNormalUser = true;
|
||||
description = "Glen Goodwin";
|
||||
extraGroups = ["networkmanager" "wheel" "video" "docker" "audio" "wireshark"];
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
"video"
|
||||
"docker"
|
||||
"audio"
|
||||
"wireshark"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
uid = 1000;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,8 +4,13 @@
|
|||
user,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [./libvirt.nix ./podman.nix ./kubernetes.nix];
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./libvirt.nix
|
||||
./podman.nix
|
||||
./kubernetes.nix
|
||||
];
|
||||
|
||||
libvirt.enable = lib.mkDefault true;
|
||||
podman.enable = lib.mkDefault true;
|
||||
|
|
|
|||
241
flake.nix
241
flake.nix
|
|
@ -54,126 +54,143 @@
|
|||
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
...
|
||||
} @ inputs: let
|
||||
inherit (self) outputs;
|
||||
# Supported systems for your flake packages, shell, etc.
|
||||
systems = [
|
||||
"aarch64-linux"
|
||||
"i686-linux"
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
# This is a function that generates an attribute by calling a function you
|
||||
# pass to it, with each system as an argument
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
user = "gwg313";
|
||||
in {
|
||||
# Your custom packages
|
||||
# Accessible through 'nix build', 'nix shell', etc
|
||||
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
||||
# Formatter for your nix files, available through 'nix fmt'
|
||||
# Other options beside 'alejandra' include 'nixpkgs-fmt'
|
||||
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
inherit (self) outputs;
|
||||
# Supported systems for your flake packages, shell, etc.
|
||||
systems = [
|
||||
"aarch64-linux"
|
||||
"i686-linux"
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
# This is a function that generates an attribute by calling a function you
|
||||
# pass to it, with each system as an argument
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
user = "gwg313";
|
||||
in
|
||||
{
|
||||
# Your custom packages
|
||||
# Accessible through 'nix build', 'nix shell', etc
|
||||
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
||||
# Formatter for your nix files, available through 'nix fmt'
|
||||
# Other options beside 'alejandra' include 'nixpkgs-fmt'
|
||||
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
||||
|
||||
# Your custom packages and modifications, exported as overlays
|
||||
overlays = import ./overlays {inherit inputs;};
|
||||
# Reusable nixos modules you might want to export
|
||||
# These are usually stuff you would upstream into nixpkgs
|
||||
nixosModules = import ./modules/nixos;
|
||||
# Reusable home-manager modules you might want to export
|
||||
# These are usually stuff you would upstream into home-manager
|
||||
homeManagerModules = import ./modules/home-manager;
|
||||
# Your custom packages and modifications, exported as overlays
|
||||
overlays = import ./overlays { inherit inputs; };
|
||||
# Reusable nixos modules you might want to export
|
||||
# These are usually stuff you would upstream into nixpkgs
|
||||
nixosModules = import ./modules/nixos;
|
||||
# Reusable home-manager modules you might want to export
|
||||
# These are usually stuff you would upstream into home-manager
|
||||
homeManagerModules = import ./modules/home-manager;
|
||||
|
||||
devShells = forAllSystems (
|
||||
system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||
buildInputs = with pkgs; [
|
||||
alejandra
|
||||
devShells = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||
buildInputs = with pkgs; [
|
||||
alejandra
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
checks = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixfmt-rfc-style.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = {
|
||||
candlekeep = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit user inputs outputs;
|
||||
};
|
||||
modules = [
|
||||
# > Our main nixos configuration file <
|
||||
./hosts/candlekeep/configuration.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
checks = forAllSystems (
|
||||
system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
alejandra.enable = true;
|
||||
nixosConfigurations = {
|
||||
grymforge = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit user inputs outputs;
|
||||
};
|
||||
modules = [
|
||||
# > Our main nixos configuration file <
|
||||
./hosts/grymforge/configuration.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = {
|
||||
candlekeep = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit user inputs outputs;};
|
||||
modules = [
|
||||
# > Our main nixos configuration file <
|
||||
./hosts/candlekeep/configuration.nix
|
||||
];
|
||||
# Standalone home-manager configuration entrypoint
|
||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||
homeConfigurations = {
|
||||
"gwg313@candlekeep" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/machines/candlekeep.nix
|
||||
inputs.stylix.homeManagerModules.stylix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
"gwg313@grymforge" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/machines/grymforge.nix
|
||||
inputs.stylix.homeManagerModules.stylix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
"gwg313@dorino" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/machines/dorino.nix
|
||||
inputs.stylix.homeManagerModules.stylix
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
grymforge = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit user inputs outputs;};
|
||||
modules = [
|
||||
# > Our main nixos configuration file <
|
||||
./hosts/grymforge/configuration.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Standalone home-manager configuration entrypoint
|
||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||
homeConfigurations = {
|
||||
"gwg313@candlekeep" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/machines/candlekeep.nix
|
||||
inputs.stylix.homeManagerModules.stylix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
"gwg313@grymforge" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/machines/grymforge.nix
|
||||
inputs.stylix.homeManagerModules.stylix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
"gwg313@dorino" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
# > Our main home-manager configuration file <
|
||||
./home-manager/machines/dorino.nix
|
||||
inputs.stylix.homeManagerModules.stylix
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,25 @@
|
|||
# A fast, GPU-accelerated terminal emulator.
|
||||
{pkgs, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
env = {
|
||||
TERM = "xterm-256color";
|
||||
};
|
||||
font = {
|
||||
normal = {
|
||||
family = lib.mkForce "Monaspace Krypton";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
home.packages = with pkgs; [ueberzugpp];
|
||||
home.packages = with pkgs; [
|
||||
ueberzugpp
|
||||
monaspace
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./atuin.nix
|
||||
./bat.nix
|
||||
|
|
@ -18,7 +19,8 @@
|
|||
];
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
home.packages = with pkgs;
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
# Editors
|
||||
# neovim # Improved version of vim, often used with overlays.
|
||||
|
|
@ -56,6 +58,7 @@
|
|||
age
|
||||
portal
|
||||
atac
|
||||
dblab
|
||||
|
||||
# TUI Apps
|
||||
#ncdu_2
|
||||
|
|
|
|||
|
|
@ -3,11 +3,15 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.discord;
|
||||
|
||||
discordPatcherBin = pkgs.writers.writePython3Bin "discord-krisp-patcher" {
|
||||
libraries = with pkgs.python3Packages; [pyelftools capstone];
|
||||
libraries = with pkgs.python3Packages; [
|
||||
pyelftools
|
||||
capstone
|
||||
];
|
||||
flakeIgnore = [
|
||||
"E265" # from nix-shell shebang
|
||||
"E501" # line too long (82 > 79 characters)
|
||||
|
|
@ -27,19 +31,16 @@
|
|||
# link fix
|
||||
nss = pkgs.nss_latest;
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.programs.discord = {
|
||||
enable = lib.mkEnableOption "Discord";
|
||||
wrapDiscord = lib.mkEnableOption "wrap the Discord binary with a patching each time";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages =
|
||||
[discordPatcherBin]
|
||||
++ (
|
||||
if cfg.wrapDiscord
|
||||
then [wrapDiscordBinary]
|
||||
else [pkgs.discord]
|
||||
);
|
||||
home.packages = [
|
||||
discordPatcherBin
|
||||
] ++ (if cfg.wrapDiscord then [ wrapDiscordBinary ] else [ pkgs.discord ]);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import sys
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
from elftools.elf.elffile import ELFFile
|
||||
from capstone import *
|
||||
from capstone.x86 import *
|
||||
from elftools.elf.elffile import ELFFile
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print(f"Usage: {sys.argv[0]} [path to discord_krisp.node]")
|
||||
|
|
@ -13,14 +13,18 @@ if len(sys.argv) < 2:
|
|||
executable = sys.argv[1]
|
||||
|
||||
elf = ELFFile(open(executable, "rb"))
|
||||
symtab = elf.get_section_by_name('.symtab')
|
||||
symtab = elf.get_section_by_name(".symtab")
|
||||
|
||||
krisp_initialize_address = symtab.get_symbol_by_name("_ZN7discord15KrispInitializeEv")[0].entry.st_value
|
||||
isSignedByDiscord_address = symtab.get_symbol_by_name("_ZN7discord4util17IsSignedByDiscordERKNSt2Cr12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE")[0].entry.st_value
|
||||
krisp_initialize_address = symtab.get_symbol_by_name("_ZN7discord15KrispInitializeEv")[
|
||||
0
|
||||
].entry.st_value
|
||||
isSignedByDiscord_address = symtab.get_symbol_by_name(
|
||||
"_ZN7discord4util17IsSignedByDiscordERKNSt2Cr12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE"
|
||||
)[0].entry.st_value
|
||||
|
||||
text = elf.get_section_by_name('.text')
|
||||
text_start = text['sh_addr']
|
||||
text_start_file = text['sh_offset']
|
||||
text = elf.get_section_by_name(".text")
|
||||
text_start = text["sh_addr"]
|
||||
text_start_file = text["sh_offset"]
|
||||
# This seems to always be zero (.text starts at the right offset in the file). Do it just in case?
|
||||
address_to_file = text_start_file - text_start
|
||||
|
||||
|
|
@ -72,9 +76,9 @@ if je_location:
|
|||
print(f"Found patch location: 0x{je_location:x}")
|
||||
|
||||
shutil.copyfile(executable, executable + ".orig")
|
||||
f = open(executable, 'rb+')
|
||||
f = open(executable, "rb+")
|
||||
f.seek(je_location - address_to_file)
|
||||
f.write(b'\x66\x90') # Two byte NOP
|
||||
f.write(b"\x66\x90") # Two byte NOP
|
||||
f.close()
|
||||
else:
|
||||
if found_already_patched:
|
||||
|
|
|
|||
|
|
@ -1,123 +1,126 @@
|
|||
{...}: {
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
plugins.bufferline = let
|
||||
mouse = {
|
||||
right =
|
||||
# Lua
|
||||
"'vertical sbuffer %d'";
|
||||
close =
|
||||
# Lua
|
||||
''
|
||||
function(bufnum)
|
||||
require("mini.bufremove").delete(bufnum)
|
||||
end
|
||||
'';
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
options = {
|
||||
mode = "buffers";
|
||||
always_show_bufferline = true;
|
||||
buffer_close_icon = "";
|
||||
close_command.__raw = mouse.close;
|
||||
close_icon = "";
|
||||
diagnostics = "nvim_lsp";
|
||||
diagnostics_indicator =
|
||||
plugins.bufferline =
|
||||
let
|
||||
mouse = {
|
||||
right =
|
||||
# Lua
|
||||
"'vertical sbuffer %d'";
|
||||
close =
|
||||
# Lua
|
||||
''
|
||||
function(count, level, diagnostics_dict, context)
|
||||
local s = ""
|
||||
for e, n in pairs(diagnostics_dict) do
|
||||
local sym = e == "error" and " "
|
||||
or (e == "warning" and " " or "" )
|
||||
if(sym ~= "") then
|
||||
s = s .. " " .. n .. sym
|
||||
end
|
||||
end
|
||||
return s
|
||||
function(bufnum)
|
||||
require("mini.bufremove").delete(bufnum)
|
||||
end
|
||||
'';
|
||||
# Will make sure all names in bufferline are unique
|
||||
enforce_regular_tabs = false;
|
||||
};
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
|
||||
groups = {
|
||||
options = {
|
||||
toggle_hidden_on_enter = true;
|
||||
settings = {
|
||||
options = {
|
||||
mode = "buffers";
|
||||
always_show_bufferline = true;
|
||||
buffer_close_icon = "";
|
||||
close_command.__raw = mouse.close;
|
||||
close_icon = "";
|
||||
diagnostics = "nvim_lsp";
|
||||
diagnostics_indicator =
|
||||
# Lua
|
||||
''
|
||||
function(count, level, diagnostics_dict, context)
|
||||
local s = ""
|
||||
for e, n in pairs(diagnostics_dict) do
|
||||
local sym = e == "error" and " "
|
||||
or (e == "warning" and " " or "" )
|
||||
if(sym ~= "") then
|
||||
s = s .. " " .. n .. sym
|
||||
end
|
||||
end
|
||||
return s
|
||||
end
|
||||
'';
|
||||
# Will make sure all names in bufferline are unique
|
||||
enforce_regular_tabs = false;
|
||||
|
||||
groups = {
|
||||
options = {
|
||||
toggle_hidden_on_enter = true;
|
||||
};
|
||||
|
||||
items = [
|
||||
{
|
||||
name = "Tests";
|
||||
highlight = {
|
||||
underline = true;
|
||||
fg = "#a6da95";
|
||||
sp = "#494d64";
|
||||
};
|
||||
priority = 2;
|
||||
# icon = "";
|
||||
matcher.__raw = ''
|
||||
function(buf)
|
||||
return buf.name:match('%test') or buf.name:match('%.spec')
|
||||
end
|
||||
'';
|
||||
}
|
||||
{
|
||||
name = "Docs";
|
||||
highlight = {
|
||||
undercurl = true;
|
||||
fg = "#ffffff";
|
||||
sp = "#494d64";
|
||||
};
|
||||
auto_close = false;
|
||||
matcher.__raw = ''
|
||||
function(buf)
|
||||
return buf.name:match('%.md') or buf.name:match('%.txt')
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
items = [
|
||||
indicator = {
|
||||
style = "icon";
|
||||
icon = "▎";
|
||||
};
|
||||
|
||||
left_trunc_marker = "";
|
||||
max_name_length = 18;
|
||||
max_prefix_length = 15;
|
||||
modified_icon = "●";
|
||||
|
||||
numbers.__raw = ''
|
||||
function(opts)
|
||||
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
|
||||
end
|
||||
'';
|
||||
|
||||
persist_buffer_sort = true;
|
||||
right_mouse_command.__raw = mouse.right;
|
||||
right_trunc_marker = "";
|
||||
separator_style = "slant";
|
||||
show_buffer_close_icons = true;
|
||||
show_buffer_icons = true;
|
||||
show_close_icon = true;
|
||||
show_tab_indicators = true;
|
||||
sort_by = "extension";
|
||||
tab_size = 18;
|
||||
|
||||
offsets = [
|
||||
{
|
||||
name = "Tests";
|
||||
highlight = {
|
||||
underline = true;
|
||||
fg = "#a6da95";
|
||||
sp = "#494d64";
|
||||
};
|
||||
priority = 2;
|
||||
# icon = "";
|
||||
matcher.__raw = ''
|
||||
function(buf)
|
||||
return buf.name:match('%test') or buf.name:match('%.spec')
|
||||
end
|
||||
'';
|
||||
}
|
||||
{
|
||||
name = "Docs";
|
||||
highlight = {
|
||||
undercurl = true;
|
||||
fg = "#ffffff";
|
||||
sp = "#494d64";
|
||||
};
|
||||
auto_close = false;
|
||||
matcher.__raw = ''
|
||||
function(buf)
|
||||
return buf.name:match('%.md') or buf.name:match('%.txt')
|
||||
end
|
||||
'';
|
||||
filetype = "neo-tree";
|
||||
text = "File Explorer";
|
||||
text_align = "center";
|
||||
highlight = "Directory";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
indicator = {
|
||||
style = "icon";
|
||||
icon = "▎";
|
||||
};
|
||||
|
||||
left_trunc_marker = "";
|
||||
max_name_length = 18;
|
||||
max_prefix_length = 15;
|
||||
modified_icon = "●";
|
||||
|
||||
numbers.__raw = ''
|
||||
function(opts)
|
||||
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
|
||||
end
|
||||
'';
|
||||
|
||||
persist_buffer_sort = true;
|
||||
right_mouse_command.__raw = mouse.right;
|
||||
right_trunc_marker = "";
|
||||
separator_style = "slant";
|
||||
show_buffer_close_icons = true;
|
||||
show_buffer_icons = true;
|
||||
show_close_icon = true;
|
||||
show_tab_indicators = true;
|
||||
sort_by = "extension";
|
||||
tab_size = 18;
|
||||
|
||||
offsets = [
|
||||
{
|
||||
filetype = "neo-tree";
|
||||
text = "File Explorer";
|
||||
text_align = "center";
|
||||
highlight = "Directory";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
programs.nixvim = {
|
||||
extraConfigLuaPre =
|
||||
# lua
|
||||
|
|
@ -10,22 +11,22 @@
|
|||
local slow_format_filetypes = {}
|
||||
|
||||
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
||||
if args.bang then
|
||||
if args.bang then
|
||||
-- FormatDisable! will disable formatting just for this buffer
|
||||
vim.b.disable_autoformat = true
|
||||
else
|
||||
vim.g.disable_autoformat = true
|
||||
end
|
||||
end, {
|
||||
desc = "Disable autoformat-on-save",
|
||||
bang = true,
|
||||
})
|
||||
desc = "Disable autoformat-on-save",
|
||||
bang = true,
|
||||
})
|
||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||
vim.b.disable_autoformat = false
|
||||
vim.g.disable_autoformat = false
|
||||
end, {
|
||||
desc = "Re-enable autoformat-on-save",
|
||||
})
|
||||
desc = "Re-enable autoformat-on-save",
|
||||
})
|
||||
vim.api.nvim_create_user_command("FormatToggle", function(args)
|
||||
if args.bang then
|
||||
-- Toggle formatting for current buffer
|
||||
|
|
@ -35,9 +36,9 @@
|
|||
vim.g.disable_autoformat = not vim.g.disable_autoformat
|
||||
end
|
||||
end, {
|
||||
desc = "Toggle autoformat-on-save",
|
||||
bang = true,
|
||||
})
|
||||
desc = "Toggle autoformat-on-save",
|
||||
bang = true,
|
||||
})
|
||||
'';
|
||||
|
||||
plugins = {
|
||||
|
|
@ -63,7 +64,7 @@
|
|||
end
|
||||
|
||||
return { timeout_ms = 200, lsp_fallback = true }, on_format
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
||||
format_after_save =
|
||||
|
|
@ -97,40 +98,40 @@
|
|||
"shellharden"
|
||||
"shfmt"
|
||||
];
|
||||
bicep = ["bicep"];
|
||||
c = ["clang_format"];
|
||||
cmake = ["cmake-format"];
|
||||
cpp = ["clang_format"];
|
||||
cs = ["csharpier"];
|
||||
css = ["stylelint"];
|
||||
fish = ["fish_indent"];
|
||||
fsharp = ["fantomas"];
|
||||
go = ["gofmt"];
|
||||
haskell = ["ormolu"];
|
||||
bicep = [ "bicep" ];
|
||||
c = [ "clang_format" ];
|
||||
cmake = [ "cmake-format" ];
|
||||
cpp = [ "clang_format" ];
|
||||
cs = [ "csharpier" ];
|
||||
css = [ "stylelint" ];
|
||||
fish = [ "fish_indent" ];
|
||||
fsharp = [ "fantomas" ];
|
||||
go = [ "gofmt" ];
|
||||
haskell = [ "ormolu" ];
|
||||
javascript = [
|
||||
[
|
||||
"prettierd"
|
||||
"prettier"
|
||||
]
|
||||
];
|
||||
json = ["jq"];
|
||||
lua = ["stylua"];
|
||||
markdown = ["deno_fmt"];
|
||||
nix = ["nixfmt"];
|
||||
json = [ "jq" ];
|
||||
lua = [ "stylua" ];
|
||||
markdown = [ "deno_fmt" ];
|
||||
nix = [ "nixfmt" ];
|
||||
python = [
|
||||
"isort"
|
||||
"black"
|
||||
];
|
||||
rust = ["rustfmt"];
|
||||
rust = [ "rustfmt" ];
|
||||
sh = [
|
||||
"shellcheck"
|
||||
"shellharden"
|
||||
"shfmt"
|
||||
];
|
||||
sql = ["sqlfluff"];
|
||||
swift = ["swift_format"];
|
||||
terraform = ["terraform_fmt"];
|
||||
toml = ["taplo"];
|
||||
sql = [ "sqlfluff" ];
|
||||
swift = [ "swift_format" ];
|
||||
terraform = [ "terraform_fmt" ];
|
||||
toml = [ "taplo" ];
|
||||
typescript = [
|
||||
[
|
||||
"prettierd"
|
||||
|
|
@ -141,8 +142,8 @@
|
|||
"xmlformat"
|
||||
"xmllint"
|
||||
];
|
||||
yaml = ["yamlfmt"];
|
||||
zig = ["zigfmt"];
|
||||
yaml = [ "yamlfmt" ];
|
||||
zig = [ "zigfmt" ];
|
||||
"_" = [
|
||||
"squeeze_blanks"
|
||||
"trim_whitespace"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
{...}: {
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
mini = {
|
||||
enable = true;
|
||||
|
||||
modules = {
|
||||
bufremove = {};
|
||||
bufremove = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -44,7 +45,7 @@
|
|||
|
||||
local get_listed_bufs = function()
|
||||
return vim.tbl_filter(function(bufnr)
|
||||
return vim.api.nvim_buf_get_option(bufnr, "buflisted")
|
||||
return vim.api.nvim_buf_get_option(bufnr, "buflisted")
|
||||
end, vim.api.nvim_list_bufs())
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{...}: {
|
||||
{ ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
plugins.noice = {
|
||||
enable = true;
|
||||
|
|
@ -51,7 +52,7 @@
|
|||
pattern = "^:%s*he?l?p?%s+";
|
||||
icon = "";
|
||||
};
|
||||
input = {};
|
||||
input = { };
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -105,9 +106,9 @@
|
|||
local servers = { 'jdtls' }
|
||||
|
||||
for index, value in ipairs(servers) do
|
||||
if value == client then
|
||||
return true
|
||||
end
|
||||
if value == client then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
extraPlugins = [pkgs.vimPlugins.precognition-nvim];
|
||||
extraPlugins = [ pkgs.vimPlugins.precognition-nvim ];
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
|
|
@ -9,9 +10,9 @@
|
|||
action.__raw = ''
|
||||
function()
|
||||
if require("precognition").toggle() then
|
||||
vim.notify("precognition on")
|
||||
vim.notify("precognition on")
|
||||
else
|
||||
vim.notify("precognition off")
|
||||
vim.notify("precognition off")
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
# A highly customizable status bar for Sway and other Wayland-based compositors.
|
||||
{pkgs, ...}: let
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
networkInterface.eth = "wlp3s0";
|
||||
hwmon = "/sys/class/hwmon/hwmon0/temp1_input";
|
||||
in {
|
||||
in
|
||||
{
|
||||
programs.waybar.enable = true;
|
||||
|
||||
programs.waybar.settings = {
|
||||
|
|
@ -10,9 +12,25 @@ in {
|
|||
layer = "bottom";
|
||||
position = "top";
|
||||
height = 24;
|
||||
modules-left = ["hyprland/workspaces" "sway/mode"];
|
||||
modules-center = ["hyprland/window" "gamemode"];
|
||||
modules-right = ["network" "pulseaudio" "cpu" "custom/cpu_freq" "temperature" "memory" "battery" "tray" "clock"];
|
||||
modules-left = [
|
||||
"hyprland/workspaces"
|
||||
"sway/mode"
|
||||
];
|
||||
modules-center = [
|
||||
"hyprland/window"
|
||||
"gamemode"
|
||||
];
|
||||
modules-right = [
|
||||
"network"
|
||||
"pulseaudio"
|
||||
"cpu"
|
||||
"custom/cpu_freq"
|
||||
"temperature"
|
||||
"memory"
|
||||
"battery"
|
||||
"tray"
|
||||
"clock"
|
||||
];
|
||||
|
||||
"hyprland/workspaces".sort-by-number = true;
|
||||
|
||||
|
|
@ -34,16 +52,14 @@ in {
|
|||
"custom/cpu_freq" = {
|
||||
format = "{}MHz ";
|
||||
interval = 5;
|
||||
exec =
|
||||
pkgs.writeShellScript "cpuFreq"
|
||||
''
|
||||
${pkgs.busybox}/bin/cat /proc/cpuinfo | \
|
||||
${pkgs.busybox}/bin/grep MHz | \
|
||||
${pkgs.busybox}/bin/cut -c 12-15 | \
|
||||
${pkgs.busybox}/bin/tr '\n' ' ' | \
|
||||
${pkgs.busybox}/bin/awk '{s+=$1}END{print "",s/NR}' RS=" " | \
|
||||
${pkgs.busybox}/bin/cut -c 2-5
|
||||
'';
|
||||
exec = pkgs.writeShellScript "cpuFreq" ''
|
||||
${pkgs.busybox}/bin/cat /proc/cpuinfo | \
|
||||
${pkgs.busybox}/bin/grep MHz | \
|
||||
${pkgs.busybox}/bin/cut -c 12-15 | \
|
||||
${pkgs.busybox}/bin/tr '\n' ' ' | \
|
||||
${pkgs.busybox}/bin/awk '{s+=$1}END{print "",s/NR}' RS=" " | \
|
||||
${pkgs.busybox}/bin/cut -c 2-5
|
||||
'';
|
||||
};
|
||||
|
||||
"battery" = {
|
||||
|
|
@ -55,7 +71,13 @@ in {
|
|||
};
|
||||
"format" = "{capacity}% {icon} ";
|
||||
"format-full" = "";
|
||||
"format-icons" = ["" "" "" "" ""];
|
||||
"format-icons" = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
|
||||
"memory"."format" = "{used:0.1f}G/{total:0.1f}G ";
|
||||
|
|
@ -81,7 +103,10 @@ in {
|
|||
"phone" = "";
|
||||
"portable" = "";
|
||||
"car" = "";
|
||||
"default" = ["" ""];
|
||||
"default" = [
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"on-click" = "pavucontrol";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
pkgs,
|
||||
user,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# You can import other NixOS modules here
|
||||
imports = [
|
||||
# If you want to use modules your own flake exports (from modules/nixos):
|
||||
|
|
@ -90,18 +91,17 @@
|
|||
|
||||
# This will add each flake input as a registry
|
||||
# To make nix3 commands consistent with your flake
|
||||
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
|
||||
nix.registry = (lib.mapAttrs (_: flake: { inherit flake; })) (
|
||||
(lib.filterAttrs (_: lib.isType "flake")) inputs
|
||||
);
|
||||
|
||||
# This will additionally add your inputs to the system's legacy channels
|
||||
# Making legacy nix commands consistent as well, awesome!
|
||||
nix.nixPath = ["/etc/nix/path"];
|
||||
environment.etc =
|
||||
lib.mapAttrs'
|
||||
(name: value: {
|
||||
name = "nix/path/${name}";
|
||||
value.source = value.flake;
|
||||
})
|
||||
config.nix.registry;
|
||||
nix.nixPath = [ "/etc/nix/path" ];
|
||||
environment.etc = lib.mapAttrs' (name: value: {
|
||||
name = "nix/path/${name}";
|
||||
value.source = value.flake;
|
||||
}) config.nix.registry;
|
||||
|
||||
networking.hostName = "candlekeep";
|
||||
networking.networkmanager.enable = true;
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILq54YrM3BbhBs0oDLOrc1bkg6FCCmkV4E3pWLZp0ejN gwg313@pm.me"
|
||||
];
|
||||
extraGroups = ["wheel"];
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,16 +7,23 @@
|
|||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
../../common/nixos/nfs.nix
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"rtsx_pci_sdmmc"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/f2c87d99-ea17-4ef3-9ef6-bcc6637357f2";
|
||||
|
|
@ -31,7 +38,7 @@
|
|||
};
|
||||
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/dd8d717a-d872-4780-af3c-af4c702b587a";}
|
||||
{ device = "/dev/disk/by-uuid/dd8d717a-d872-4780-af3c-af4c702b587a"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
config,
|
||||
user,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
dataDir = "/home/gwg313";
|
||||
|
|
@ -17,13 +18,15 @@
|
|||
|
||||
settings = {
|
||||
devices = {
|
||||
"grymforge" = {id = "N2TYFZ4-ODIIHIZ-UP27V4V-NYMAZNI-SIATS5S-5NTM6JX-A67HCZ5-ZB4TVQJ";};
|
||||
"grymforge" = {
|
||||
id = "N2TYFZ4-ODIIHIZ-UP27V4V-NYMAZNI-SIATS5S-5NTM6JX-A67HCZ5-ZB4TVQJ";
|
||||
};
|
||||
};
|
||||
|
||||
folders = {
|
||||
"repos" = {
|
||||
path = "/home/gwg313/repos";
|
||||
devices = ["grymforge"];
|
||||
devices = [ "grymforge" ];
|
||||
versioning = {
|
||||
type = "staggered";
|
||||
params = {
|
||||
|
|
@ -34,7 +37,7 @@
|
|||
};
|
||||
"documents" = {
|
||||
path = "/home/gwg313/Documents";
|
||||
devices = ["grymforge"];
|
||||
devices = [ "grymforge" ];
|
||||
versioning = {
|
||||
type = "staggered";
|
||||
params = {
|
||||
|
|
@ -45,7 +48,7 @@
|
|||
};
|
||||
"obsidian" = {
|
||||
path = "/home/gwg313/vault";
|
||||
devices = ["grymforge"];
|
||||
devices = [ "grymforge" ];
|
||||
versioning = {
|
||||
type = "staggered";
|
||||
params = {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
config,
|
||||
user,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
dataDir = "/home/gwg313";
|
||||
|
|
@ -17,13 +18,15 @@
|
|||
|
||||
settings = {
|
||||
devices = {
|
||||
"candlekeep" = {id = "762A3TK-Z3ZX6DG-V4VASMJ-H6DJHE5-PBD6YZQ-MPILUWT-E7EY4O7-4EAPHAX";};
|
||||
"candlekeep" = {
|
||||
id = "762A3TK-Z3ZX6DG-V4VASMJ-H6DJHE5-PBD6YZQ-MPILUWT-E7EY4O7-4EAPHAX";
|
||||
};
|
||||
};
|
||||
|
||||
folders = {
|
||||
"repos" = {
|
||||
path = "/home/gwg313/repos";
|
||||
devices = ["candlekeep"];
|
||||
devices = [ "candlekeep" ];
|
||||
versioning = {
|
||||
type = "staggered";
|
||||
params = {
|
||||
|
|
@ -34,7 +37,7 @@
|
|||
};
|
||||
"documents" = {
|
||||
path = "/home/gwg313/Documents";
|
||||
devices = ["candlekeep"];
|
||||
devices = [ "candlekeep" ];
|
||||
versioning = {
|
||||
type = "staggered";
|
||||
params = {
|
||||
|
|
@ -45,7 +48,7 @@
|
|||
};
|
||||
"obsidian" = {
|
||||
path = "/home/gwg313/vault";
|
||||
devices = ["candlekeep"];
|
||||
devices = [ "candlekeep" ];
|
||||
versioning = {
|
||||
type = "staggered";
|
||||
params = {
|
||||
|
|
|
|||
|
|
@ -16,14 +16,17 @@ buildGoModule rec {
|
|||
|
||||
vendorHash = "sha256-zt1/gE4bVj+3yr9n0kT2FMYMEmiooy3k1lQ77rN6sTk=";
|
||||
|
||||
ldflags = ["-s" "-w"];
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Smart session manager for the terminal";
|
||||
homepage = "https://github.com/joshmedeski/sesh";
|
||||
changelog = "https://github.com/joshmedeski/sesh/releases/tag/${src.rev}";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [gwg313];
|
||||
maintainers = with lib.maintainers; [ gwg313 ];
|
||||
mainProgram = "sesh";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue