Compare commits

...

115 Commits

Author SHA1 Message Date
Random936
d50f9e34b4 Added yq, patchelf 2025-12-19 20:08:25 -05:00
Random936
ab8dd6c5af Installed nix-ld to fix dependencies with binaryninja 2025-12-19 19:58:30 -05:00
Random936
89b0c103bf Updated bash scripts 2025-12-14 12:20:37 -05:00
Random936
7aead0fdca Updated nextcloud from 31 to 32 2025-12-01 19:37:54 -05:00
Random936
c1f5cb4462 Updated bash-scripts 2025-12-01 19:27:10 -05:00
Random936
1456872a5d Added sampledb disk for faster storage 2025-12-01 09:58:57 -08:00
Random936
646422cf4c Removed nvidia drivers from AI server config 2025-12-01 12:54:36 -05:00
Random936
a3d669d039 Switched from 25.05 to 25.11 2025-12-01 12:52:31 -05:00
Random936
4d5673f96b Updated media config to fix networking issues with jellyseer 2025-11-29 22:13:07 -05:00
Random936
8ab23d4292 Made git config conditional based on home-manager version 2025-11-29 22:11:31 -05:00
Random936
45619db650 Updated state version for home manager config 2025-11-29 21:24:59 -05:00
Random936
fee45bf0e6 Added imhex to hacking packages; updated flake to fix imhex 2025-11-28 10:38:41 -05:00
Random936
b4dd9407d4 Removed some other darwin related config; switched to brave browser 2025-11-26 20:06:21 -05:00
Random936
94595a0833 Organized hacking packages into categories 2025-11-22 23:02:49 -05:00
Random936
4f945e2c56 Added nix-init to packages 2025-11-21 18:15:31 -05:00
Random936
6e1624b26c Fixed issue with protonmail-bridge path 2025-11-18 20:07:17 -05:00
Random936
8281843816 Added ability to move workspaces to i3 config 2025-11-18 19:35:39 -05:00
Random936
bcbf53f51a Added blueman-manager i3 keybinding 2025-11-16 19:16:29 -05:00
Random936
f070129636 Small updates to readme 2025-11-16 12:51:36 -05:00
Random936
e0d337d56e Removed darwin config; Added unstable systems to config 2025-11-16 11:58:30 -05:00
Random936
ad8b141bfc Updated flake.nix file functions 2025-11-16 11:34:40 -05:00
Random936
5f1438f056 Updated hardware config to use drive labels; added README content 2025-11-12 21:10:03 -05:00
Random936
b540cfd946 Removed game packages; removed binaryninja 2025-11-10 20:38:33 -05:00
Random936
f36f414f51 Added binary ninja personal to repo 2025-10-27 21:44:10 -04:00
Random936
b8459f1967 Added config for rtl-sdr; changed timezone 2025-10-26 10:33:24 -04:00
Random936
ff9fe3ef3f Added a few cargo packages to dev dependencies 2025-09-27 20:52:16 -07:00
Random936
340109e73b Updates for rust develpopment and added ledger back 2025-09-27 11:01:39 -07:00
Random936
325f31cb2a removed ouch since I don't use it 2025-09-09 20:51:06 -07:00
Random936
0db84f7146 Added dysk to bash utilities 2025-09-08 13:34:00 -07:00
Random936
3c9907db9a Removed sampledb HDD from nix config 2025-09-06 18:56:55 -07:00
Random936
05e7664925 Some fixes to logging config after file separation 2025-09-02 20:09:07 -07:00
Random936
6e3ff222ad Moved prometheus and suricata config to separate files 2025-09-02 19:24:01 -07:00
Random936
2973862f44 Changes to AI config 2025-08-28 19:48:28 -07:00
Random936
ef788ec9d1 Added hardware file for sampledb to repo 2025-08-26 21:07:11 -07:00
Random936
60be488679 Updating hardware file for r330-logging 2025-08-26 20:55:37 -07:00
Random936
76f380b38a Updated media hardware/config 2025-08-21 20:50:14 -07:00
Random936
8706141dee Updated flake 2025-08-20 19:19:03 -07:00
Random936
8746d38eef Updated emacs config for new dot-emacs repo 2025-08-04 20:50:09 -07:00
Random936
72d16c4e37 Added svelte support to emacs LSP config 2025-07-31 20:27:05 -07:00
Random936
a4bfdf4748 Updated polybar to include pulseaudio support 2025-07-27 15:35:55 -07:00
Random936
f667cc4c14 Updates to nix config to fix deprecation warnings 2025-07-21 11:02:59 -07:00
Random936
ffa9bc9e3f Removed graylog from logging config 2025-07-20 18:18:40 -07:00
Random936
5e9db649cb Updated flake to 25.05 2025-07-20 18:15:41 -07:00
Random936
f641bbb679 Fixed some atuin config; added cava to packages 2025-07-06 17:34:14 -07:00
Random936
85248a2fba Updated emacs config to use consult-git-grep instead of grep 2025-06-28 15:27:53 -04:00
Random936
018313e48b Added nodejs to emacs deps; updated gitignore 2025-06-08 14:12:26 -07:00
Random936
09cce4e9fd Added new hdd to sampledb 2025-05-08 20:02:49 -07:00
Random936
15beb5de79 Updated flake.lock 2025-05-04 15:00:29 -07:00
Random936
9253338555 Websocket support for open-webui 2025-05-04 14:58:50 -07:00
Random936
e0a8ac3e07 Refactored flake.nix; fixed comma 2025-05-02 13:49:46 -07:00
Random936
741e2ab222 Added comma.nix 2025-05-02 12:16:11 -07:00
Random936
e6b920dee2 Revert "Switched from firefox to librewolf"; fix typo
This reverts commit 8b4eeae6b0.
2025-05-01 21:45:43 -07:00
Random936
8b4eeae6b0 Switched from firefox to librewolf 2025-05-01 21:40:54 -07:00
Random936
1d6d7c9d07 Added start-day alias; updated i3 startup scripts 2025-04-30 18:06:38 -07:00
Random936
46836579f2 Added some more basic zsh aliases 2025-04-29 20:33:28 -07:00
Random936
e2f68e690d Updated i3 config to better load launch bash scripts 2025-04-28 17:05:25 -07:00
Random936
3e3e8034d4 Updated polybar to run on all monitors 2025-04-28 15:59:20 -07:00
Random936
6bf4a7deff Added timer package to linux utils 2025-04-27 21:57:41 -07:00
Random936
7f8a668cef Added google chrome to gui packages to access kinesis clique 2025-04-24 16:42:13 -07:00
Random936
8125fe2bd2 Logging changes: new hdd, removed ideapad instance, graylog 2025-04-15 11:51:07 -07:00
Random936
575ced3c41 Updated nextcloud from 30 to 31 2025-04-14 18:05:39 -07:00
Random936
f9417ef89c Removed picom as it was causing lag 2025-04-14 18:04:56 -07:00
Random936
62e7f73319 Updated sampledb-dev machine to have more HDD space 2025-04-11 20:50:21 -07:00
Random936
6816dc833f Added sdb-client alias 2025-04-11 19:48:46 -07:00
Random936
e74223ae07 Switched from brave browser back to firefox 2025-04-11 16:42:12 -07:00
Random936
c9ba9713a2 Fixed issue with emacs font following flake update 2025-04-11 11:17:06 -07:00
Random936
f83754fb8d Changes to config following flake update 2025-04-11 10:19:04 -07:00
Random936
143e43818a Updated flake.lock 2025-04-11 09:57:10 -07:00
Random936
a903234837 Removed CSE115A code from nix config; no longer needed 2025-04-04 20:17:28 -07:00
Random936
a92f187706 Added open alias to zsh config 2025-04-02 10:28:51 -07:00
Random936
592eb51302 Added xdgmime configuration to nixos gui-apps.nix 2025-04-02 10:27:55 -07:00
Random936
9ee43df168 Added rbw to darwin config; removed whisky 2025-04-02 10:06:59 -07:00
Random936
f2b91181c5 Switched to brave browser from firefox and qutebrowser 2025-04-01 14:55:14 -07:00
Random936
4e561f1e93 Fixed wallpaper rendering issue 2025-03-31 19:16:49 -07:00
Random936
9fa79a6d64 Updated gitea http server address 2025-03-31 11:55:50 -07:00
Random936
dd930f4121 Updated nix-darwin flake to fix no-lock issue 2025-03-31 11:53:17 -07:00
Random936
f5e2b8bdcc Yes 2025-03-30 13:27:35 -07:00
Random936
ce49ef7a8c Add atuin 2025-03-30 13:16:22 -07:00
Random936
db3df96e39 Add whisky 2025-03-30 13:12:32 -07:00
Random936
e8439e9c29 Made randomctf.com the default virtualhost 2025-03-26 11:33:57 -07:00
Random936
4939beab9b Updates to media nginx subdomains 2025-03-26 11:16:24 -07:00
Random936
adf8e5d578 Updated nix-darwin flake to fix no-lock issue 2025-03-15 22:24:45 -07:00
Random936
7260d21508 Added qutebrowser config.py to config 2025-03-15 22:19:35 -07:00
Random936
5b89f4f667 Updates to darwin config 2025-03-10 12:50:56 -07:00
Random936
8675d9019b Fixed issue with i3 reload config logging out user 2025-03-09 12:02:18 -07:00
Random936
59276b06bd Added keybinding for proton-mail 2025-03-09 11:40:16 -07:00
Random936
7a035d29f7 Fixed bitwarden functions and removed obsolete ones 2025-03-08 11:22:33 -08:00
Random936
6acdff85dd Switched back to okular from mupdf 2025-03-08 11:03:17 -08:00
Random936
21a2e570d4 Removed firefox and added mupdf 2025-03-02 19:02:30 -08:00
Random936
10a7a4fabe Switch to rbw and rofi-rbw 2025-03-02 11:25:33 -08:00
Random936
a3341fa7d0 Added qutebrowser to gui-apps 2025-03-02 10:29:15 -08:00
Random936
30d800bba2 Added audio modifier software to gui apps 2025-03-01 18:40:27 -08:00
Random936
2a482f55b4 Added rippkgs to utils 2025-02-28 22:36:04 -08:00
Random936
e2c7e7c38e Added nginx for open-webui server 2025-02-28 18:19:20 -08:00
Random936
f95d52ec62 Changed cache directory for jellyfin 2025-02-28 14:20:59 -08:00
Random936
12f2d9e986 Improved awkuniq alias and fixed some other bugs 2025-02-27 18:28:10 -08:00
Random936
c059e55a57 Added deadline to inbox task 2025-02-27 17:53:07 -08:00
Random936
0caa95fb35 Added tshark and modified suricata max-files 2025-02-27 13:23:35 -08:00
Random936
80c1add81c Switched to jellyfin and removed plex config 2025-02-26 22:21:25 -08:00
Random936
3a3303e822 Updated suricata to now work with port mirroring 2025-02-26 15:47:27 -08:00
Random936
b4ec2af71d Moved direnv config from emacs config to linux general utils 2025-02-25 18:14:00 -08:00
Random936
942bdd517c More keybindings for daily planner 2025-02-25 18:11:20 -08:00
Random936
64a568c7bc CSE115A notifier and added jellyfin 2025-02-23 18:07:42 -08:00
Random936
708686fc5a Fixed screen tearing finally 2025-02-19 22:10:52 -08:00
Random936
b3b25e30af Added audacity 2025-02-19 22:10:45 -08:00
Random936
c07fa9236c New apps and minor fixes after flake update 2025-02-16 22:18:36 -08:00
Random936
d3a12f6c8d ssh and mail updates to darwin config 2025-02-12 16:16:35 -08:00
Random936
411845c9e6 Small fix to tmux location 2025-02-12 13:55:21 -08:00
Random936
40c0d69d4a Update flake fixing open-webui 2025-02-12 12:17:52 -08:00
Random936
a7e39bc0cf Added working firewall rules 2025-02-10 20:47:44 -08:00
Random936
73bfe6d1f7 Added firewall rule for node exporters 2025-02-10 20:08:14 -08:00
Random936
5ff34bbfc6 Small typo fixes after restructuring 2025-02-09 11:47:46 -08:00
4225fa73da Merge pull request 'restructuring' (#1) from restructuring into main
Reviewed-on: #1
2025-02-09 11:24:59 -08:00
Random936
b12693409c Updated flake and fixed some typos 2025-02-09 11:04:17 -08:00
Random936
fceb1282f0 Restructured nixos home-manager config 2025-02-09 10:47:35 -08:00
48 changed files with 1215 additions and 922 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
**/.*~undo-tree~ **/.*~undo-tree~
**/.DS_Store **/.DS_Store
/result /result
/home/result

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "bash-scripts"]
path = bash-scripts
url = gitea@git.randomctf.com:random936/bash-scripts.git

View File

@@ -1,9 +1,58 @@
* Dotfiles Repo * NixOS Setup for Omen Laptop
Installing the base configuration:
To install these dotfiles, you can use gnu stow. Running the following command will automatically create symlinks for every file in this repo.
#+begin_src bash #+begin_src bash
git clone https://github.com/Random936/dotfiles nix-shell -p vim git
cd dotfiles/ git clone https://git.randomctf.com/random936/dotfiles
stow . sudo nixos-rebuild switch --flake .#randomctf
#+end_src #+end_src
Install home manager and related packages:
#+begin_src bash
sudo ./install-homemanager.sh 25.05
home-manager switch --extra-experimental-features "nix-command flakes" --flake .#random
#+end_src
** Rbw (Rust Bitwarden) Setup
Before continuing, you will need to login on the [[https://bitwarden.com][Bitwarden]] website to retrieve your API key. This can be found under: Settings > Security > Keys > View API Key.
#+begin_src bash
# Enter the values it asks for from the Bitwarden view API key window.
rbw register
rbw login
rbw unlock
#+end_src
** Mail Setup
Setting up ~pass~:
#+begin_src bash
gpg --full-generate-key
# Copy the value from the output above and use it in the command below.
pass init <GPG_ID>
#+end_src
Setting up ~protonmail-bridge~:
#+begin_src bash
systemctl stop --user protonmail-bridge.service
protonmail-bridge --cli
cert export ~/.config/protonmail/bridge-v3/
login # This might take a while.
info # To get login info. SMTP needs to be added to authinfo.
exit
systemctl start --user protonmail-bridge.service
# Add passwords for protonmail bridge.
pass add "protonmail-bridge" <PASS>
#+end_src
Setting up ~mu4e~:
#+begin_src bash
mu init --maildir=~/.mail --my-address=<email_address>
mbsync -a
#+end_src

1
bash-scripts Submodule

Submodule bash-scripts added at 9190f0dd6a

View File

@@ -6,42 +6,49 @@
(import ./networking.nix { (import ./networking.nix {
hostname = "mindforge"; hostname = "mindforge";
ip_address = "192.168.100.45"; ip_address = "192.168.100.45";
open_ports = [ ]; open_ports = [ 80 443 ];
inherit lib; inherit lib;
}) })
]; ];
users.users.mindforge = import ./user.nix; users.users.mindforge = import ./user.nix;
# Setup drivers for NVIDIA GPU services.ollama = {
services.xserver = {
enable = false;
videoDrivers = [ "nvidia" ];
};
hardware = {
nvidia = {
open = false;
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
nvidiaSettings = true;
};
graphics = {
enable = true;
enable32Bit = true;
};
};
services.open-webui = {
enable = true; enable = true;
host = "0.0.0.0"; host = "0.0.0.0";
openFirewall = true; openFirewall = true;
environmentVariables = {
OLLAMA_CONTEXT_LENGTH = "8192";
};
}; };
services.ollama = { # NGINX Reverse Proxy Setup
services.open-webui.enable = true;
services.nginx = {
enable = true; enable = true;
acceleration = "cuda"; virtualHosts = {
# Jellyfin
"mindforge.randomctf.local" = {
extraConfig = ''
access_log /var/log/nginx/access.mindforge.log;
'';
locations."/".extraConfig = ''
proxy_pass http://localhost:8080/;
# Add WebSocket support (Necessary for version 0.5.0 and up)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
'';
};
};
}; };
} }

View File

@@ -1,7 +1,6 @@
%YAML 1.1 %YAML 1.1
--- ---
vars:
vars:
address-groups: address-groups:
HOME_NET: "[192.168.100.0/24]" HOME_NET: "[192.168.100.0/24]"
EXTERNAL_NET: "!$HOME_NET" EXTERNAL_NET: "!$HOME_NET"
@@ -32,25 +31,25 @@
TEREDO_PORTS: 3544 TEREDO_PORTS: 3544
SIP_PORTS: "[5060, 5061]" SIP_PORTS: "[5060, 5061]"
default-log-dir: /home/logging/logs default-log-dir: /mnt/logs/suricata
classification-file: /etc/suricata/classification.config classification-file: /etc/suricata/classification.config
reference-config-file: /etc/suricata/reference.config reference-config-file: /etc/suricata/reference.config
default-rule-path: /etc/suricata/rules default-rule-path: /etc/suricata/rules
rule-files: rule-files:
- suricata.rules - suricata.rules
stats: stats:
enabled: yes enabled: yes
af-packet: af-packet:
- interface: enp6s18 - interface: enp6s19
use-mmap: yes use-mmap: yes
tpacket-v3: yes tpacket-v3: yes
cluster-id: 99 cluster-id: 99
cluster-type: cluster_flow cluster-type: cluster_flow
defrag: yes defrag: yes
outputs: outputs:
- fast: - fast:
enabled: yes enabled: yes
filename: fast.log filename: fast.log
@@ -59,12 +58,14 @@
- eve-log: - eve-log:
enabled: yes enabled: yes
filetype: regular filetype: regular
filename: eve.json filename: eve-%Y-%m-%d.json
rotate-interval: day
types: types:
- alert: - alert:
tagged-packets: yes tagged-packets: yes
- http: - http:
extended: yes extended: yes
dump-all-headers: both
- http2 - http2
- dns: - dns:
enabled: yes enabled: yes
@@ -95,10 +96,10 @@
- smtp - smtp
- pcap-log: - pcap-log:
enabled: yes enabled: no
filename: log.pcap filename: log.pcap
limit: 1gb limit: 1gb
max-files: 20 max-files: 200
- stats: - stats:
enabled: yes enabled: yes

View File

@@ -1,81 +0,0 @@
{ config, pkgs, lib, ... }: {
nix.settings.experimental-features = ["nix-command" "flakes"];
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
git
];
homebrew = {
enable = true;
onActivation.cleanup = "zap";
taps = [
"nikitabobko/tap"
"FelixKratz/formulae"
];
brews = [
"wireguard-tools"
"bitwarden-cli"
"pinentry-mac"
"sketchybar"
"coreutils"
"watch"
];
casks = [
"font-hack-nerd-font"
"proton-mail-bridge"
"scroll-reverser"
"instantview"
"flameshot"
"aerospace"
"bitwarden"
"tailscale"
"wireshark"
"firefox"
"ghostty"
"discord"
"barrier"
"zoom"
"plex"
"vlc"
];
};
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
# Extra activation scripts
system.activationScripts.extraActivation.text = ''
softwareupdate --install-rosetta --agree-to-license
'';
# Keyboard and Mouse
system.keyboard = {
enableKeyMapping = true;
remapCapsLockToEscape = true;
swapLeftCommandAndLeftAlt = true;
};
# MacOS Changes
system = {
startup.chime = false;
defaults = {
dock.autohide = true;
NSGlobalDomain = {
"com.apple.mouse.tapBehavior" = 1;
_HIHideMenuBar = true;
};
};
};
# Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true;
users.users.jadenmaxwell = {
name = "jadenmaxwell";
home = "/Users/jadenmaxwell";
};
system.stateVersion = 4;
}

View File

@@ -27,11 +27,10 @@
# Setup i3 window manager # Setup i3 window manager
windowManager.i3 = { windowManager.i3 = {
enable = true; enable = true;
package = pkgs.i3-gaps;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
rofi rofi
polybar
alacritty alacritty
polybarFull
i3lock-fancy i3lock-fancy
xautolock xautolock
autorandr autorandr
@@ -58,12 +57,6 @@
enable32Bit = true; enable32Bit = true;
}; };
# Install picom for transparency.
services.picom = {
enable = true;
backend = "glx";
};
# Install Thunar # Install Thunar
programs.thunar.enable = true; programs.thunar.enable = true;
services.gvfs.enable = true; services.gvfs.enable = true;

View File

@@ -14,6 +14,8 @@
enable = true; enable = true;
port = 9002; port = 9002;
enabledCollectors = [ "systemd" "processes" ]; enabledCollectors = [ "systemd" "processes" ];
openFirewall = true;
firewallFilter = "-s 192.168.100.41 -p tcp -m tcp --dport 9002";
}; };
system.stateVersion = "24.05"; system.stateVersion = "24.05";

View File

@@ -1,6 +1,8 @@
{ lib, config, pkgs, inputs, ... }: { { lib, config, pkgs, inputs, ... }: {
imports = [ imports = [
./logging/prometheus.nix
./logging/suricata.nix
../hardware/logging.nix ../hardware/logging.nix
./headless.nix ./headless.nix
(import ./networking.nix { (import ./networking.nix {
@@ -9,208 +11,47 @@
open_ports = [ 3000 9001 9003 ]; open_ports = [ 3000 9001 9003 ];
inherit lib; inherit lib;
}) })
]; ];
networking.firewall.enable = false;
users.users.logging = import ./user.nix; users.users.logging = import ./user.nix;
environment.systemPackages = with pkgs; [
suricata
];
services.grafana = { services.grafana = {
enable = true; enable = true;
settings.server = { settings.server = {
http_addr = "0.0.0.0"; http_addr = "127.0.0.1";
http_port = 3000; http_port = 3000;
domain = "logging.randomctf.local"; domain = "grafana.randomctf.local";
}; };
}; };
services.nginx = {
services.prometheus.exporters.blackbox = {
enable = true; enable = true;
port = 9003; virtualHosts = {
configFile = assets/blackbox.yml; # Grafana
}; "grafana.randomctf.local" = {
extraConfig = ''
services.prometheus = { access_log /var/log/nginx/access.grafana.log;
enable = true;
port = 9001;
globalConfig.scrape_interval = "10s";
scrapeConfigs = let
node_port = toString config.services.prometheus.exporters.node.port;
blackbox_relabel = [
{
source_labels = [ "__address__" ];
target_label = "__param_target";
}
{
target_label = "__address__";
replacement = "127.0.0.1:9003";
}
];
in [
{
job_name = "node";
static_configs = [
{
targets = [ "127.0.0.1:${node_port}" ];
labels.instance = "r330-logging";
}
{
targets = [ "192.168.100.40:${node_port}" ];
labels.instance = "r330-media";
}
{
targets = [ "192.168.100.42:${node_port}" ];
labels.instance = "sampledb-dev";
}
{
targets = [ "192.168.100.45:${node_port}" ];
labels.instance = "mindforge";
}
{
targets = [ "192.168.100.1:9100" ];
labels.instance = "GL-MT6000";
}
];
}
{
job_name = "blackbox_icmp";
metrics_path = "/probe";
params = { module = ["icmp"]; };
static_configs = [
{
targets = [ "127.0.0.1" ];
labels.instance = "r330-media";
}
{
targets = [ "192.168.100.1" ];
labels.instance = "GL-MT6000";
}
{
targets = [ "192.168.100.11" ];
labels.instance = "r330-idrac";
}
{
targets = [ "192.168.100.12" ];
labels.instance = "r730xd-idrac";
}
{
targets = [ "192.168.100.20" ];
labels.instance = "ideapad";
}
{
targets = [ "192.168.100.21" ];
labels.instance = "r330-proxmox";
}
{
targets = [ "192.168.100.22" ];
labels.instance = "r730xd-proxmox";
}
{
targets = [ "192.168.100.40" ];
labels.instance = "r330-media";
}
{
targets = [ "192.168.100.42" ];
labels.instance = "sampledb-dev";
}
{
targets = [ "192.168.100.42" ];
labels.instance = "sampledb-dev";
}
{
targets = [ "192.168.100.45" ];
labels.instance = "mindforge";
}
{
targets = [ "1.1.1.1" ];
labels.instance = "Cloudflare";
}
{
targets = [ "8.8.8.8" ];
labels.instance = "Google";
}
];
relabel_configs = blackbox_relabel;
}
{
job_name = "blackbox_http_2xx";
metrics_path = "/probe";
params = { module = ["http_2xx"]; };
static_configs = [
{
targets = [ "http://192.168.100.40:6011" ];
labels.instance = "Qbittorrent";
}
{
targets = [ "http://192.168.100.40:7878" ];
labels.instance = "Radarr";
}
{
targets = [ "http://192.168.100.40:8989" ];
labels.instance = "Sonarr";
}
{
targets = [ "http://192.168.100.40:9696" ];
labels.instance = "Prowlarr";
}
{
targets = [ "https://randomctf.com" ];
labels.instance = "RandomCTF.com";
}
{
targets = [ "https://git.randomctf.com" ];
labels.instance = "Gitea";
}
{
targets = [ "https://nextcloud.randomctf.com" ];
labels.instance = "Nextcloud";
}
];
relabel_configs = blackbox_relabel;
}
{
job_name = "blackbox_http_2xx_no_verify";
metrics_path = "/probe";
params = { module = ["http_2xx_tls_no_verify"]; };
static_configs = [
{
targets = [ "https://192.168.100.40:5006" ];
labels.instance = "Actual";
}
];
relabel_configs = blackbox_relabel;
}
];
};
systemd.services.suricata = {
description = "Suricata IDS/IPS";
wantedBy = ["multi-user.target"];
serviceConfig = {
type = "simple";
User = "logging";
ExecStart = "${pkgs.suricata}/bin/suricata -c /etc/suricata.yaml -i enp6s18";
Restart = "on-failure";
CapabilityBoundingSet = "CAP_NET_RAW CAP_NET_ADMIN";
AmbientCapabilities = "CAP_NET_RAW CAP_NET_ADMIN";
};
};
environment.etc."suricata.yaml".source = ./assets/suricata.yaml;
environment.etc."suricata/classification.config".text = ''
''; '';
environment.etc."suricata/reference.config".text = '' locations."/".extraConfig = ''
proxy_set_header Host grafana.randomctf.local;
proxy_pass http://localhost:3000/;
'';
};
# Prometheus
"prometheus.randomctf.local" = {
extraConfig = ''
access_log /var/log/nginx/access.prometheus.log;
''; '';
environment.etc."suricata/threshold.config".text = '' locations."/".extraConfig = ''
''; proxy_pass http://localhost:9090/;
environment.etc."suricata/rules/suricata.rules".text = ''
''; '';
};
};
};
} }

View File

