mirror of
https://github.com/librephoenix/nixos-config
synced 2025-11-30 22:54:01 +05:30
Compare commits
No commits in common. "36eabc0203ba4aaf5ef26deb182a3d26e5f82a67" and "74ade000816e9b3adcd34d44edf5744a1c238634" have entirely different histories.
36eabc0203
...
74ade00081
5 changed files with 55 additions and 136 deletions
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -1086,11 +1086,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1762633087,
|
"lastModified": 1760810038,
|
||||||
"narHash": "sha256-eZcPkglvKESSzrtqLQoroIY9KIFZH5rsvWlK0ibZ8dc=",
|
"narHash": "sha256-ZmrKFgVn/Ues34j+TRk2W7m8X6/tXVqtV19zE9apI9s=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "ff344f9d922c5fda41c87d92fa0a22219099c045",
|
"rev": "56ac08a980247206d96f0efe289e6212f009f6b3",
|
||||||
"revCount": 49,
|
"revCount": 47,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:///etc/nixos.secrets"
|
"url": "file:///etc/nixos.secrets"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
# hardware
|
# hardware
|
||||||
cachy.enable = true;
|
cachy.enable = true;
|
||||||
cachy.variant = "lts";
|
cachy.variant = "server";
|
||||||
|
|
||||||
virtualization = {
|
virtualization = {
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
|
|
@ -53,19 +53,19 @@
|
||||||
programs.fuse.userAllowOther = true;
|
programs.fuse.userAllowOther = true;
|
||||||
|
|
||||||
networking.firewall.extraCommands =
|
networking.firewall.extraCommands =
|
||||||
# ip ban ai crawlers
|
# ip ban ai crawlers
|
||||||
let
|
let createDropRulesForIpAddress = address:
|
||||||
createDropRulesForIpAddress = address: ''
|
''
|
||||||
iptables -A INPUT -s ${address} -j DROP
|
iptables -A INPUT -s ${address} -j DROP
|
||||||
iptables -A OUTPUT -s ${address} -j DROP
|
iptables -A OUTPUT -s ${address} -j DROP
|
||||||
iptables -A FORWARD -s ${address} -j DROP
|
iptables -A FORWARD -s ${address} -j DROP
|
||||||
iptables -A DOCKER -s ${address} -j DROP
|
iptables -A DOCKER -s ${address} -j DROP
|
||||||
iptables -A DOCKER-BRIDGE -s ${address} -j DROP
|
iptables -A DOCKER-BRIDGE -s ${address} -j DROP
|
||||||
iptables -A DOCKER-FORWARD -s ${address} -j DROP
|
iptables -A DOCKER-FORWARD -s ${address} -j DROP
|
||||||
iptables -A DOCKER-USER -s ${address} -j DROP
|
iptables -A DOCKER-USER -s ${address} -j DROP
|
||||||
iptables -A DOCKER-ISOLATION-STAGE-1 -s ${address} -j DROP
|
iptables -A DOCKER-ISOLATION-STAGE-1 -s ${address} -j DROP
|
||||||
iptables -A DOCKER-ISOLATION-STAGE-2 -s ${address} -j DROP
|
iptables -A DOCKER-ISOLATION-STAGE-2 -s ${address} -j DROP
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
${createDropRulesForIpAddress "216.73.216.143"}
|
${createDropRulesForIpAddress "216.73.216.143"}
|
||||||
|
|
@ -215,8 +215,8 @@
|
||||||
${createDropRulesForIpAddress "98.84.200.43"}
|
${createDropRulesForIpAddress "98.84.200.43"}
|
||||||
${createDropRulesForIpAddress "98.84.60.17"}
|
${createDropRulesForIpAddress "98.84.60.17"}
|
||||||
${createDropRulesForIpAddress "98.84.70.201"}
|
${createDropRulesForIpAddress "98.84.70.201"}
|
||||||
'';
|
'';
|
||||||
virtualisation.docker.extraOptions = "--iptables=true";
|
virtualisation.docker.extraOptions="--iptables=true";
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,29 @@
|
||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{
|
{ config, lib, modulesPath, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports =
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
services.fstrim.enable = true;
|
services.fstrim.enable = true;
|
||||||
boot.initrd.availableKernelModules = [
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "ums_realtek" "sd_mod" "sr_mod" ];
|
||||||
"xhci_pci"
|
|
||||||
"ehci_pci"
|
|
||||||
"ahci"
|
|
||||||
"ums_realtek"
|
|
||||||
"sd_mod"
|
|
||||||
"sr_mod"
|
|
||||||
];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
"kvm-intel"
|
|
||||||
"ip_tables"
|
|
||||||
"i6table_nat"
|
|
||||||
"wireguard"
|
|
||||||
];
|
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" =
|
||||||
device = "/dev/disk/by-uuid/ea03d496-2769-485d-b5cb-de0b58cb698c";
|
{ device = "/dev/disk/by-uuid/ea03d496-2769-485d-b5cb-de0b58cb698c";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=@" ];
|
options = [ "subvol=@" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" =
|
||||||
device = "/dev/disk/by-uuid/4F5E-11FB";
|
{ device = "/dev/disk/by-uuid/4F5E-11FB";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,8 @@
|
||||||
{
|
{ config, lib, pkgs, pkgs-stable, osConfig, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
pkgs-stable,
|
|
||||||
osConfig,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.userSettings.git;
|
cfg = config.userSettings.git;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options = {
|
options = {
|
||||||
userSettings.git = {
|
userSettings.git = {
|
||||||
enable = lib.mkEnableOption "Enable git";
|
enable = lib.mkEnableOption "Enable git";
|
||||||
|
|
@ -18,25 +10,15 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = [
|
home.packages = [ pkgs.git pkgs-stable.openssh ];
|
||||||
pkgs.git
|
|
||||||
pkgs.git-extras
|
|
||||||
pkgs.git-filter-repo
|
|
||||||
pkgs-stable.openssh
|
|
||||||
];
|
|
||||||
programs.git.enable = true;
|
programs.git.enable = true;
|
||||||
programs.git.userName = config.userSettings.name;
|
programs.git.userName = config.userSettings.name;
|
||||||
programs.git.userEmail = config.userSettings.email;
|
programs.git.userEmail = config.userSettings.email;
|
||||||
programs.git.aliases = {
|
|
||||||
change-commits = ''!f() { VAR=$1; OLD=$2; NEW=$3; shift 3; FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --env-filter "if [[ \"$`echo $VAR`\" = '$OLD' ]]; then export $VAR='$NEW'; fi" $@; }; f'';
|
|
||||||
};
|
|
||||||
programs.git.extraConfig = {
|
programs.git.extraConfig = {
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
safe.directory = [
|
safe.directory = [ osConfig.systemSettings.dotfilesDir
|
||||||
osConfig.systemSettings.dotfilesDir
|
osConfig.systemSettings.secretsFlakeDir
|
||||||
osConfig.systemSettings.secretsFlakeDir
|
(config.home.homeDirectory + "/.cache/nix/tarball-cache") ];
|
||||||
(config.home.homeDirectory + "/.cache/nix/tarball-cache")
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
programs.git.lfs.enable = true;
|
programs.git.lfs.enable = true;
|
||||||
services.ssh-agent.enable = true;
|
services.ssh-agent.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,8 @@
|
||||||
{
|
{ config, lib, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.userSettings.zed;
|
cfg = config.userSettings.zed;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options = {
|
options = {
|
||||||
userSettings.zed = {
|
userSettings.zed = {
|
||||||
enable = lib.mkEnableOption "Enable zed editor";
|
enable = lib.mkEnableOption "Enable zed editor";
|
||||||
|
|
@ -64,7 +58,7 @@ in
|
||||||
disable_ai = true;
|
disable_ai = true;
|
||||||
agent = {
|
agent = {
|
||||||
button = false;
|
button = false;
|
||||||
model_parameters = [ ];
|
model_parameters = [];
|
||||||
};
|
};
|
||||||
git_panel = {
|
git_panel = {
|
||||||
button = false;
|
button = false;
|
||||||
|
|
@ -144,62 +138,22 @@ in
|
||||||
"space b n" = "panel::NextPanelTab";
|
"space b n" = "panel::NextPanelTab";
|
||||||
"space b i" = "tab_switcher::ToggleAll";
|
"space b i" = "tab_switcher::ToggleAll";
|
||||||
"ctrl-i" = "tab_switcher::ToggleAll";
|
"ctrl-i" = "tab_switcher::ToggleAll";
|
||||||
|
"alt-p" = [ "tab_switcher::Toggle" { "select_last" = true; }];
|
||||||
|
"alt-n" = "tab_switcher::Toggle";
|
||||||
"alt-z" = "terminal_panel::Toggle";
|
"alt-z" = "terminal_panel::Toggle";
|
||||||
"alt-d" = "debug_panel::ToggleFocus";
|
"alt-d" = "debug_panel::ToggleFocus";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
context = "OutlinePanel";
|
context = "Terminal";
|
||||||
bindings = {
|
bindings = {
|
||||||
"ctrl-h" = "workspace::ActivatePaneLeft";
|
"ctrl-w" = "pane::CloseActiveItem";
|
||||||
"ctrl-l" = "workspace::ActivatePaneRight";
|
"alt-z" = "terminal_panel::Toggle";
|
||||||
"ctrl-j" = "workspace::ActivatePaneDown";
|
"alt-d" = "debug_panel::ToggleFocus";
|
||||||
"ctrl-k" = "workspace::ActivatePaneUp";
|
"ctrl-i" = "tab_switcher::ToggleAll";
|
||||||
};
|
"alt-p" = [ "tab_switcher::Toggle" { "select_last" = true; }];
|
||||||
}
|
"alt-n" = "tab_switcher::Toggle";
|
||||||
{
|
};
|
||||||
context = "OutlinePanel && not_editing";
|
|
||||||
bindings = {
|
|
||||||
"q" = "workspace::ToggleLeftDock";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
context = "ProjectPanel";
|
|
||||||
bindings = {
|
|
||||||
"ctrl-h" = "workspace::ActivatePaneLeft";
|
|
||||||
"ctrl-l" = "workspace::ActivatePaneRight";
|
|
||||||
"ctrl-j" = "workspace::ActivatePaneDown";
|
|
||||||
"ctrl-k" = "workspace::ActivatePaneUp";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
context = "ProjectPanel && not_editing";
|
|
||||||
bindings = {
|
|
||||||
"tab" = "project_panel::OpenPermanent";
|
|
||||||
"q" = "workspace::ToggleLeftDock";
|
|
||||||
"r" = "project_panel::Rename";
|
|
||||||
"D" = "project_panel::Delete";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
context = "Terminal";
|
|
||||||
bindings = {
|
|
||||||
"ctrl-space w d" = "pane::CloseAllItems";
|
|
||||||
"ctrl-space b d" = "pane::CloseActiveItem";
|
|
||||||
"ctrl-space b p" = "panel::PreviousPanelTab";
|
|
||||||
"ctrl-space b n" = "panel::NextPanelTab";
|
|
||||||
"ctrl-space b i" = "tab_switcher::ToggleAll";
|
|
||||||
"ctrl-w" = "pane::CloseActiveItem";
|
|
||||||
"alt-z" = "terminal_panel::Toggle";
|
|
||||||
"alt-d" = "debug_panel::ToggleFocus";
|
|
||||||
"ctrl-i" = "tab_switcher::ToggleAll";
|
|
||||||
"alt-p" = [
|
|
||||||
"tab_switcher::Toggle"
|
|
||||||
{ "select_last" = true; }
|
|
||||||
];
|
|
||||||
"ctrl-p" = null;
|
|
||||||
"ctrl-n" = null;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
"context" = "Editor && vim_mode == insert";
|
"context" = "Editor && vim_mode == insert";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue