From 5d40f2db72453f3bbea3b5eaaa4a994de8a9ce23 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Wed, 9 Apr 2025 10:36:20 -0700 Subject: [PATCH] here's some CTF prep --- configuration-nixos.nix | 3 + configuration.nix | 185 ++++++++++++++++++++++------------------ 2 files changed, 103 insertions(+), 85 deletions(-) diff --git a/configuration-nixos.nix b/configuration-nixos.nix index 341153f..12d18f5 100644 --- a/configuration-nixos.nix +++ b/configuration-nixos.nix @@ -30,6 +30,8 @@ in { environment.systemPackages = with pkgs; [ strace + rr + qemu-user # language servers nil @@ -48,6 +50,7 @@ in { programs = { virt-manager.enable = true; + nix-ld.enable = true; }; services.zfs.zed = { diff --git a/configuration.nix b/configuration.nix index acd338f..c3169fe 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,100 +1,115 @@ { config, lib, pkgs, ... }: -{ - imports = [ ./overlays/packages.nix ./configuration-cross.nix ]; - nixpkgs.config.allowUnfree = true; - - nix.settings.extra-experimental-features = "nix-command flakes"; - nix.settings.trusted-users = [ "audrey" ]; - nix.settings.max-jobs = 1; - nix.settings.cores = 0; - nix.settings.secret-key-files = [ "/var/lib/nix/binary-cache-key" ]; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - # Configure keymap in X11 - services.xserver.xkb.layout = "us"; - services.xserver.xkb.options = "caps:escape"; - - users.defaultUserShell = pkgs.zsh; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.audrey = { - uid = 1000; - description = "Audrey Dutcher"; - isNormalUser = true; - extraGroups = [ "wheel" "docker" ]; - openssh.authorizedKeys.keyFiles = [ ./dotfiles/authorized_keys ]; +let rhelmot = config.rhelmot; +in { + options.rhelmot = { + globalPythonPackages = lib.mkOption { + type = with lib.types; listOf (functionTo (listOf package)); + default = []; + description = "python packages (p: with p; [ x ]) to include in the global python environment"; + }; }; + imports = [ ./overlays/packages.nix ./configuration-cross.nix ]; + config = { + nixpkgs.config.allowUnfree = true; - environment.systemPackages = with pkgs; [ - wget - ripgrep - fd - curl - btop - file - patchelf - gdb - p7zip - unzip + nix.settings.extra-experimental-features = "nix-command flakes repl-flake"; + nix.settings.trusted-users = [ "audrey" ]; + nix.settings.max-jobs = 1; + nix.settings.cores = 0; + nix.settings.secret-key-files = [ "/var/lib/nix/binary-cache-key" ]; - (python3.withPackages (p: with p; [ + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + # Configure keymap in X11 + services.xserver.xkb.layout = "us"; + services.xserver.xkb.options = "caps:escape"; + + users.defaultUserShell = pkgs.zsh; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.audrey = { + uid = 1000; + description = "Audrey Dutcher"; + isNormalUser = true; + extraGroups = [ "wheel" "docker" ]; + openssh.authorizedKeys.keyFiles = [ ./dotfiles/authorized_keys ]; + }; + + environment.systemPackages = with pkgs; [ + wget + ripgrep + fd + curl + btop + file + patchelf + gdb + p7zip + unzip + foremost + binwalk + (python3.withPackages (p: lib.concatMap (pl: pl p) rhelmot.globalPythonPackages)) + ]; + + rhelmot.globalPythonPackages = [ (p: with p; [ virtualenvwrapper pylint pytest ipdb ipython - ])) - ]; + nclib + pyyaml + ]) ]; - programs = { - zsh = { - enable = true; - enableCompletion = true; - syntaxHighlighting.enable = true; - vteIntegration = true; - enableLsColors = true; - histSize = 10000; - promptInit = '' - . ${pkgs.python3Packages.virtualenvwrapper}/bin/virtualenvwrapper.sh - '' + builtins.readFile ./dotfiles/zsh-prompt.sh; - shellInit = builtins.readFile ./dotfiles/zsh-init.sh; - shellAliases = { - grep = "grep --color=auto"; - egrep = "egrep --color=auto"; - objdump = "objdump -M intel"; - gits = "git status"; - pag = "ps aux | grep -v grep | grep -i"; - hd = "hexdump -C"; - man = "MAN_POSIXLY_CORRECT=1 man"; - nose = "pytest -v --capture=no --pdbcls=IPython.terminal.debugger:TerminalPdb"; - mkvirtualenv = "mkvirtualenv -r /etc/venv-default.txt"; - }; - }; - tmux = { - enable = true; - extraConfig = builtins.readFile ./dotfiles/tmux.conf; - }; - direnv.enable = true; - htop.enable = true; - git = { - enable = true; - lfs.enable = true; - config = { - user.email = "audrey@rhelmot.io"; - user.name = "Audrey Dutcher"; - init.defaultBranch = "main"; - blame.markUnblamableLines = true; - credential.helper = "store"; - url."ssh://git@".insteadOf = "git://"; + programs = { + zsh = { + enable = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + vteIntegration = true; + enableLsColors = true; + histSize = 10000; + promptInit = '' + . ${pkgs.python3Packages.virtualenvwrapper}/bin/virtualenvwrapper.sh + '' + builtins.readFile ./dotfiles/zsh-prompt.sh; + shellInit = builtins.readFile ./dotfiles/zsh-init.sh; + shellAliases = { + grep = "grep --color=auto"; + egrep = "egrep --color=auto"; + objdump = "objdump -M intel"; + gits = "git status"; + pag = "ps aux | grep -v grep | grep -i"; + hd = "hexdump -C"; + man = "MAN_POSIXLY_CORRECT=1 man"; + nose = "pytest -v --capture=no --pdbcls=IPython.terminal.debugger:TerminalPdb"; + mkvirtualenv = "mkvirtualenv -r /etc/venv-default.txt"; + }; + }; + tmux = { + enable = true; + extraConfig = builtins.readFile ./dotfiles/tmux.conf; + }; + direnv.enable = true; + htop.enable = true; + git = { + enable = true; + lfs.enable = true; + config = { + user.email = "audrey@rhelmot.io"; + user.name = "Audrey Dutcher"; + init.defaultBranch = "main"; + blame.markUnblamableLines = true; + credential.helper = "store"; + url."ssh://git@".insteadOf = "git://"; + }; }; }; + + environment.etc."gdb/gdbinit".source = ./dotfiles/gdb-init.gdb; + environment.etc."venv-default.txt".source = ./dotfiles/venv-default.txt; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; }; - - environment.etc."gdb/gdbinit".source = ./dotfiles/gdb-init.gdb; - environment.etc."venv-default.txt".source = ./dotfiles/venv-default.txt; - - # Enable the OpenSSH daemon. - services.openssh.enable = true; }