@@ -0,0 +1,156 @@
{ lib, config, pkgs, inputs, ... }: {
services.prometheus.exporters.blackbox = {
enable = true;
port = 9003;
configFile = ../assets/blackbox.yml;
};
services.prometheus = {
enable = true;
port = 9090;
globalConfig.scrape_interval = "10s";
scrapeConfigs = let
node_port = toString config.services.prometheus.exporters.node.port;
blackbox_relabel = [
{
source_labels = [ "__address__" ];
target_label = "__param_target";
}
{
target_label = "__address__";
replacement = "127.0.0.1:9003";
}
];
in [
{
job_name = "node";
static_configs = [
{
targets = [ "127.0.0.1:${node_port}" ];
labels.instance = "r330-logging";
}
{
targets = [ "192.168.100.40:${node_port}" ];
labels.instance = "r330-media";
}
{
targets = [ "192.168.100.42:${node_port}" ];
labels.instance = "sampledb-dev";
}
{
targets = [ "192.168.100.45:${node_port}" ];
labels.instance = "mindforge";
}
{
targets = [ "192.168.100.1:9100" ];
labels.instance = "GL-MT6000";
}
];
}
{
job_name = "blackbox_icmp";
metrics_path = "/probe";
params = { module = ["icmp"]; };
static_configs = [
{
targets = [ "127.0.0.1" ];
labels.instance = "r330-media";
}
{
targets = [ "192.168.100.1" ];
labels.instance = "GL-MT6000";
}
{
targets = [ "192.168.100.11" ];
labels.instance = "r330-idrac";
}
{
targets = [ "192.168.100.12" ];
labels.instance = "r730xd-idrac";
}
{
targets = [ "192.168.100.21" ];
labels.instance = "r330-proxmox";
}
{
targets = [ "192.168.100.22" ];
labels.instance = "r730xd-proxmox";
}
{
targets = [ "192.168.100.40" ];
labels.instance = "r330-media";
}
{
targets = [ "192.168.100.42" ];
labels.instance = "sampledb-dev";
}
{
targets = [ "192.168.100.42" ];
labels.instance = "sampledb-dev";
}
{
targets = [ "192.168.100.45" ];
labels.instance = "mindforge";
}
{
targets = [ "1.1.1.1" ];
labels.instance = "Cloudflare";
}
{
targets = [ "8.8.8.8" ];
labels.instance = "Google";
}
];
relabel_configs = blackbox_relabel;
}
{
job_name = "blackbox_http_2xx";
metrics_path = "/probe";
params = { module = ["http_2xx"]; };
static_configs = [
{
targets = [ "http://192.168.100.40:6011" ];
labels.instance = "Qbittorrent";
}
{
targets = [ "http://192.168.100.40:7878" ];
labels.instance = "Radarr";
}
{
targets = [ "http://192.168.100.40:8989" ];
labels.instance = "Sonarr";
}
{
targets = [ "http://192.168.100.40:9696" ];
labels.instance = "Prowlarr";
}
{
targets = [ "https://randomctf.com" ];
labels.instance = "RandomCTF.com";
}
{
targets = [ "https://git.randomctf.com" ];
labels.instance = "Gitea";
}
{
targets = [ "https://nextcloud.randomctf.com" ];
labels.instance = "Nextcloud";
}
];
relabel_configs = blackbox_relabel;
}
{
job_name = "blackbox_http_2xx_no_verify";
metrics_path = "/probe";
params = { module = ["http_2xx_tls_no_verify"]; };
static_configs = [
{
targets = [ "https://192.168.100.40:5006" ];
labels.instance = "Actual";
}
];
relabel_configs = blackbox_relabel;
}
];
};
}

View File

@@ -0,0 +1,34 @@
{ lib, config, pkgs, inputs, ... }: {
environment.systemPackages = with pkgs; [
suricata
];
systemd.services.suricata = {
description = "Suricata IDS/IPS";
wantedBy = ["multi-user.target"];
serviceConfig = {
type = "simple";
User = "logging";
ExecStartPre = "/run/current-system/sw/bin/ip link set enp6s19 up";
ExecStart = "${pkgs.suricata}/bin/suricata -c /etc/suricata.yaml -i enp6s19";
Restart = "on-failure";
CapabilityBoundingSet = "CAP_NET_RAW CAP_NET_ADMIN";
AmbientCapabilities = "CAP_NET_RAW CAP_NET_ADMIN";
};
};
environment.etc."suricata.yaml".source = ../assets/suricata.yaml;
environment.etc."suricata/classification.config".text = ''
'';
environment.etc."suricata/reference.config".text = ''
'';
environment.etc."suricata/threshold.config".text = ''
'';
environment.etc."suricata/rules/suricata.rules".text = ''
'';
}

View File

@@ -34,18 +34,18 @@
}; };
}; };
# Plex Setup # Jellyfin Setup
services.plex = { services.jellyfin = {
enable = true; enable = true;
openFirewall = true;
user = "media"; user = "media";
dataDir = "/mnt/media/plex"; dataDir = "/mnt/media/jellyfin";
cacheDir = "/mnt/media/jellyfin/cache";
}; };
# Nextcloud Setup # Nextcloud Setup
services.nextcloud = { services.nextcloud = {
enable = true; enable = true;
package = pkgs.nextcloud30; package = pkgs.nextcloud32;
configureRedis = true; configureRedis = true;
database.createLocally = true; database.createLocally = true;
autoUpdateApps.enable = true; autoUpdateApps.enable = true;
@@ -66,6 +66,13 @@
}; };
}; };
services.cron = {
enable = true;
systemCronJobs = [
"*/10 * * * * nextcloud nextcloud-occ preview:pre-generate"
];
};
# Gitea # Gitea
services.gitea = { services.gitea = {
enable = true; enable = true;
@@ -73,7 +80,6 @@
settings = { settings = {
server = { server = {
ROOT_URL = "https://git.randomctf.com"; ROOT_URL = "https://git.randomctf.com";
HTTP_ADDR = "127.0.0.1";
HTTP_PORT = 3300; HTTP_PORT = 3300;
DOMAIN = "git.randomctf.com"; DOMAIN = "git.randomctf.com";
}; };
@@ -108,6 +114,7 @@
"randomctf.com" = { "randomctf.com" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
default = true;
root = "/var/www/randomctf.com"; root = "/var/www/randomctf.com";
}; };
@@ -117,6 +124,45 @@
forceSSL = true; forceSSL = true;
}; };
# Jellyfin
"media.randomctf.com" = {
enableACME = true;
forceSSL = true;
extraConfig = ''
access_log /var/log/nginx/access.media.log;
'';
locations."/".extraConfig = ''
allow 192.168.0.0/16;
allow 10.0.0.0/8;
allow 172.16.0.0/12;
allow 127.0.0.1;
deny all;
proxy_buffering off;
proxy_pass http://localhost:8096/;
'';
};
# Kiwix
"kiwix.randomctf.com" = {
extraConfig = ''
access_log /var/log/nginx/access.kiwix.log;
'';
locations."/".extraConfig = ''
allow 192.168.0.0/16;
allow 10.0.0.0/8;
allow 172.16.0.0/12;
allow 127.0.0.1;
deny all;
proxy_buffering off;
proxy_pass http://localhost:8080/;
'';
};
# Gitea # Gitea
"git.randomctf.com" = { "git.randomctf.com" = {
enableACME = true; enableACME = true;
@@ -136,11 +182,7 @@
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
certs = { defaults.email = "admin@randomctf.com";
"randomctf.com".email = "admin@randomctf.com";
${config.services.nextcloud.hostName}.email = "admin@randomctf.com";
${config.services.gitea.settings.server.DOMAIN}.email = "admin@randomctf.com";
};
}; };
# Enable Tailscale # Enable Tailscale

View File

@@ -7,6 +7,7 @@ in {
# Conigure a static IP address. # Conigure a static IP address.
networking.useDHCP = false; networking.useDHCP = false;
networking.useNetworkd = true; networking.useNetworkd = true;
networking.enableIPv6 = false;
# Bug fix # Bug fix
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false; systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
@@ -17,7 +18,7 @@ in {
}; };
networking.nameservers = [ gateway_ip ]; networking.nameservers = [ gateway_ip ];
networking.firewall.allowedTCPPorts = open_ports ++ [9002]; networking.firewall.allowedTCPPorts = open_ports;
networking.interfaces.enp6s18.ipv4.addresses = [ networking.interfaces.enp6s18.ipv4.addresses = [
{ {
address = ip_address; address = ip_address;

View File

@@ -1,4 +1,4 @@
{ lib, ... }: { { lib, pkgs, ... }: {
imports = [ imports = [
../hardware/omen.nix ../hardware/omen.nix
@@ -18,7 +18,7 @@
# Networking # Networking
networking.hostName = "randomctf"; networking.hostName = "randomctf";
networking.nameservers = [ "192.168.100.1" "8.8.8.8" "8.8.4.4" ]; networking.nameservers = [ "192.168.100.1" "8.8.8.8" "8.8.4.4" ];
networking.firewall.allowedTCPPorts = [ 22 24800 ]; networking.firewall.allowedTCPPorts = [ 22 5060 24800 ];
# Temporary fix for service failure. # Temporary fix for service failure.
systemd.services.NetworkManager-wait-online.enable = lib.mkForce false; systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
@@ -52,10 +52,74 @@
# Ignore laptop lid closing when connected to power. # Ignore laptop lid closing when connected to power.
services.logind.lidSwitchExternalPower = "ignore"; services.logind.lidSwitchExternalPower = "ignore";
# Enable VMWare Workstation
virtualisation.vmware.host.enable = true;
# Enable bluetooth # Enable bluetooth
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
services.blueman.enable = true; services.blueman.enable = true;
# System Packages
environment.systemPackages = with pkgs; [
pinentry-gtk2
protonmail-bridge
pass
# For RTL-SDR
libusb1
rtl-sdr
gqrx
];
# For RTL-SDR
hardware.rtl-sdr.enable = true;
# Setup Pinentry
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-gtk2;
enableSSHSupport = true;
};
# Setup protonmail bridge
systemd.user.services.protonmail-bridge = {
description = "Protonmail Bridge";
after = [ "network.target" ];
wantedBy = [ "default.target" ];
path = with pkgs; [
pass
gnupg
pinentry-gtk2
];
serviceConfig = {
Restart = "always";
ExecStart = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --noninteractive";
};
};
# Setup environment for binaries that require FHS compliance.
programs.nix-ld = {
enable = true;
libraries = with pkgs; [
stdenv.cc.cc.lib
libglvnd
mesa
fontconfig
freetype
libxkbcommon
zlib
dbus
python3
xorg.libX11
xorg.libXext
xorg.libXrender
xorg.libXrandr
xorg.libXcursor
xorg.libXi
xorg.libxcb
xorg.xcbutilwm
xorg.xcbutil
xorg.xcbutilimage
xorg.xcbutilkeysyms
xorg.xcbutilrenderutil
xorg.xcbutilcursor
];
};
} }

View File

@@ -7,7 +7,7 @@
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# General setup # General setup
time.timeZone = "America/Los_Angeles"; time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8"; LC_ADDRESS = "en_US.UTF-8";

View File

@@ -4,5 +4,5 @@
isNormalUser = true; isNormalUser = true;
useDefaultShell = true; useDefaultShell = true;
description = "random"; description = "random";
extraGroups = [ "networkmanager" "wheel" "docker" ]; extraGroups = [ "networkmanager" "wheel" "docker" "dialout" "plugdev" ];
} }

View File

@@ -15,13 +15,14 @@ floating_modifier $mod
# Application hot keys # Application hot keys
bindsym $mod+Return exec "alacritty" bindsym $mod+Return exec "alacritty"
bindsym $mod+Shift+f exec "firefox" bindsym $mod+Shift+b exec "blueman-manager"
bindsym $mod+Shift+d exec "vesktop"
bindsym $mod+Shift+e exec "emacsclient -c" bindsym $mod+Shift+e exec "emacsclient -c"
bindsym $mod+Shift+d exec "discord" bindsym $mod+Shift+f exec "brave"
bindsym $mod+Shift+m exec "proton-mail"
bindsym $mod+Shift+p exec "rofi-rbw"
bindsym $mod+Shift+s exec "flameshot gui"
bindsym $mod+Shift+t exec "thunar" bindsym $mod+Shift+t exec "thunar"
bindsym $mod+Shift+p exec "flameshot gui"
# Lock screen with i3lock-fancy
bindsym $mod+Shift+x exec "i3lock-fancy" bindsym $mod+Shift+x exec "i3lock-fancy"
# kill focused window # kill focused window
@@ -43,6 +44,10 @@ bindsym $mod+Shift+k move up
bindsym $mod+Shift+j move down bindsym $mod+Shift+j move down
bindsym $mod+Shift+l move right bindsym $mod+Shift+l move right
# move entire workspace
bindsym $mod+Shift+period move workspace to output right
bindsym $mod+Shift+comma move workspace to output left
# split in horizontal orientation # split in horizontal orientation
bindsym $mod+semicolon split h bindsym $mod+semicolon split h
@@ -154,9 +159,8 @@ client.focused_inactive #333333 #222222 #888888 #292d2e #eeeeee
client.unfocused #333333 #222222 #888888 #292d2e #eeeeee client.unfocused #333333 #222222 #888888 #292d2e #eeeeee
# Auto lock the screen after X minutes # Auto lock the screen after X minutes
exec "xautolock -detectsleep -time 3 -locker i3lock-fancy" #exec "xautolock -detectsleep -time 30 -locker i3lock-fancy"
# Startup Applications # Startup Applications
exec_always --no-startup-id "$HOME/.screenlayout/launch.sh &" # setup screen layout and wallpapers exec --no-startup-id "$HOME/.screenlayout/launch.sh &" # setup screen layout and wallpapers
exec_always --no-startup-id "$HOME/.scripts/autostart_desktop.sh &" # run autostart desktop apps exec --no-startup-id "$HOME/.scripts/autostart_desktop.sh &" # run autostart desktop apps
exec_always --no-startup-id "killall polybar; polybar" # status bar

View File

@@ -11,6 +11,7 @@ disabled = #707880
width = 100% width = 100%
height = 24pt height = 24pt
radius = 6 radius = 6
monitor = ${env:MONITOR:}
; dpi = 96 ; dpi = 96

View File

@@ -0,0 +1,15 @@
import os
from urllib.request import urlopen
# load your autoconfig, use this, if the rest of your config is empty!
config.load_autoconfig()
# Set Dark Mode
config.set("colors.webpage.darkmode.enabled", False)
config.set("colors.webpage.preferred_color_scheme", "dark")
# Toggle Dark Mode
config.bind('td', 'config-cycle colors.webpage.darkmode.enabled true false')
# Fix terminal editor
config.set('editor.command', ['alacritty', '-e', 'nvim', '{file}'])

View File

@@ -438,7 +438,7 @@ When installing Vertico, the documentation mentions a few other packages that ad
:after vertico :after vertico
:config :config
(jm/leader-keys (jm/leader-keys
"pg" 'consult-grep "pg" 'consult-git-grep
"pf" 'consult-find)) "pf" 'consult-find))
#+end_src #+end_src

View File

@@ -48,9 +48,10 @@ Shortcut to goto todays org-roam dailies document.
(defun jm/org-roam-capture-today () (defun jm/org-roam-capture-today ()
(interactive) (interactive)
(jm/org-roam-goto-day 0 t)) (jm/org-roam-goto-day 0 t "t")
(delete-other-windows))
(defun jm/org-roam-goto-day (days &optional force-capture) (defun jm/org-roam-goto-day (days &optional force-capture keys)
(let* ((base-time (let* ((base-time
(if (and (jm/dailies-file-p) (not (eq days 0))) (if (and (jm/dailies-file-p) (not (eq days 0)))
(date-to-time (file-name-base (buffer-file-name))) (date-to-time (file-name-base (buffer-file-name)))
@@ -61,7 +62,7 @@ Shortcut to goto todays org-roam dailies document.
(jm/org-roam-refresh-agenda-list) (jm/org-roam-refresh-agenda-list)
(if (and (file-exists-p full-path) (not force-capture)) (if (and (file-exists-p full-path) (not force-capture))
(find-file full-path) (find-file full-path)
(org-roam-dailies--capture rel-time)))) (org-roam-dailies--capture rel-time nil keys))))
(jm/leader-keys (jm/leader-keys
"oy" '((lambda () (interactive) (jm/org-roam-goto-day -1)) :which-key "Open/create yesterday's daily notes file") "oy" '((lambda () (interactive) (jm/org-roam-goto-day -1)) :which-key "Open/create yesterday's daily notes file")

View File

@@ -80,8 +80,10 @@ This will include any language server packages and configuration.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package web-mode (use-package web-mode
:defer t :defer t
:mode "\\.html\\'" :mode ("\\.html\\'" "\\.svelte\\'")
:hook (web-mode . lsp-deferred)) :hook (web-mode . lsp-deferred)
:init
(setq web-mode-engines-alist '(("svelte" . "\\.svelte\\'"))))
#+end_src #+end_src
** JavaScript/Typescript ** JavaScript/Typescript
@@ -245,3 +247,4 @@ Nix is the language used by NixOS and the Nix package manager.
:mode "\\.nix\\'" :mode "\\.nix\\'"
:hook (nix-mode . lsp-deferred)) :hook (nix-mode . lsp-deferred))
#+end_src #+end_src

View File

@@ -36,7 +36,7 @@ This installs the org package and creates a setup function to enable/disable cer
;; Capture templates ;; Capture templates
org-capture-templates '(("i" "Inbox" entry (file jm/inbox-file) org-capture-templates '(("i" "Inbox" entry (file jm/inbox-file)
"* TODO %^{Task}\nSCHEDULED: %^t"))) "* TODO %^{Task}\nDEADLINE: %^t SCHEDULED: %^t")))
(jm/leader-keys (jm/leader-keys
"oa" '(org-agenda :which-key "Org agenda") "oa" '(org-agenda :which-key "Org agenda")
@@ -175,7 +175,9 @@ Org-roam is a plain-text knowledge management system. It brings some of Roam's m
("C-c n i" . org-roam-node-insert) ("C-c n i" . org-roam-node-insert)
("C-c n c" . org-roam-capture) ("C-c n c" . org-roam-capture)
("C-c n o" . org-id-get-create) ("C-c n o" . org-id-get-create)
("C-c n t" . jm/org-roam-capture-today) ("C-c n y" . org-roam-dailies-capture-yesterday)
("C-c n t" . org-roam-dailies-capture-today)
("C-c n k" . org-roam-dailies-capture-tomorrow)
("C-c n r" . jm/org-roam-refresh-agenda-list)) ("C-c n r" . jm/org-roam-refresh-agenda-list))
:config :config
;; Config for org-roam capture templates. ;; Config for org-roam capture templates.

View File

@@ -1,40 +1,11 @@
bw-load() { awkuniq() {
export BW_SESSION=$(cat $HOME/.bw_session) if [[ "$1" == "-c" ]]; then
} awk '{ !x[$0]++ } END { for (i in x) print x[i] "\t" i }'
else
bw-init() { awk '!x[$0]++'
if [ ! bw login --check &>/dev/null ]; then
bw login
fi fi
bw sync &>/dev/null || return 1
bw-load
if [[ "$(bw status | jq -rc .status)" == "unlocked" ]]; then
return 0
fi
bw unlock --raw > $HOME/.bw_session
bw-load
}
bw-copy() {
clipboard_cmd=""
if [[ "$(uname)" == "Linux" ]]; then
clipboard_cmd="xsel --clipboard -i"
elif [[ "$(uname)" == "Darwin" ]]; then
clipboard_cmd="pbcopy"
fi
bw-load && NODE_OPTIONS="--no-deprecation" bw get password "$1" | eval $clipboard_cmd
}
bw-clear() {
echo -n "" | xsel --clipboard
} }
bw-ssh() { bw-ssh() {
pass=$(bw-load && NODE_OPTIONS="--no-deprecation" bw get password "$1") sshpass -p "$(rbw get "$1")" ssh ${@:2}
sshpass -p "$pass" ssh ${@:2}
} }

View File

@@ -2,9 +2,12 @@
function load_script() { function load_script() {
if [ -f "$1" ]; then if [ -f "$1" ]; then
$1 bash "$1" &
fi fi
} }
load_script "$HOME/.screenlayout/wallpapers.sh" # wallpapers script # I guess I have to run this twice? Fixes wallpaper rendering images.
load_script "$HOME/.screenlayout/wallpapers.sh"
load_script "$HOME/.screenlayout/layout.sh" load_script "$HOME/.screenlayout/layout.sh"
load_script "$HOME/.screenlayout/wallpapers.sh"
load_script "$HOME/.screenlayout/polybar.sh"

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
if which xrandr; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$m polybar --reload example &
done
else
polybar --reload example &
fi

76
flake.lock generated
View File

@@ -1,53 +1,73 @@
{ {
"nodes": { "nodes": {
"home-manager": { "home": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1738188574, "lastModified": 1764536451,
"narHash": "sha256-I1gh2Ho565SDmbonmzj7sWbEgTXYyERmMT5KwuuaSDo=", "narHash": "sha256-BgtcUkBfItu9/yU14IgUaj4rYOanTOUZjUfBP20/ZB4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "6aa38ffdf77fb4250f5d832fd5a09eb99226fba7", "rev": "3fdd076e08049a9c7a83149b270440d9787d2df5",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "master", "ref": "release-25.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"nix-darwin": { "home-unstable": {
"inputs": {
"nixpkgs": [
"nix-unstable"
]
},
"locked": {
"lastModified": 1764304195,
"narHash": "sha256-bO7FN/bF6gG7TlZpKAZjO3VvfsLaPFkefeUfJJ7F/7w=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "86ff0ef506c209bb397849706e85cc3a913cb577",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nix-index-database": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1738033138, "lastModified": 1763870992,
"narHash": "sha256-qlIM8A3bdL9c6PexhpS+QyZLO9y/8a3V75HVyJgDE5Q=", "narHash": "sha256-NPyc76Wxmv/vAsXJ8F+/8fXECHYcv2YGSqdiSHp/F/A=",
"owner": "LnL7", "owner": "nix-community",
"repo": "nix-darwin", "repo": "nix-index-database",
"rev": "349a74c66c596ef97ee97b4d80a3ca61227b6120", "rev": "d7423982c7a26586aa237d130b14c8b302c7a367",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "LnL7", "owner": "nix-community",
"repo": "nix-darwin", "repo": "nix-index-database",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nix-unstable": {
"locked": { "locked": {
"lastModified": 1738021509, "lastModified": 1764242076,
"narHash": "sha256-JNUiceGsr7cVBUQxLBF1ILCe99E0qLxsVuet6GsZUuw=", "narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9db269672dbdbb519e0bd3ea24f01506c135e46f", "rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -57,10 +77,28 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs": {
"locked": {
"lastModified": 1764604385,
"narHash": "sha256-ssKbRa5FLDX/Kc0dQFUWFRt35UfdNDQD6GxvamdhGQY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "93488aad5d24df9131cbc0a25aa533dc866af473",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home": "home",
"nix-darwin": "nix-darwin", "home-unstable": "home-unstable",
"nix-index-database": "nix-index-database",
"nix-unstable": "nix-unstable",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

170
flake.nix
View File

@@ -2,127 +2,91 @@
description = "Configuration flake for RandomCTF"; description = "Configuration flake for RandomCTF";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/release-25.11";
home-manager = { home = {
url = "github:nix-community/home-manager/master"; url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-darwin = { nix-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
url = "github:LnL7/nix-darwin"; home-unstable = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nix-unstable";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, nix-darwin, home-manager, ... } @ inputs: { outputs = { self, nixpkgs, home, nix-unstable, home-unstable, nix-index-database, ... } @ inputs:
let
mkNixosConfig = hostname: modules: nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
inherit modules;
};
mkHomeConfig = username: modules: home.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
};
extraSpecialArgs = {
inherit inputs;
user = username;
};
inherit modules;
};
mkNixosUnstableConfig = hostname: modules: nix-unstable.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
inherit modules;
};
mkHomeUnstableConfig = username: modules: home-unstable.lib.homeManagerConfiguration {
pkgs = import nix-unstable {
system = "x86_64-linux";
};
extraSpecialArgs = {
inherit inputs;
user = username;
};
inherit modules;
};
in {
# Nixos Configurations # Nixos Configurations
nixosConfigurations = {
nixosConfigurations.randomctf = nixpkgs.lib.nixosSystem { randomctf = mkNixosUnstableConfig "randomctf" [ ./config/shared.nix ./config/omen.nix ];
system = "x86_64-linux"; r330-media = mkNixosConfig "r330-media" [ ./config/media.nix ];
specialArgs = { inherit inputs; }; sampledb-dev = mkNixosConfig "sampledb-dev" [ ./config/sampledb.nix ];
modules = [ r330-logging = mkNixosConfig "r330-logging" [ ./config/logging.nix ];
./config/shared.nix mindforge = mkNixosConfig "mindforge" [ ./config/ai.nix ];
./config/omen.nix
];
}; };
nixosConfigurations."r330-media" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/media.nix
];
};
nixosConfigurations."sampledb-dev" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/sampledb.nix
];
};
nixosConfigurations."r330-logging" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/logging.nix
];
};
nixosConfigurations."mindforge" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/ai.nix
];
};
# Home-Manager Configurations # Home-Manager Configurations
homeConfigurations = {
homeConfigurations.random = home-manager.lib.homeManagerConfiguration { random = mkHomeUnstableConfig "random" [
pkgs = nixpkgs.legacyPackages."x86_64-linux";
extraSpecialArgs.user = "random";
modules = [
./home/headful-nixos.nix ./home/headful-nixos.nix
./home/modules/development.nix
./home/modules/gui-apps.nix
./home/modules/hacking.nix
]; ];
};
homeConfigurations.media = home-manager.lib.homeManagerConfiguration { sampledb = mkHomeConfig "sampledb" [
pkgs = nixpkgs.legacyPackages."x86_64-linux";
extraSpecialArgs.user = "media";
modules = [
./home/headless-nixos.nix ./home/headless-nixos.nix
./home/modules/development.nix
]; ];
};
homeConfigurations.sampledb = home-manager.lib.homeManagerConfiguration { media = mkHomeConfig "media" [ ./home/headless-nixos.nix ];
pkgs = nixpkgs.legacyPackages."x86_64-linux"; logging = mkHomeConfig "logging" [ ./home/headless-nixos.nix ];
extraSpecialArgs.user = "sampledb"; mindforge = mkHomeConfig "mindforge" [ ./home/headless-nixos.nix ];
modules = [
./home/headless-nixos.nix
];
};
homeConfigurations.logging = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
extraSpecialArgs.user = "logging";
modules = [
./home/headless-nixos.nix
];
};
homeConfigurations.mindforge = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
extraSpecialArgs.user = "mindforge";
modules = [
./home/headless-nixos.nix
];
};
# Darwin Configuration
darwinConfigurations."Jadens-MacBook-Air" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = { inherit inputs; };
modules = [
./config/darwin.nix
home-manager.darwinModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jadenmaxwell = import ./home/darwin.nix;
}
];
};
homeConfigurations.jadenmaxwell = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."aarch64-darwin";
modules = [
./home/darwin.nix
];
}; };
}; };
} }

View File

@@ -14,16 +14,21 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/d8ec7c7e-ce95-432c-932d-663dc261c623"; { device = "/dev/disk/by-uuid/466b1e73-407e-48de-a2b8-f35f96bef1fd";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/1842-1672"; { device = "/dev/disk/by-uuid/0079-63AB";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };
fileSystems."/mnt/logs" = {
device = "/dev/disk/by-uuid/8e8ee0ad-8d74-486f-b33a-ed1294cb3a63";
fsType = "ext4";
};
swapDevices = [ ]; swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
@@ -31,7 +36,7 @@
# still possible to use this option, but it's recommended to use it in conjunction # 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`. # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp6s18.useDHCP = lib.mkDefault true; #networking.interfaces.enp6s19.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
} }

View File

@@ -19,12 +19,12 @@
}; };
fileSystems."/mnt/media" = fileSystems."/mnt/media" =
{ device = "/dev/disk/by-uuid/b579c911-e74c-4f03-b918-a4e5a6b764ab"; { device = "/dev/disk/by-uuid/e9df1e21-553e-43e2-bceb-8a5e274a95b7";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/mnt/files" = fileSystems."/mnt/files" =
{ device = "/dev/disk/by-uuid/f3a62e58-9556-47d7-b78b-3211f269f4ce"; { device = "/dev/disk/by-uuid/efc25f40-0cad-404b-8113-526ad5a30539";
fsType = "ext4"; fsType = "ext4";
}; };

View File

@@ -19,13 +19,13 @@
options snd-hda-intel model=dell-headset-multi options snd-hda-intel model=dell-headset-multi
''; '';
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/f4f207c5-08d5-4848-920c-76e99280b04c"; device = "/dev/disk/by-partlabel/root";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/7F2D-4654"; device = "/dev/disk/by-partlabel/EFI";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };

View File

@@ -13,13 +13,23 @@
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/8d1d0298-307f-4d9a-84f8-0434fafa0c55"; device = "/dev/disk/by-uuid/8d1d0298-307f-4d9a-84f8-0434fafa0c55";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/sampledb" = {
{ device = "/dev/disk/by-uuid/4821-12F7"; device = "/dev/disk/by-uuid/7d70bfdb-510f-4f30-969f-d4ac59175719";
fsType = "ext4";
};
fileSystems."/mnt/archive" = {
device = "/dev/disk/by-uuid/66103455-9fcd-4b5b-9735-37b85a51019d";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/4821-12F7";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };

View File

@@ -1,21 +0,0 @@
{ pkgs, ... }: {
home = {
username = "jadenmaxwell";
homeDirectory = "/Users/jadenmaxwell";
};
home.packages = with pkgs; [
gnupg
];
imports = [
./shared.nix
./modules/sketchybar.nix
./modules/aerospace.nix
./modules/neovim.nix
./modules/emacs.nix
./modules/zsh.nix
];
home.file.".config/ghostty/config".source = ../dotfiles/.config/ghostty/config;
}

View File

@@ -7,56 +7,21 @@
imports = [ imports = [
./shared.nix ./shared.nix
./modules/hacking.nix ./modules/utils.nix
./modules/networking.nix
./modules/neovim.nix ./modules/neovim.nix
./modules/emacs.nix ./modules/emacs.nix
./modules/apps.nix ./modules/tmux.nix
./modules/zsh.nix ./modules/zsh.nix
]; ];
home.packages = with pkgs; [
feh
ncdu
dconf
docker
barrier
firefox
flameshot
traceroute
pavucontrol
virt-viewer
bitwarden-cli
wireguard-tools
nextcloud-client
protonmail-desktop
nvtopPackages.full
];
services.emacs.enable = true; services.emacs.enable = true;
dconf = { home.packages = with pkgs; [
enable = true; wireguard-tools
settings = { rbw
"org/gnome/desktop/interface" = { rofi-rbw-x11
color-scheme = "prefer-dark";
};
};
};
gtk = {
enable = true;
theme = {
name = "Materia-dark";
package = pkgs.materia-theme;
};
};
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-backgroundremoval
]; ];
};
home.file = { home.file = {
".Xresources".source = ../dotfiles/.Xresources; ".Xresources".source = ../dotfiles/.Xresources;
@@ -64,6 +29,7 @@
".scripts/autostart_desktop.sh".source = ../dotfiles/.scripts/autostart_desktop.sh; ".scripts/autostart_desktop.sh".source = ../dotfiles/.scripts/autostart_desktop.sh;
".screenlayout/launch.sh".source = ../dotfiles/.screenlayout/launch.sh; ".screenlayout/launch.sh".source = ../dotfiles/.screenlayout/launch.sh;
".screenlayout/wallpapers.sh".source = ../dotfiles/.screenlayout/wallpapers.sh; ".screenlayout/wallpapers.sh".source = ../dotfiles/.screenlayout/wallpapers.sh;
".screenlayout/polybar.sh".source = ../dotfiles/.screenlayout/polybar.sh;
".config/i3/config".source = ../dotfiles/.config/i3/config; ".config/i3/config".source = ../dotfiles/.config/i3/config;
".config/rofi/config.rasi".source = ../dotfiles/.config/rofi/config.rasi; ".config/rofi/config.rasi".source = ../dotfiles/.config/rofi/config.rasi;
".config/polybar/config.ini".source = ../dotfiles/.config/polybar/config.ini; ".config/polybar/config.ini".source = ../dotfiles/.config/polybar/config.ini;

View File

@@ -1,4 +1,4 @@
{ pkgs, user, ... }: { { user, ... }: {
home = { home = {
username = "${user}"; username = "${user}";
@@ -7,13 +7,10 @@
imports = [ imports = [
./shared.nix ./shared.nix
./modules/utils.nix
./modules/networking.nix
./modules/neovim.nix ./modules/neovim.nix
./modules/tmux.nix
./modules/zsh.nix ./modules/zsh.nix
]; ];
home.packages = with pkgs; [
ncdu
traceroute
nvtopPackages.full
];
} }

View File

@@ -1,10 +0,0 @@
{pkgs, ... }: {
home.packages = with pkgs; [
vlc
typora
zoom-us
discord
libreoffice
bitwarden-desktop
];
}

View File

@@ -0,0 +1,24 @@
{ home, pkgs, ... }: {
home.packages = with pkgs; [
# C/C++
clang
gnumake
clang-tools
# Rust
rustc
cargo
cargo-edit
cargo-flamegraph
rust-analyzer
# Other
python3
ansible
];
# To prevent sysroot errors in rust-analyzer
home.sessionVariables = {
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
}

View File

@@ -1,24 +1,25 @@
{ pkgs, ... }: { { pkgs, ... }: {
home.packages = with pkgs; [ home.packages = with pkgs; [
# Build deps # Build deps
nodejs
cmake cmake
libtool libtool
# Additional packages for functionality # Additional packages for functionality
isync
ispell
texliveFull
mu mu
zip zip
unzip unzip
isync
ispell
ledger
texliveFull
# Fonts # Fonts
maple-mono maple-mono.truetype
# LSP Servers # LSP Servers
nil nil
ccls ccls
rust-analyzer
yaml-language-server yaml-language-server
python3Packages.python-lsp-server python3Packages.python-lsp-server
nodePackages.typescript-language-server nodePackages.typescript-language-server
@@ -26,16 +27,9 @@
]; ];
programs = { programs = {
# For integration with shell.nix files
direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
emacs = { emacs = {
enable = true; enable = true;
package = pkgs.emacs29; package = pkgs.emacs30;
extraPackages = epkgs: with epkgs; [ extraPackages = epkgs: with epkgs; [
mu4e mu4e
vterm vterm
@@ -44,15 +38,4 @@
]; ];
}; };
}; };
home.file = {
".emacs".source = ../../dotfiles/.emacs;
".emacs.d/config.org".source = ../../dotfiles/.emacs.d/config.org;
".emacs.d/terminal.org".source = ../../dotfiles/.emacs.d/terminal.org;
".emacs.d/functions.org".source = ../../dotfiles/.emacs.d/functions.org;
".emacs.d/email.org".source = ../../dotfiles/.emacs.d/email.org;
".emacs.d/org.org".source = ../../dotfiles/.emacs.d/org.org;
".emacs.d/lsp.org".source = ../../dotfiles/.emacs.d/lsp.org;
".mbsyncrc".source = ../../dotfiles/.mbsyncrc;
};
} }

57
home/modules/gui-apps.nix Normal file
View File

@@ -0,0 +1,57 @@
{pkgs, ... }: {
home.packages = with pkgs; [
feh
vlc
dconf
brave
vesktop
zoom-us
twinkle
audacity
flameshot
libreoffice
pavucontrol
easyeffects
virt-viewer
nextcloud-client
protonmail-desktop
kdePackages.okular
];
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-backgroundremoval
];
};
dconf = {
enable = true;
settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
};
gtk = {
enable = true;
theme = {
name = "Materia-dark";
package = pkgs.materia-theme;
};
};
xdg.mimeApps = {
enable = true;
defaultApplications = {
"text/html" = "brave.desktop";
"x-scheme-handler/http" = "brave-browser.desktop";
"x-scheme-handler/https" = "brave-browser.desktop";
"x-scheme-handler/about" = "brave-browser.desktop";
"x-scheme-handler/unknown" = "brave-browser.desktop";
"application/pdf" = "okularApplication_pdf.desktop";
"text/plain" = "emacsclient.desktop";
};
};
}

View File

@@ -1,43 +1,51 @@
{ lib, config, pkgs, ... }: { { lib, config, pkgs, ... }: {
# Hacking specific packages. # Hacking specific packages.
home.packages = (with pkgs; [ home.packages = with pkgs; [
gdb # Utilities
yara imhex
rlwrap
openssl
inetutils
# Enumeration
nmap nmap
john
ffuf ffuf
amass amass
nikto
samba
nuclei
rlwrap
sqlmap
wpscan
ghidra
pwndbg
strace
strace
openssl
remmina
netexec
pwntools
openldap
rustscan rustscan
inetutils
wireshark
thc-hydra thc-hydra
exploitdb
responder
burpsuite burpsuite
feroxbuster
# Vulnerability Scanning
nikto
nuclei
wpscan
sqlmap
exploitdb
# Windows Exploitation
samba
remmina
openldap
responder
evil-winrm evil-winrm
cifs-utils cifs-utils
feroxbuster
# Reverse Engineering
gdb
yara
strace
ghidra
exiftool
pwntools
flare-floss
# Wordlists
(wordlists.override { (wordlists.override {
lists = with pkgs; [ lists = with pkgs; [
rockyou rockyou
seclists seclists
]; ];
}) })
]); ];
} }

View File

@@ -0,0 +1,14 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
# Network tools
dig
iftop
iperf
tcpdump
ethtool
wireshark
traceroute
];
}

9
home/modules/tmux.nix Normal file
View File

@@ -0,0 +1,9 @@
{ pkgs, lib, config, ... }: let
mypkgs = import ../../packages/all-packages.nix { inherit pkgs lib config; };
in {
home.packages = with pkgs; [ tmux ];
home.file = {
".tmux/plugins/tpm".source = "${mypkgs.tpm}";
".tmux.conf".source = ../../dotfiles/.tmux.conf;
};
}

52
home/modules/utils.nix Normal file
View File

@@ -0,0 +1,52 @@
{ pkgs, inputs, ... }: {
home.packages = with pkgs; [
# Nix specific utilities
manix
direnv
rippkgs
nix-tree
nix-init
patchelf
# Utilities
jq
yq
bc
duf
cava
ncdu
file
dysk
wget
curl
btop
dive
dust
timer
p7zip
yt-dlp
ffmpeg
sshpass
httrack
ripgrep
openvpn
xclicker
pciutils
fastfetch
nvtopPackages.full
# Encryption Tools
#age
#cryfs
];
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
# Install comma
imports = [ inputs.nix-index-database.homeModules.nix-index ];
programs.nix-index-database.comma.enable = true;
}

View File

@@ -4,7 +4,25 @@
meslo-lgs-nf meslo-lgs-nf
]; ];
programs.zsh = { programs = {
zoxide.enable = true;
eza.enable = true;
tealdeer = {
enable = true;
settings = {
updates.auto_update = true;
};
};
atuin = {
enable = true;
enableZshIntegration = true;
settings = {
enter_accept = false;
filter_mode = "host";
filter_mode_shell_up_key_binding = "session";
};
};
zsh = {
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
autosuggestion.enable = true; autosuggestion.enable = true;
@@ -14,8 +32,12 @@
shellAliases = { shellAliases = {
cd = "z"; cd = "z";
ls = "eza"; ls = "eza";
awkuniq = "sort | uniq"; mvi = "mv -t ~/Nextcloud/INBOX";
sdb = "sdb-client";
open = "xdg-open";
reload = "source ~/.zshrc";
histogram = "awkuniq -c | sort -nr"; histogram = "awkuniq -c | sort -nr";
start-day = "emacsclient -c -n -e '(jm/org-roam-capture-today)'";
json-less = "jq -C . | less -R"; json-less = "jq -C . | less -R";
csv2json = "python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))'"; csv2json = "python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))'";
@@ -31,17 +53,12 @@
mindforge = "ssh mindforge@mindforge.randomctf.local"; mindforge = "ssh mindforge@mindforge.randomctf.local";
# Nix Specific aliases # Nix Specific aliases
update-darwin = "darwin-rebuild switch --flake ~/dotfiles";
update-config = "sudo nixos-rebuild switch --flake ~/dotfiles"; update-config = "sudo nixos-rebuild switch --flake ~/dotfiles";
update-home = "home-manager switch --flake ~/dotfiles"; update-home = "home-manager switch --flake ~/dotfiles";
update-all = "update-config && update-home"; update-all = "update-config && update-home";
}; };
initExtraBeforeCompInit = '' initContent = ''
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
'';
initExtra = ''
export PATH=$PATH:~/.cargo/bin export PATH=$PATH:~/.cargo/bin
function .. { cd .. } function .. { cd .. }
function ... { cd ../.. } function ... { cd ../.. }
@@ -50,13 +67,11 @@
function ...... { cd ../../../../../.. } function ...... { cd ../../../../../.. }
function ....... { cd ../../../../../../.. } function ....... { cd ../../../../../../.. }
if [[ "$(uname)" == "Darwin" ]]; then
source <(/opt/homebrew/bin/brew shellenv)
fi
if [[ -n "$SSH_CONNECTION" && "$TERM" == "ghostty" ]]; then if [[ -n "$SSH_CONNECTION" && "$TERM" == "ghostty" ]]; then
export TERM="xterm-256color" export TERM="xterm-256color"
fi fi
source ~/dotfiles/bash-scripts/aliases.sh
''; '';
plugins = [ plugins = [
@@ -78,6 +93,10 @@
{ name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; }
]; ];
}; };
};
};
home.file = {
".functions.zsh".source = ../../dotfiles/.functions.zsh;
}; };
} }

View File

@@ -1,67 +1,22 @@
{ lib, config, pkgs, ... }: { options, ... }: {
let
mypkgs = import ../packages/all-packages.nix {
inherit pkgs lib config;
};
in {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
home.packages = with pkgs; [
# Nix specific utilities
manix
nix-tree
# Utilities
jq
bc
file
wget
curl
tmux
btop
iftop
p7zip
sshpass
ripgrep
openvpn
pciutils
fastfetch
# Network tools
dig
iperf
tcpdump
ethtool
# Dev tools
clang
clang-tools
cargo
python3
gnumake
ansible
];
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
zoxide.enable = true; git = if builtins.hasAttr "settings" options.programs.git then {
eza.enable = true; enable = true;
fzf.enable = true; settings.user = {
name = "Random936";
git = { email = "randomdude936@gmail.com";
};
} else {
enable = true; enable = true;
userName = "Random936"; userName = "Random936";
userEmail = "randomdude936@gmail.com"; userEmail = "randomdude936@gmail.com";
}; };
}; };
home.file = { home.stateVersion = "25.05";
".functions.zsh".source = ../dotfiles/.functions.zsh;
".tmux/plugins/tpm".source = "${mypkgs.tpm}";
".tmux.conf".source = ../dotfiles/.tmux.conf;
};
home.stateVersion = "24.05";
} }

View File

@@ -1,3 +1,4 @@
{ pkgs, lib, config, ... }: rec { { pkgs, lib, config, ... }: rec {
tpm = pkgs.callPackage ./tpm {}; tpm = pkgs.callPackage ./tpm {};
binaryninja = pkgs.callPackage ./binaryninja {};
} }

View File

@@ -0,0 +1,99 @@
{
autoPatchelfHook,
copyDesktopItems,
dbus,
fetchurl,
fontconfig,
freetype,
lib,
libGLU,
libxkbcommon,
makeDesktopItem,
stdenv,
unzip,
wayland,
xcbutilimage,
xcbutilkeysyms,
xcbutilrenderutil,
xcbutilwm,
openssl,
qt6,
}:
stdenv.mkDerivation rec {
pname = "binaryninja";
version = "5.1.8104";
src = ./binaryninja_linux_stable_personal.zip;
icon = fetchurl {
url = "https://raw.githubusercontent.com/Vector35/binaryninja-api/448f40be71dffa86a6581c3696627ccc1bdf74f2/docs/img/logo.png";
hash = "sha256-TzGAAefTknnOBj70IHe64D6VwRKqIDpL4+o9kTw0Mn4=";
};
desktopItems = [
(makeDesktopItem {
name = "com.vector35.binaryninja";
desktopName = "Binary Ninja Personal";
comment = "A Reverse Engineering Platform";
exec = "binaryninja";
icon = "binaryninja";
mimeTypes = [
"application/x-binaryninja"
"x-scheme-handler/binaryninja"
];
categories = [ "Utility" ];
})
];
nativeBuildInputs = [
unzip
autoPatchelfHook
copyDesktopItems
qt6.wrapQtAppsHook
];
buildInputs = [
dbus
fontconfig
freetype
libGLU
libxkbcommon
stdenv.cc.cc.lib
wayland
xcbutilimage
xcbutilkeysyms
xcbutilrenderutil
xcbutilwm
openssl
qt6.qtbase
qt6.qtdeclarative
qt6.qtshadertools
qt6.qtsvg
];
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -R . $out/
mkdir $out/bin
ln -s $out/binaryninja $out/bin/binaryninja
install -Dm644 ${icon} $out/share/icons/hicolor/256x256/apps/binaryninja.png
runHook postInstall
'';
meta = {
changelog = "https://binary.ninja/changelog/#${lib.replaceStrings [ "." ] [ "-" ] version}";
description = "Interactive decompiler, disassembler, debugger";
homepage = "https://binary.ninja/";
license = {
fullName = "Binary Ninja Personal Software License";
url = "https://docs.binary.ninja/about/license.html#non-commercial-student-license-named";
free = false;
};
mainProgram = "binaryninja";
platforms = [ "x86_64-linux" ];
};
}