From e833c13c177288b2a7b9168a784e0e6562c025b6 Mon Sep 17 00:00:00 2001 From: Emile Date: Thu, 19 Sep 2024 10:48:16 +0200 Subject: big format using nixfmt --- flake.nix | 323 +++--- nix/hosts/caladan/aliases.nix | 5 +- nix/hosts/caladan/darwin-configuration.nix | 45 +- nix/hosts/caladan/home_emile.nix | 53 +- nix/hosts/caladan/home_hydra.nix | 24 +- nix/hosts/chusuk/configuration.nix | 30 +- nix/hosts/chusuk/hardware-configuration.nix | 40 +- nix/hosts/corrino/configuration.nix | 203 ++-- nix/hosts/corrino/default.nix | 4 +- nix/hosts/corrino/emile.space.nix | 2 +- nix/hosts/corrino/hardware-configuration.nix | 36 +- nix/hosts/corrino/ports.nix | 76 +- nix/hosts/corrino/www/cs.emile.space.nix | 85 +- nix/hosts/corrino/www/ctf.emile.space.nix | 4 +- nix/hosts/corrino/www/db.emile.space.nix | 2 +- nix/hosts/corrino/www/git/cgit.nix | 1150 ++++++++++---------- nix/hosts/corrino/www/git/default.nix | 4 +- nix/hosts/corrino/www/git/git.nix | 44 +- nix/hosts/corrino/www/grafana.emile.space.nix | 8 +- nix/hosts/corrino/www/grafana_full.emile.space.nix | 17 +- nix/hosts/corrino/www/hydra.emile.space.nix | 9 +- nix/hosts/corrino/www/irc.emile.space.nix | 280 ++--- nix/hosts/corrino/www/magic-hash.emile.space.nix | 4 +- nix/hosts/corrino/www/netbox.emile.space.nix | 3 +- nix/hosts/corrino/www/nix-cache/default.nix | 4 +- .../www/nix-cache/nix-cache.emile.space.nix | 54 +- nix/hosts/corrino/www/photo/default.nix | 8 +- nix/hosts/corrino/www/s3.emile.space.nix | 22 +- nix/hosts/corrino/www/social.emile.space.nix | 129 ++- nix/hosts/corrino/www/sso.emile.space.nix | 418 ++++--- nix/hosts/corrino/www/tickets.emile.space.nix | 5 +- nix/hosts/corrino/www/tmp.emile.space.nix | 2 +- nix/hosts/gamont/configuration.nix | 30 +- nix/hosts/hacknix/burpsuitepro/default.nix | 3 +- nix/hosts/hacknix/configuration.nix | 349 +++--- nix/hosts/hacknix/hardware-configuration.nix | 33 +- nix/hosts/hacknix/i3-config.nix | 268 ++--- nix/hosts/hacknix/overlay/default.nix | 2 +- nix/hosts/hacknix/pkgs/helix-2303/default.nix | 18 +- nix/hosts/hacknix/pkgs/radare2-5.8.4/default.nix | 116 +- nix/hosts/lampadas/configuration.nix | 57 +- nix/hosts/lampadas/hardware-configuration.nix | 71 +- nix/hosts/lernaeus/configuration.nix | 35 +- nix/hosts/lernaeus/hardware-configuration.nix | 55 +- nix/hosts/mail/configuration.nix | 17 +- nix/hosts/mail/hardware-configuration.nix | 29 +- nix/hosts/mail/mail.nix | 11 +- nix/hosts/pi1/default.nix | 12 +- nix/hosts/pi2/default.nix | 8 +- nix/lib/default.nix | 27 +- nix/lib/flake-helper.nix | 382 ++++--- nix/modules/ports/default.nix | 9 +- nix/modules/r2wars-web/default.nix | 11 +- nix/modules/vm/default.nix | 44 +- nix/pkgs/overlay.nix | 5 +- nix/pkgs/r2wars-web/default.nix | 10 +- nix/pkgs/vokobe/flaaaaake.nix | 38 +- nix/templates/ctf/flake.nix | 47 +- nix/templates/python3/flake.nix | 55 +- nix/users/emile/keys.nix | 4 +- secrets.nix | 94 +- 61 files changed, 2633 insertions(+), 2300 deletions(-) diff --git a/flake.nix b/flake.nix index 0b48f3f..cfaf941 100644 --- a/flake.nix +++ b/flake.nix @@ -27,170 +27,187 @@ hefe-internal.url = "git+ssh://git@git.emile.space/hefe-internal"; }; - outputs = { - self, - nixpkgs, nixpkgs-unstable, # general packages - darwin, # darwin related stuff - deploy-rs, # deploy the hosts - agenix, # store secrets crypted using age - home-manager, # manage my home envs - naersk, # build rust stuff - hefe-internal, # internal tooling - ... }@inputs: - let - lib = import ./nix/lib inputs; - helper = lib.flake-helper; - in { - - hosts = { - caladan = { - system = "aarch64-darwin"; - sshUser = "hydra"; - homeManagerEnable = true; - description = "macbook air"; - # nix run https://github.com/LnL7/nix-darwin/archive/master.tar.gz -- switch --flake .#caladan - }; - corrino = { - system = "x86_64-linux"; - ip = "corrino"; - description = "Hetzner AX41 dual 512GB NVME"; - modules = [ hefe-internal.nixosModules.corrino ]; - }; - chusuk = { - # ip = "chusuk.pinto-pike.ts.net"; - system = "x86_64-linux"; - description = "lenovo t480"; - }; - hacknix = { - # ip = "hacknix.pinto-pike.ts.net"; # clone repo and deploy within - system = "x86_64-linux"; - description = "hacking vm"; - }; - mail = { - # ip = "mail.pinto-pike.ts.net"; # clone repo and deploy within - system = "x86_64-linux"; - description = "mail server"; - }; + outputs = + { + self, + nixpkgs, + nixpkgs-unstable, # general packages + darwin, # darwin related stuff + deploy-rs, # deploy the hosts + agenix, # store secrets crypted using age + home-manager, # manage my home envs + naersk, # build rust stuff + hefe-internal, # internal tooling + ... + }@inputs: + let + lib = import ./nix/lib inputs; + helper = lib.flake-helper; + in + { + + hosts = { + caladan = { + system = "aarch64-darwin"; + sshUser = "hydra"; + homeManagerEnable = true; + description = "macbook air"; + # nix run https://github.com/LnL7/nix-darwin/archive/master.tar.gz -- switch --flake .#caladan + }; + corrino = { + system = "x86_64-linux"; + ip = "corrino"; + description = "Hetzner AX41 dual 512GB NVME"; + modules = [ hefe-internal.nixosModules.corrino ]; + }; + chusuk = { + # ip = "chusuk.pinto-pike.ts.net"; + system = "x86_64-linux"; + description = "lenovo t480"; + }; + hacknix = { + # ip = "hacknix.pinto-pike.ts.net"; # clone repo and deploy within + system = "x86_64-linux"; + description = "hacking vm"; + }; + mail = { + # ip = "mail.pinto-pike.ts.net"; # clone repo and deploy within + system = "x86_64-linux"; + description = "mail server"; + }; - #kolhar = {}; # nixos vm on caladan - #hagal = {}; # apple tv - - lampadas = { - system = "x86_64-linux"; # 4c4t (intel n100), 32GB RAM - description = "NAS"; - }; - # palma = { - # description = "palma bmc"; - # }; + #kolhar = {}; # nixos vm on caladan + #hagal = {}; # apple tv - lernaeus = { - system = "x86_64-linux"; # 8c16t (AMD ryzen 5 5600g), 32GB RAM - description = "VM Host"; + lampadas = { + system = "x86_64-linux"; # 4c4t (intel n100), 32GB RAM + description = "NAS"; + }; + # palma = { + # description = "palma bmc"; + # }; + + lernaeus = { + system = "x86_64-linux"; # 8c16t (AMD ryzen 5 5600g), 32GB RAM + description = "VM Host"; + }; + # parmentier = { + # description = "lernaeus bmc"; + # }; + + # lankiveil = { + # system = "x86_64-linux"; # ???, ???, RTX A2000 + # description = ""; + # }; + # poritrin = { + # description = "lankiveil bmc"; + # }; + + # kaitain = {}; + # ecaz = {}; + # gamont = {}; + + # futher names: https://neoencyclopedia.fandom.com/wiki/List_of_Dune_planets + # Muritan + # Naraj + # Palma + # Parmentier + # Poritrin + # Richese + # Romo + # Rossak + # Sikun + # Synchrony + # Tleilax + # Tupile + # Zanovar }; - # parmentier = { - # description = "lernaeus bmc"; - # }; - - # lankiveil = { - # system = "x86_64-linux"; # ???, ???, RTX A2000 - # description = ""; - # }; - # poritrin = { - # description = "lankiveil bmc"; - # }; - - # kaitain = {}; - # ecaz = {}; - # gamont = {}; - - # futher names: https://neoencyclopedia.fandom.com/wiki/List_of_Dune_planets - # Muritan - # Naraj - # Palma - # Parmentier - # Poritrin - # Richese - # Romo - # Rossak - # Sikun - # Synchrony - # Tleilax - # Tupile - # Zanovar - }; - nixosConfigurations = helper.mapToNixosConfigurations self.hosts; - darwinConfigurations = helper.mapToDarwinConfigurations self.hosts; + nixosConfigurations = helper.mapToNixosConfigurations self.hosts; + darwinConfigurations = helper.mapToDarwinConfigurations self.hosts; - nixosModules = { - x86_64-linux = import ./nix/modules/x86_64-linux.nix; - default = self.nixosModules.x86_64-linux; - }; + nixosModules = { + x86_64-linux = import ./nix/modules/x86_64-linux.nix; + default = self.nixosModules.x86_64-linux; + }; - overlays = { - emile = import ./nix/pkgs/overlay.nix; - default = self.overlays.x86_64-linux; - unstable = final: prev: { - unstable = import nixpkgs-unstable { - system = "x86_64-linux"; - config.allowUnfree = true; + overlays = { + emile = import ./nix/pkgs/overlay.nix; + default = self.overlays.x86_64-linux; + unstable = final: prev: { + unstable = import nixpkgs-unstable { + system = "x86_64-linux"; + config.allowUnfree = true; + }; }; }; - }; - deploy.nodes = helper.mapToDeployRsConfiguration self.hosts; - deploy.autoRollback = true; - - packages = - nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-darwin" ] (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ - - (if system == "x86_64-linux" then self.overlays.x86_64-linux - else if system == "aarch64-darwin" then self.overlays.aarch64-darwin - else null) - # self.overlays.emile - - # some arguments for packages - (_: _: { inherit naersk; }) - ]; + deploy.nodes = helper.mapToDeployRsConfiguration self.hosts; + deploy.autoRollback = true; + + packages = + nixpkgs.lib.genAttrs + [ + "x86_64-linux" + "aarch64-darwin" + ] + ( + system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ + + ( + if system == "x86_64-linux" then + self.overlays.x86_64-linux + else if system == "aarch64-darwin" then + self.overlays.aarch64-darwin + else + null + ) + # self.overlays.emile + + # some arguments for packages + (_: _: { inherit naersk; }) + ]; + }; + in + { + inherit (pkgs) + vokobe + r2wars-web + # emu-riscv + # emu-mips + # emu-x86_64 + ; + } + ); + + hydraJobs = { + inherit (self) packages; + nixosConfigurations = helper.buildHosts self.nixosConfigurations; }; - in { - inherit (pkgs) - vokobe - r2wars-web - # emu-riscv - # emu-mips - # emu-x86_64 - ; - }); - - hydraJobs = { - inherit (self) packages; - nixosConfigurations = helper.buildHosts self.nixosConfigurations; - }; - templates = { - # ; nix nix registry add hefe /Users/emile/Documents/hefe - # ; nix flake init -t hefe#ctf - ctf = { - description = "A basic ctf env with pwn, rev, ... tools"; - path = ./nix/templates/ctf; - welcomeText = '' - # A basic CTF env - ## Intended usage - The intended usage of this flake is... - - ## More info - - [Rust language](https://www.rust-lang.org/) - - [Rust on the NixOS Wiki](https://nixos.wiki/wiki/Rust) - - ... - ''; + templates = { + # ; nix nix registry add hefe /Users/emile/Documents/hefe + # ; nix flake init -t hefe#ctf + ctf = { + description = "A basic ctf env with pwn, rev, ... tools"; + path = ./nix/templates/ctf; + welcomeText = '' + # A basic CTF env + ## Intended usage + The intended usage of this flake is... + + ## More info + - [Rust language](https://www.rust-lang.org/) + - [Rust on the NixOS Wiki](https://nixos.wiki/wiki/Rust) + - ... + ''; + }; }; - }; - # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; - }; + # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; + }; } diff --git a/nix/hosts/caladan/aliases.nix b/nix/hosts/caladan/aliases.nix index 58c224e..a48d403 100644 --- a/nix/hosts/caladan/aliases.nix +++ b/nix/hosts/caladan/aliases.nix @@ -24,8 +24,7 @@ "........" = "cd ../../../../../../.."; grep = "grep --color=auto"; - nix-stray-roots = '' - nix-store --gc --print-roots | egrep -v "^(/nix/var|/run/w+-system|{memory)"''; + nix-stray-roots = ''nix-store --gc --print-roots | egrep -v "^(/nix/var|/run/w+-system|{memory)"''; holdmybeer = "sudo "; @@ -44,7 +43,7 @@ nmap_check_for_vulns = "nmap --script = vuln"; nmap_full_udp = "sudo nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443,3389 "; nmap_traceroute = "sudo nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute "; - nmap_full_with_scripts = "sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all " ; + nmap_full_with_scripts = "sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all "; nmap_web_safe_osscan = "sudo nmap -p 80,443 -O -v --osscan-guess --fuzzy "; nmap_ping_scan = "nmap -n -sP"; diff --git a/nix/hosts/caladan/darwin-configuration.nix b/nix/hosts/caladan/darwin-configuration.nix index 2461fd2..597ee1a 100644 --- a/nix/hosts/caladan/darwin-configuration.nix +++ b/nix/hosts/caladan/darwin-configuration.nix @@ -1,9 +1,7 @@ { pkgs, lib, ... }: { - imports = [ - ./overlay.nix - ]; + imports = [ ./overlay.nix ]; users.users.emile = { name = "emile"; @@ -31,15 +29,21 @@ nix = { useDaemon = true; package = pkgs.nixFlakes; - extraOptions = '' - builders-use-substitutes = true - auto-optimise-store = true - '' + lib.optionalString (pkgs.system == "aarch64-darwin") '' - extra-platforms = x86_64-darwin aarch64-darwin - ''; + extraOptions = + '' + builders-use-substitutes = true + auto-optimise-store = true + '' + + lib.optionalString (pkgs.system == "aarch64-darwin") '' + extra-platforms = x86_64-darwin aarch64-darwin + ''; settings = { - trusted-users = [ "root" "hydra" "emile" ]; + trusted-users = [ + "root" + "hydra" + "emile" + ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" @@ -52,12 +56,15 @@ "https://cache.garnix.io" ]; - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; }; distributedBuilds = true; - buildMachines = [ + buildMachines = [ { hostName = "corrino.emile.space"; system = "x86_64-linux"; @@ -75,9 +82,14 @@ # cat /etc/nix/machines # root@corrino x86_64-linux /home/nix/.ssh/id_ed25519 8 1 kvm,benchmark - supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + ]; mandatoryFeatures = [ ]; - } + } ]; }; @@ -92,7 +104,10 @@ environment = { systemPackages = [ ]; # set via home-manager - shells = with pkgs; [ bashInteractive zsh ]; + shells = with pkgs; [ + bashInteractive + zsh + ]; }; } diff --git a/nix/hosts/caladan/home_emile.nix b/nix/hosts/caladan/home_emile.nix index ee6c64b..c700da6 100644 --- a/nix/hosts/caladan/home_emile.nix +++ b/nix/hosts/caladan/home_emile.nix @@ -14,7 +14,7 @@ # let home-manager install and manage itself home-manager.enable = true; - direnv = { + direnv = { enable = true; nix-direnv.enable = true; }; @@ -33,7 +33,11 @@ # enableAutosuggestions = true; oh-my-zsh = { enable = true; - plugins = [ "git" "web-search" "urltools" ]; + plugins = [ + "git" + "web-search" + "urltools" + ]; }; defaultKeymap = "viins"; @@ -59,11 +63,12 @@ emacs = { enable = true; package = pkgs.emacs; - extraPackages = epkgs: with epkgs; [ - nix-mode - magit - meow - ]; + extraPackages = + epkgs: with epkgs; [ + nix-mode + magit + meow + ]; extraConfig = '' (setq standard-indent 2) @@ -407,16 +412,30 @@ }; home.packages = with pkgs; [ - coreutils mpv + coreutils + mpv # terminal foo # kitty - jq ripgrep fd eza lsd tree broot - du-dust mktemp htop rsync - p7zip imagemagick binwalk lftp + jq + ripgrep + fd + eza + lsd + tree + broot + du-dust + mktemp + htop + rsync + p7zip + imagemagick + binwalk + lftp graphviz - git tig + git + tig # nix related tools deploy-rs @@ -442,7 +461,8 @@ yarr # go foo - go delve + go + delve # c foo cmake @@ -458,7 +478,7 @@ # qemu tooling qemu - sphinx #docs + sphinx # docs virt-manager # lisp foo @@ -468,7 +488,8 @@ clisp # infrastructure as code foo - terraform ansible + terraform + ansible portmidi @@ -480,6 +501,6 @@ # blender - # ] ++ lib.optionals stdenv.isDarwin [ + # ] ++ lib.optionals stdenv.isDarwin [ ]; } diff --git a/nix/hosts/caladan/home_hydra.nix b/nix/hosts/caladan/home_hydra.nix index 1161d9a..4834b67 100644 --- a/nix/hosts/caladan/home_hydra.nix +++ b/nix/hosts/caladan/home_hydra.nix @@ -1,20 +1,18 @@ { pkgs, ... }: { - home = { - stateVersion = "22.11"; - username = "hydra"; - homeDirectory = "/Users/hydra"; - }; + home = { + stateVersion = "22.11"; + username = "hydra"; + homeDirectory = "/Users/hydra"; + }; - programs = { - # let home-manager install and manage itself - home-manager.enable = true; - }; + programs = { + # let home-manager install and manage itself + home-manager.enable = true; + }; - home.packages = with pkgs; [ - tailscale - ]; + home.packages = with pkgs; [ tailscale ]; - services.openssh.enable = true; + services.openssh.enable = true; } diff --git a/nix/hosts/chusuk/configuration.nix b/nix/hosts/chusuk/configuration.nix index c9c52e7..5ec116f 100644 --- a/nix/hosts/chusuk/configuration.nix +++ b/nix/hosts/chusuk/configuration.nix @@ -5,10 +5,10 @@ { config, pkgs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; @@ -19,7 +19,7 @@ networking = { hostName = "chusuk"; # Define your hostname. - wireless.enable = true; # Enables wireless support via wpa_supplicant. + wireless.enable = true; # Enables wireless support via wpa_supplicant. # The global useDHCP flag is deprecated, therefore explicitly set to false here. # Per-interface useDHCP will be mandatory in the future, so this generated config @@ -62,9 +62,14 @@ environment = { pathsToLink = [ "/libexec" ]; systemPackages = with pkgs; [ - kitty - vim helix - wget htop eza fd du-dust + kitty + vim + helix + wget + htop + eza + fd + du-dust tailscale cryptsetup firefox @@ -76,7 +81,8 @@ waybar hyprpaper # wallpaper - tofi rofi + tofi + rofi dolphin mako @@ -123,7 +129,10 @@ windowManager.i3 = { enable = true; extraPackages = with pkgs; [ - dmenu i3status i3lock i3blocks + dmenu + i3status + i3lock + i3blocks ]; }; }; @@ -138,4 +147,3 @@ system.stateVersion = "21.05"; # Did you read the comment? } - diff --git a/nix/hosts/chusuk/hardware-configuration.nix b/nix/hosts/chusuk/hardware-configuration.nix index 6b34e3b..ebe26fc 100644 --- a/nix/hosts/chusuk/hardware-configuration.nix +++ b/nix/hosts/chusuk/hardware-configuration.nix @@ -1,31 +1,39 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/22445c0e-71bd-488f-88e5-0abc60441e58"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/22445c0e-71bd-488f-88e5-0abc60441e58"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/29BB-5D28"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/29BB-5D28"; + fsType = "vfat"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/d79efda2-1190-428c-8598-6911793175fb"; } - ]; + swapDevices = [ { device = "/dev/disk/by-uuid/d79efda2-1190-428c-8598-6911793175fb"; } ]; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/nix/hosts/corrino/configuration.nix b/nix/hosts/corrino/configuration.nix index 5f012b0..9ba6c55 100644 --- a/nix/hosts/corrino/configuration.nix +++ b/nix/hosts/corrino/configuration.nix @@ -5,60 +5,61 @@ let # keys = key; keys = { emile = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPZi43zHEsoWaQomLGaftPE5k0RqVrZyiTtGqZlpWsew emile@caladan" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzY3eCD6D07Kc8iBIO3nLRsqaOZ+Q+RKykXLefT26eU shortcuts@caladan" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMoHWyC9r0LVk6UlkhBWAJph0F6KHYHh83EI5U9wtfq2 shortcuts@ginaz" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPZi43zHEsoWaQomLGaftPE5k0RqVrZyiTtGqZlpWsew emile@caladan" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzY3eCD6D07Kc8iBIO3nLRsqaOZ+Q+RKykXLefT26eU shortcuts@caladan" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMoHWyC9r0LVk6UlkhBWAJph0F6KHYHh83EI5U9wtfq2 shortcuts@ginaz" ]; }; -in { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix +in +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix - ./ports.nix + ./ports.nix - ./www/git - ./www/nix-cache + ./www/git + ./www/nix-cache - # screego + # screego - # web - ./www/emile.space.nix - ./www/tmp.emile.space.nix - ./www/hydra.emile.space.nix - ./www/netbox.emile.space.nix - ./www/grafana.emile.space.nix + # web + ./www/emile.space.nix + ./www/tmp.emile.space.nix + ./www/hydra.emile.space.nix + ./www/netbox.emile.space.nix + ./www/grafana.emile.space.nix - # ./www/photo.emile.space.nix - # ./www/photo + # ./www/photo.emile.space.nix + # ./www/photo - ./www/tickets.emile.space.nix - ./www/talks.emile.space.nix - ./www/stream.emile.space.nix - ./www/md.emile.space.nix - ./www/social.emile.space.nix - ./www/sso.emile.space.nix - ./www/s3.emile.space.nix - ./www/cs.emile.space.nix - ./www/irc.emile.space.nix - ./www/db.emile.space.nix + ./www/tickets.emile.space.nix + ./www/talks.emile.space.nix + ./www/stream.emile.space.nix + ./www/md.emile.space.nix + ./www/social.emile.space.nix + ./www/sso.emile.space.nix + ./www/s3.emile.space.nix + ./www/cs.emile.space.nix + ./www/irc.emile.space.nix + ./www/db.emile.space.nix - # ./www/irc.emile.space.nix - # ./www/irc + # ./www/irc.emile.space.nix + # ./www/irc - ./www/ctf.emile.space.nix - # ./www/magic-hash.emile.space.nix + ./www/ctf.emile.space.nix + # ./www/magic-hash.emile.space.nix - # gemini - ./gemini/emile.space.nix + # gemini + ./gemini/emile.space.nix - # general purpose modules + # general purpose modules - # r2wars - ./www/r2wa.rs.nix + # r2wars + ./www/r2wa.rs.nix - # containers - ]; + # containers + ]; # Use GRUB2 as the boot loader. # We don't use systemd-boot because Hetzner uses BIOS legacy boot. @@ -71,21 +72,30 @@ in { efiSupport = false; enableCryptodisk = true; device = "nodev"; - devices = [ "/dev/nvme0n1" "/dev/nvme1n1"]; + devices = [ + "/dev/nvme0n1" + "/dev/nvme1n1" + ]; }; - kernelParams = [ "ip=135.181.142.139::135.181.142.129:255.255.255.192:corrino:enp35s0:off:8.8.8.8:8.8.4.4:" ]; + kernelParams = [ + "ip=135.181.142.139::135.181.142.129:255.255.255.192:corrino:enp35s0:off:8.8.8.8:8.8.4.4:" + ]; initrd = { kernelModules = [ "dm-snapshot" ]; - availableKernelModules = [ "cryptd" "aesni_intel" "igb" ];#"FIXME Your network driver" ]; + availableKernelModules = [ + "cryptd" + "aesni_intel" + "igb" + ]; # "FIXME Your network driver" ]; network = { enable = true; ssh = { enable = true; - + # ssh port during boot for luks decryption port = config.emile.ports.initrd_ssh; authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys; @@ -106,7 +116,7 @@ in { }; }; }; - + secrets = { "/initrd_ssh_host_ecdsa_key" = "/initrd_ssh_host_ecdsa_key"; }; @@ -203,8 +213,14 @@ in { description = "Automatic connection to Tailscale"; # make sure tailscale is running before trying to connect to tailscale - after = [ "network-pre.target" "tailscale.service" ]; - wants = [ "network-pre.target" "tailscale.service" ]; + after = [ + "network-pre.target" + "tailscale.service" + ]; + wants = [ + "network-pre.target" + "tailscale.service" + ]; wantedBy = [ "multi-user.target" ]; # set this service as a oneshot job @@ -225,7 +241,7 @@ in { ${tailscale}/bin/tailscale up \ --advertise-exit-node --exit-node ''; - # -authkey ${config.age.secrets.tailscale_authkey} + # -authkey ${config.age.secrets.tailscale_authkey} }; networking = { @@ -237,18 +253,30 @@ in { interfaces = { "enp35s0" = { ipv4.addresses = [ - { address = "135.181.142.139"; prefixLength = 26; } + { + address = "135.181.142.139"; + prefixLength = 26; + } ]; }; "enp35s0".ipv6.addresses = [ - { address = "2a01:4f9:3a:16a4::1"; prefixLength = 64; } + { + address = "2a01:4f9:3a:16a4::1"; + prefixLength = 64; + } ]; }; defaultGateway = "135.181.142.129"; - defaultGateway6 = { address = "fe80::1"; interface = "enp35s0"; }; + defaultGateway6 = { + address = "fe80::1"; + interface = "enp35s0"; + }; - nameservers = [ "8.8.8.8" "8.8.4.4" ]; + nameservers = [ + "8.8.8.8" + "8.8.4.4" + ]; # incus doesn't support iptables, so we're using nftables here nftables.enable = true; @@ -257,13 +285,17 @@ in { enable = true; allowedTCPPorts = [ config.emile.ports.gitDaemon # gitDaemon - 80 443 # normal web + 80 + 443 # normal web ]; allowedUDPPorts = [ 51820 # wireguard ]; allowedUDPPortRanges = [ - { from = 60000; to = 61000; } # mosh + { + from = 60000; + to = 61000; + } # mosh ]; interfaces."tailscale0".allowedTCPPorts = [ @@ -275,7 +307,10 @@ in { enable = true; enableIPv6 = true; externalInterface = "enp35s0"; - internalInterfaces = [ "wg0" "ve-+"]; + internalInterfaces = [ + "wg0" + "ve-+" + ]; }; wireguard = { @@ -298,12 +333,14 @@ in { peers = [ # List of allowed peers. - { # Emiles-MBA + { + # Emiles-MBA publicKey = "Ebsjn7w2FeUs5lUN6ALoUcF/o9/+SopDL324YJPSCDY="; # List of IPs assigned to this peer within the tunnel subnet. Used to configure routing. allowedIPs = [ "10.87.0.2/32" ]; } - { # Emiles-IphoneX + { + # Emiles-IphoneX publicKey = "xGfmwraI0Eh3eFEXjJrd2AYCgUM1uK4Y+FX5ACAQZ3M="; # List of IPs assigned to this peer within the tunnel subnet. Used to configure routing. allowedIPs = [ "10.87.0.3/32" ]; @@ -317,7 +354,7 @@ in { users.users = { root = { initialHashedPassword = ""; - openssh.authorizedKeys.keys = [] ++ keys.emile; + openssh.authorizedKeys.keys = [ ] ++ keys.emile; packages = with pkgs; [ mdadm tailscale @@ -326,15 +363,22 @@ in { htop git vim - fd ripgrep + fd + ripgrep + ]; + extraGroups = [ + "docker" + "libvirtd" ]; - extraGroups = [ "docker" "libvirtd" ]; }; hack = { isNormalUser = true; - openssh.authorizedKeys.keys = [] ++ keys.emile; - extraGroups = [ "docker" "libvirtd" ]; + openssh.authorizedKeys.keys = [ ] ++ keys.emile; + extraGroups = [ + "docker" + "libvirtd" + ]; }; tmpuser1 = { @@ -343,7 +387,7 @@ in { # TODO(emile): read after the whole user system is setup # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJMMq7gVuOuJEuarcsss2pb4JJS39zW/Fuow0foyqlV5 noobtracker@noobtracker-linux" - openssh.authorizedKeys.keys = [] ++ keys.emile; + openssh.authorizedKeys.keys = [ ] ++ keys.emile; }; }; @@ -371,9 +415,12 @@ in { useRoutingFeatures = "both"; }; }; - + nix = { - settings.experimental-features = [ "nix-command" "flakes" ]; + settings.experimental-features = [ + "nix-command" + "flakes" + ]; gc = { automatic = true; @@ -419,7 +466,7 @@ in { builders-use-substitutes = true allowed-uris = http:// https:// ''; - # allowed-uris = ssh://git@git.emile.space/hefe-internal git.emile.space git@git.emile.space ssh://git@git.emile.space + # allowed-uris = ssh://git@git.emile.space/hefe-internal git.emile.space git@git.emile.space ssh://git@git.emile.space # allowed-uris = git.emile.space: gitea@git.emile.space: ssh://gitea@git.emile.space/hanemile/hefe-internal.git git+ssh: git+https: # settings.allowed-uris = [ @@ -432,7 +479,12 @@ in { system = "x86_64-linux"; protocol = "ssh-ng"; maxJobs = 1; - supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + ]; } { hostName = "caladan.pinto-pike.ts.net"; @@ -440,12 +492,17 @@ in { protocol = "ssh-ng"; maxJobs = 1; speedFactor = 2; - supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + ]; mandatoryFeatures = [ ]; } ]; - distributedBuilds = true; + distributedBuilds = true; }; nixpkgs.config = { @@ -491,7 +548,10 @@ in { fileSystems."/proc" = { device = "/proc"; options = [ - "nosuid" "nodev" "noexec" "relatime" # normal foo + "nosuid" + "nodev" + "noexec" + "relatime" # normal foo "hidepid=2" # this makes sure users can only see their own processes ]; }; @@ -502,7 +562,8 @@ in { options = let automount_opts = "_netdev,x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; - in ["${automount_opts},credentials=${config.age.secrets.storage_box_bx11_password.path}"]; + in + [ "${automount_opts},credentials=${config.age.secrets.storage_box_bx11_password.path}" ]; }; # FIXME diff --git a/nix/hosts/corrino/default.nix b/nix/hosts/corrino/default.nix index 87486c5..157af45 100644 --- a/nix/hosts/corrino/default.nix +++ b/nix/hosts/corrino/default.nix @@ -1,3 +1 @@ -{ - sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGFzoWTW3c7CKWx5t0OZzTfKTlC6R2VHXczVatgYI57N"; -} +{ sshKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGFzoWTW3c7CKWx5t0OZzTfKTlC6R2VHXczVatgYI57N"; } diff --git a/nix/hosts/corrino/emile.space.nix b/nix/hosts/corrino/emile.space.nix index 9cca880..d30c29f 100644 --- a/nix/hosts/corrino/emile.space.nix +++ b/nix/hosts/corrino/emile.space.nix @@ -10,7 +10,7 @@ root = "/var/www/emile.space"; extraConfig = '' add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; - ''; + ''; }; #"/.well-known" = { diff --git a/nix/hosts/corrino/hardware-configuration.nix b/nix/hosts/corrino/hardware-configuration.nix index b4e8c1e..ed55c25 100644 --- a/nix/hosts/corrino/hardware-configuration.nix +++ b/nix/hosts/corrino/hardware-configuration.nix @@ -1,28 +1,34 @@ - - # 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 # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "ahci" "nvme" ]; + boot.initrd.availableKernelModules = [ + "ahci" + "nvme" + ]; boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/4d372699-9d47-44bf-a68e-eeb126fb7ad6"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/4d372699-9d47-44bf-a68e-eeb126fb7ad6"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/726db4ba-5b90-47e2-b924-72623f02585a"; - fsType = "ext4"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/726db4ba-5b90-47e2-b924-72623f02585a"; + fsType = "ext4"; + }; swapDevices = [ ]; diff --git a/nix/hosts/corrino/ports.nix b/nix/hosts/corrino/ports.nix index 6f17be5..0c2bd2a 100644 --- a/nix/hosts/corrino/ports.nix +++ b/nix/hosts/corrino/ports.nix @@ -1,40 +1,40 @@ { - emile.ports = { - stream_rtmp = 1935; - initrd_ssh = 2222; - photo = { - photoprism = 2342; - immich = 2343; - }; - git = 3000; - hydra = 3001; - grafana = 3002; - md = 3003; - gotosocial = 3004; - harmonia = 5000; - irc = { - clear = 6667; - ssl = 6697; - }; - hound = 6080; - stream = 8080; - netbox = 8001; - restic = 8002; - nocodb = 8003; - r2wars-web = 8089; - ctf = 8338; - magic-hash = 8339; - tickets = 8349; - talks = 8350; - minio = { - s3 = 9000; - web = 9001; - }; - authelia = 9091; - prometheus = 9003; - gitDaemon = 9418; - prometheus_node_exporter = 9002; - prometheus_systemd_exporter = 9558; - prometheus_smartctl_exporter = 9633; - }; + emile.ports = { + stream_rtmp = 1935; + initrd_ssh = 2222; + photo = { + photoprism = 2342; + immich = 2343; + }; + git = 3000; + hydra = 3001; + grafana = 3002; + md = 3003; + gotosocial = 3004; + harmonia = 5000; + irc = { + clear = 6667; + ssl = 6697; + }; + hound = 6080; + stream = 8080; + netbox = 8001; + restic = 8002; + nocodb = 8003; + r2wars-web = 8089; + ctf = 8338; + magic-hash = 8339; + tickets = 8349; + talks = 8350; + minio = { + s3 = 9000; + web = 9001; + }; + authelia = 9091; + prometheus = 9003; + gitDaemon = 9418; + prometheus_node_exporter = 9002; + prometheus_systemd_exporter = 9558; + prometheus_smartctl_exporter = 9633; + }; } diff --git a/nix/hosts/corrino/www/cs.emile.space.nix b/nix/hosts/corrino/www/cs.emile.space.nix index 4f1b91e..7aefc64 100644 --- a/nix/hosts/corrino/www/cs.emile.space.nix +++ b/nix/hosts/corrino/www/cs.emile.space.nix @@ -2,53 +2,58 @@ let - # get's all repos configured in cgit and converts them into some JSON that is used by hound - repos = builtins.toJSON - (lib.mergeAttrsList - (map - (x: {"${x.name}" = { url = "file://${x.path}"; }; }) - (lib.mapAttrsToList - (name: value: value // { name = "${name}"; }) - config.services.cgit.main.repos))); -in { - services.nginx.virtualHosts."cs.emile.space" = { - forceSSL = true; - enableACME = true; - locations = { - "/" = { + # get's all repos configured in cgit and converts them into some JSON that is used by hound + repos = builtins.toJSON ( + lib.mergeAttrsList ( + map + (x: { + "${x.name}" = { + url = "file://${x.path}"; + }; + }) + (lib.mapAttrsToList (name: value: value // { name = "${name}"; }) config.services.cgit.main.repos) + ) + ); +in +{ + services.nginx.virtualHosts."cs.emile.space" = { + forceSSL = true; + enableACME = true; + locations = { + "/" = { proxyPass = "http://${config.services.hound.listen}"; - }; - }; - }; + }; + }; + }; - # add hound user to git group so the local repos can be read + # add hound user to git group so the local repos can be read # users.users.hound.extraGroups = [ "git" ]; - users.groups."git".members = [ "hound" ]; + users.groups."git".members = [ "hound" ]; - # The `.gitignore` of the user `hound` should contain the following: - # - # [safe] + # The `.gitignore` of the user `hound` should contain the following: + # + # [safe] # directory = /var/lib/git/repositories/* # directory = /var/lib/git/repositories/faila.git # directory = /var/lib/git/repositories/faila2.git - services.hound = { - enable = true; - - config = '' - { - "dbpath": "/var/lib/hound/data", - "max-concurrent-indexers" : 6, - "vcs-config" : { - "git" : { - "detect-ref" : true - } - }, - "repos" : ${repos} - } - ''; - - listen = "127.0.0.1:${toString config.emile.ports.hound}"; - }; + services.hound = { + enable = true; + + config = '' + { + "dbpath": "/var/lib/hound/data", + "max-concurrent-indexers" : 6, + "vcs-config" : { + "git" : { + "detect-ref" : true + } + }, + "repos" : ${repos} + } + ''; + + listen = "127.0.0.1:${toString config.emile.ports.hound}"; + }; } diff --git a/nix/hosts/corrino/www/ctf.emile.space.nix b/nix/hosts/corrino/www/ctf.emile.space.nix index 6eee75f..28c9419 100644 --- a/nix/hosts/corrino/www/ctf.emile.space.nix +++ b/nix/hosts/corrino/www/ctf.emile.space.nix @@ -17,9 +17,7 @@ containers = { "ctfd" = { image = "ctfd/ctfd"; - ports = [ - "${toString config.emile.ports.ctf}:8000" - ]; + ports = [ "${toString config.emile.ports.ctf}:8000" ]; }; }; }; diff --git a/nix/hosts/corrino/www/db.emile.space.nix b/nix/hosts/corrino/www/db.emile.space.nix index 7cb365e..3385319 100644 --- a/nix/hosts/corrino/www/db.emile.space.nix +++ b/nix/hosts/corrino/www/db.emile.space.nix @@ -15,7 +15,7 @@ containers = { "noco" = { image = "nocodb/nocodb:latest"; - volumes = [ "nocodb:/usr/app/data" ]; + volumes = [ "nocodb:/usr/app/data" ]; ports = [ "${toString config.emile.ports.nocodb}:8080" ]; }; }; diff --git a/nix/hosts/corrino/www/git/cgit.nix b/nix/hosts/corrino/www/git/cgit.nix index b48157a..edbbe2f 100644 --- a/nix/hosts/corrino/www/git/cgit.nix +++ b/nix/hosts/corrino/www/git/cgit.nix @@ -1,603 +1,607 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let - repodirs = builtins.concatStringsSep "\n" - (map - (x: "directory = ${x}") - (lib.lists.flatten - (map - (x: lib.attrValues (lib.getAttrs [ "path" ] x)) - (lib.mapAttrsToList - (name: value: value) - config.services.cgit.main.repos)))); + repodirs = builtins.concatStringsSep "\n" ( + map (x: "directory = ${x}") ( + lib.lists.flatten ( + map (x: lib.attrValues (lib.getAttrs [ "path" ] x)) ( + lib.mapAttrsToList (name: value: value) config.services.cgit.main.repos + ) + ) + ) + ); in { environment.systemPackages = with pkgs; [ - md4c # used to get md2html for rendering the READMEs within cgit-pink - ]; - - # set all the repos as safe - environment.etc = { - gitconfig = { - text = '' - [http] - sslCAinfo = /etc/ssl/certs/ca-certificates.crt - [safe] - ${repodirs} - ''; - }; - }; - + md4c # used to get md2html for rendering the READMEs within cgit-pink + ]; + + # set all the repos as safe + environment.etc = { + gitconfig = { + text = '' + [http] + sslCAinfo = /etc/ssl/certs/ca-certificates.crt + [safe] + ${repodirs} + ''; + }; + }; + services = { - nginx.virtualHosts."git.emile.space" = { - forceSSL = true; - enableACME = true; - }; - - cgit.main = { - enable = true; - package = pkgs.cgit-pink; - nginx.virtualHost = "git.emile.space"; - nginx.location = "/"; - repos = { + nginx.virtualHosts."git.emile.space" = { + forceSSL = true; + enableACME = true; + }; + + cgit.main = { + enable = true; + package = pkgs.cgit-pink; + nginx.virtualHost = "git.emile.space"; + nginx.location = "/"; + repos = { # ops - hefe = { - desc = "Yet another monorepo (the big nix config)"; - path = "/var/lib/git/repositories/hefe.git"; - section = "Infra"; - owner = "emile"; - }; - vokobe = { - desc = "A custom static site generator written in rust"; - path = "/var/lib/git/repositories/vokobe.git"; - section = "Infra"; - owner = "emile"; - }; - massscan-docker = { - desc = "A Dockerfile for massscan"; - path = "/var/lib/git/repositories/massscan-docker.git"; - section = "Infra"; - owner = "emile"; - }; - metrics-bundler = { - desc = "A super basic metrics bundler"; - path = "/var/lib/git/repositories/metrics-bundler.git"; - section = "Infra"; - owner = "emile"; - }; - - # matrix - matrix-sdk = { - desc = "A simpler matrix sdk"; - path = "/var/lib/git/repositories/matrix-sdk.git"; - section = "Matrix"; - owner = "emile"; - }; - matrix-weather-bot = { - desc = "A basic weather bot using matrix-sdk"; - path = "/var/lib/git/repositories/matrix-weather-bot.git"; - section = "Matrix"; - owner = "emile"; - }; - + hefe = { + desc = "Yet another monorepo (the big nix config)"; + path = "/var/lib/git/repositories/hefe.git"; + section = "Infra"; + owner = "emile"; + }; + vokobe = { + desc = "A custom static site generator written in rust"; + path = "/var/lib/git/repositories/vokobe.git"; + section = "Infra"; + owner = "emile"; + }; + massscan-docker = { + desc = "A Dockerfile for massscan"; + path = "/var/lib/git/repositories/massscan-docker.git"; + section = "Infra"; + owner = "emile"; + }; + metrics-bundler = { + desc = "A super basic metrics bundler"; + path = "/var/lib/git/repositories/metrics-bundler.git"; + section = "Infra"; + owner = "emile"; + }; + + # matrix + matrix-sdk = { + desc = "A simpler matrix sdk"; + path = "/var/lib/git/repositories/matrix-sdk.git"; + section = "Matrix"; + owner = "emile"; + }; + matrix-weather-bot = { + desc = "A basic weather bot using matrix-sdk"; + path = "/var/lib/git/repositories/matrix-weather-bot.git"; + section = "Matrix"; + owner = "emile"; + }; # radare2 - radare2-GoReSym = { - desc = "A script to load goresym symbols into radare2"; - path = "/var/lib/git/repositories/radare2-GoReSym.git"; - section = "Radare2"; - owner = "emile"; - }; - r2wars = { - desc = "A golang implementation of radare2"; - path = "/var/lib/git/repositories/r2wars.git"; - section = "Radare2"; - owner = "emile"; - }; - r2wars-web = { - desc = "The software behind https://r2wa.rs"; - path = "/var/lib/git/repositories/r2wars-web.git"; - section = "Radare2"; - owner = "emile"; - }; - r2wars-rs = { - desc = "A rust implementation of radare2"; - path = "/var/lib/git/repositories/r2wars-rs.git"; - section = "Radare2"; - owner = "emile"; - }; - - # ctf - ctf_clusters = { - desc = "visualizing CTF clusters at DEFCON CTF Finals 2022"; - path = "/var/lib/git/repositories/ctf_clusters.git"; - section = "CTF"; - owner = "emile"; - }; - lambda = { - desc = "hacktm ctf 2023 / misc / know your lambda calculus"; - path = "/var/lib/git/repositories/lambda.git"; - section = "CTF"; - owner = "emile"; - }; - ctfdget = { - desc = "Simply fetch all challenges from a CTF from CTFd."; - path = "/var/lib/git/repositories/ctfdget.git"; - section = "CTF"; - owner = "emile"; - }; + radare2-GoReSym = { + desc = "A script to load goresym symbols into radare2"; + path = "/var/lib/git/repositories/radare2-GoReSym.git"; + section = "Radare2"; + owner = "emile"; + }; + r2wars = { + desc = "A golang implementation of radare2"; + path = "/var/lib/git/repositories/r2wars.git"; + section = "Radare2"; + owner = "emile"; + }; + r2wars-web = { + desc = "The software behind https://r2wa.rs"; + path = "/var/lib/git/repositories/r2wars-web.git"; + section = "Radare2"; + owner = "emile"; + }; + r2wars-rs = { + desc = "A rust implementation of radare2"; + path = "/var/lib/git/repositories/r2wars-rs.git"; + section = "Radare2"; + owner = "emile"; + }; + + # ctf + ctf_clusters = { + desc = "visualizing CTF clusters at DEFCON CTF Finals 2022"; + path = "/var/lib/git/repositories/ctf_clusters.git"; + section = "CTF"; + owner = "emile"; + }; + lambda = { + desc = "hacktm ctf 2023 / misc / know your lambda calculus"; + path = "/var/lib/git/repositories/lambda.git"; + section = "CTF"; + owner = "emile"; + }; + ctfdget = { + desc = "Simply fetch all challenges from a CTF from CTFd."; + path = "/var/lib/git/repositories/ctfdget.git"; + section = "CTF"; + owner = "emile"; + }; # keyboard - zmk-config = { - desc = "ferris sweep zmk config"; - path = "/var/lib/git/repositories/zmk-config.git"; - section = "Keyboard"; - owner = "emile"; - }; - - # chaosdorf - map = { - desc = "A map of the chaosdorf hackspace"; - path = "/var/lib/git/repositories/map.git"; - section = "Chaosdorf"; - owner = "emile"; - }; - freitagsfoo = { - desc = "A service to submit talks for freitagsfoo"; - path = "/var/lib/git/repositories/freitagsfoo.git"; - section = "Chaosdorf"; - owner = "emile"; - }; - inventory = { - desc = "A common-lisp mapping and inventory system"; - path = "/var/lib/git/repositories/inventory.git"; - section = "Chaosdorf"; - owner = "emile"; - }; - - # jugend forscht - SatelliteComputation = { - desc = "Estimating possible Satellite collisions"; - path = "/var/lib/git/repositories/SatelliteComputation.git"; - section = "Jugend Forscht 2017"; - owner = "emile"; - }; - GalaxyGeneration = { - desc = "Generating Galaxies"; - path = "/var/lib/git/repositories/GalaxyGeneration.git"; - section = "Jugend Forscht 2018"; - owner = "emile"; - }; - - brute-force = { - desc = "A simple benchmark showing how slow this can be"; - path = "/var/lib/git/repositories/galaxy-sim-brute-force.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - generatePointcloud = { - desc = "Generate pointclouds using the NFW profile"; - path = "/var/lib/git/repositories/generatePointcloud.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - quadtree = { - desc = "Simple quadtree implementation"; - path = "/var/lib/git/repositories/quadtree.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - viewer = { - desc = "A viewer for galaxies stored in trees"; - path = "/var/lib/git/repositories/viewer.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - structs = { - desc = "All of the structures used in the GalaxySimulator"; - path = "/var/lib/git/repositories/structs.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - simulator-container-rewrite = { - desc = "Clean rewrite of the simulator-container"; - path = "/var/lib/git/repositories/simulator-container-rewrite.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - simulator-container = { - desc = "Simulating the new position of a galaxye"; - path = "/var/lib/git/repositories/simulator-container.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - pres = { - desc = "Presentation material"; - path = "/var/lib/git/repositories/pres.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - manager-container = { - desc = "The overall manager"; - path = "/var/lib/git/repositories/manager-container.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - generator-container = { - desc = "Generates point clouds using the NFW profile"; - path = "/var/lib/git/repositories/generator-container.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - frontpage = { - desc = "Web page showing people what the project is about"; - path = "/var/lib/git/repositories/frontpage.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - distributor = { - desc = "Distributing tasks"; - path = "/var/lib/git/repositories/distributor-container.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - db-controller = { - desc = "Interaction with the Database"; - path = "/var/lib/git/repositories/db-controller.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - db-container = { - desc = "The main database"; - path = "/var/lib/git/repositories/db-container.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - db-actions = { - desc = "Actions to be performed on the batabase"; - path = "/var/lib/git/repositories/db-actions.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - Writeup = { - desc = "Writeups using LaTeX"; - path = "/var/lib/git/repositories/Writeup.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - Source = { - desc = "Code from the beginning"; - path = "/var/lib/git/repositories/Source.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - NFW-container = { - desc = "A container purely for generating galaxies"; - path = "/var/lib/git/repositories/NFW-container.git"; - section = "Jugend Forscht 2019"; - owner = "emile"; - }; - - # games - "0h-gamejam-game" = { - desc = "Created a game in 0 hours"; - path = "/var/lib/git/repositories/0hour-gamejam-game.git"; - section = "Games"; - owner = "emile"; - }; - - # 3D - "3D" = { - desc = "3D models"; - path = "/var/lib/git/repositories/3D.git"; - section = "3D"; - owner = "emile"; - }; - - # http - faila = { - desc = "The caddy fileserver look, but int pure golang"; - path = "/var/lib/git/repositories/faila.git"; - section = "HTTP"; - owner = "emile"; - }; - faila2 = { - desc = "faila, but simpler"; - path = "/var/lib/git/repositories/faila2.git"; - section = "HTTP"; - owner = "emile"; - }; - gofuzz = { - desc = "wfuzz, but in go. Didn't know ffuf at the time"; - path = "/var/lib/git/repositories/gofuzz.git"; - section = "HTTP"; - owner = "emile"; - }; - graphClicker = { - desc = "A metrics bundler, but with a simple web interface"; - path = "/var/lib/git/repositories/graphClicker.git"; - section = "HTTP"; - owner = "emile"; - }; - randomHttp = { - desc = "A simple HTTP server returning random HTTP codes"; - path = "/var/lib/git/repositories/randomHTTP.git"; - section = "HTTP"; - owner = "emile"; - }; - redir = { - desc = "A webserver with the soul purpose of redirecting."; - path = "/var/lib/git/repositories/redir.git"; - section = "HTTP"; - owner = "emile"; - }; - reqlog = { - desc = "A simple request logger"; - path = "/var/lib/git/repositories/reqlog.git"; - section = "HTTP"; - owner = "emile"; - }; - - # honeypot - ssh-catch-test = { - desc = "A simple honeypot emulating an ssh server."; - path = "/var/lib/git/repositories/ssh-catch-test.git"; - section = "Honeypot"; - owner = "emile"; - }; - honeypot-monitoring = { - desc = "Grafana + Prometheus monitoring"; - path = "/var/lib/git/repositories/honeypot-monitoring.git"; - section = "Honeypot"; - owner = "emile"; - }; - ftp-grab-password = { - desc = "Grab ftp creds (made by twink0r)"; - path = "/var/lib/git/repositories/ftp-grab-password.git"; - section = "Honeypot"; - owner = "emile"; - }; - log-analyzer = { - desc = "Analyse the logs"; - path = "/var/lib/git/repositories/honeypot-log-analyzer.git"; - section = "Honeypot"; - owner = "emile"; - }; - http-grab-basicauth = { - desc = "Grab basicauth creds (made by maride)"; - path = "/var/lib/git/repositories/http-grab-basicauth.git"; - section = "Honeypot"; - owner = "emile"; - }; - http-grab-url = { - desc = "Grab urls (made by twink0r)"; - path = "/var/lib/git/repositories/http-grab-url.git"; - section = "Honeypot"; - owner = "emile"; - }; - ssh-grab-keypass = { - desc = "Grab keys from ssh logins (made by maride)"; - path = "/var/lib/git/repositories/ssh-grab-keypass.git"; - section = "Honeypot"; - owner = "emile"; - }; - ssh-grab-passwords = { - desc = "Grab passwords from ssh logins (made by maride)"; - path = "/var/lib/git/repositories/ssh-grab-passwords.git"; - section = "Honeypot"; - owner = "emile"; - }; - ssh-grab-passwords-map = { - desc = "A nice visual map of the login attempts"; - path = "/var/lib/git/repositories/ssh-grab-passwords-map.git"; - section = "Honeypot"; - owner = "emile"; - }; + zmk-config = { + desc = "ferris sweep zmk config"; + path = "/var/lib/git/repositories/zmk-config.git"; + section = "Keyboard"; + owner = "emile"; + }; + + # chaosdorf + map = { + desc = "A map of the chaosdorf hackspace"; + path = "/var/lib/git/repositories/map.git"; + section = "Chaosdorf"; + owner = "emile"; + }; + freitagsfoo = { + desc = "A service to submit talks for freitagsfoo"; + path = "/var/lib/git/repositories/freitagsfoo.git"; + section = "Chaosdorf"; + owner = "emile"; + }; + inventory = { + desc = "A common-lisp mapping and inventory system"; + path = "/var/lib/git/repositories/inventory.git"; + section = "Chaosdorf"; + owner = "emile"; + }; + + # jugend forscht + SatelliteComputation = { + desc = "Estimating possible Satellite collisions"; + path = "/var/lib/git/repositories/SatelliteComputation.git"; + section = "Jugend Forscht 2017"; + owner = "emile"; + }; + GalaxyGeneration = { + desc = "Generating Galaxies"; + path = "/var/lib/git/repositories/GalaxyGeneration.git"; + section = "Jugend Forscht 2018"; + owner = "emile"; + }; + + brute-force = { + desc = "A simple benchmark showing how slow this can be"; + path = "/var/lib/git/repositories/galaxy-sim-brute-force.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + generatePointcloud = { + desc = "Generate pointclouds using the NFW profile"; + path = "/var/lib/git/repositories/generatePointcloud.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + quadtree = { + desc = "Simple quadtree implementation"; + path = "/var/lib/git/repositories/quadtree.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + viewer = { + desc = "A viewer for galaxies stored in trees"; + path = "/var/lib/git/repositories/viewer.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + structs = { + desc = "All of the structures used in the GalaxySimulator"; + path = "/var/lib/git/repositories/structs.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + simulator-container-rewrite = { + desc = "Clean rewrite of the simulator-container"; + path = "/var/lib/git/repositories/simulator-container-rewrite.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + simulator-container = { + desc = "Simulating the new position of a galaxye"; + path = "/var/lib/git/repositories/simulator-container.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + pres = { + desc = "Presentation material"; + path = "/var/lib/git/repositories/pres.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + manager-container = { + desc = "The overall manager"; + path = "/var/lib/git/repositories/manager-container.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + generator-container = { + desc = "Generates point clouds using the NFW profile"; + path = "/var/lib/git/repositories/generator-container.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + frontpage = { + desc = "Web page showing people what the project is about"; + path = "/var/lib/git/repositories/frontpage.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + distributor = { + desc = "Distributing tasks"; + path = "/var/lib/git/repositories/distributor-container.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + db-controller = { + desc = "Interaction with the Database"; + path = "/var/lib/git/repositories/db-controller.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + db-container = { + desc = "The main database"; + path = "/var/lib/git/repositories/db-container.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + db-actions = { + desc = "Actions to be performed on the batabase"; + path = "/var/lib/git/repositories/db-actions.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + Writeup = { + desc = "Writeups using LaTeX"; + path = "/var/lib/git/repositories/Writeup.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + Source = { + desc = "Code from the beginning"; + path = "/var/lib/git/repositories/Source.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + NFW-container = { + desc = "A container purely for generating galaxies"; + path = "/var/lib/git/repositories/NFW-container.git"; + section = "Jugend Forscht 2019"; + owner = "emile"; + }; + + # games + "0h-gamejam-game" = { + desc = "Created a game in 0 hours"; + path = "/var/lib/git/repositories/0hour-gamejam-game.git"; + section = "Games"; + owner = "emile"; + }; + + # 3D + "3D" = { + desc = "3D models"; + path = "/var/lib/git/repositories/3D.git"; + section = "3D"; + owner = "emile"; + }; + + # http + faila = { + desc = "The caddy fileserver look, but int pure golang"; + path = "/var/lib/git/repositories/faila.git"; + section = "HTTP"; + owner = "emile"; + }; + faila2 = { + desc = "faila, but simpler"; + path = "/var/lib/git/repositories/faila2.git"; + section = "HTTP"; + owner = "emile"; + }; + gofuzz = { + desc = "wfuzz, but in go. Didn't know ffuf at the time"; + path = "/var/lib/git/repositories/gofuzz.git"; + section = "HTTP"; + owner = "emile"; + }; + graphClicker = { + desc = "A metrics bundler, but with a simple web interface"; + path = "/var/lib/git/repositories/graphClicker.git"; + section = "HTTP"; + owner = "emile"; + }; + randomHttp = { + desc = "A simple HTTP server returning random HTTP codes"; + path = "/var/lib/git/repositories/randomHTTP.git"; + section = "HTTP"; + owner = "emile"; + }; + redir = { + desc = "A webserver with the soul purpose of redirecting."; + path = "/var/lib/git/repositories/redir.git"; + section = "HTTP"; + owner = "emile"; + }; + reqlog = { + desc = "A simple request logger"; + path = "/var/lib/git/repositories/reqlog.git"; + section = "HTTP"; + owner = "emile"; + }; + + # honeypot + ssh-catch-test = { + desc = "A simple honeypot emulating an ssh server."; + path = "/var/lib/git/repositories/ssh-catch-test.git"; + section = "Honeypot"; + owner = "emile"; + }; + honeypot-monitoring = { + desc = "Grafana + Prometheus monitoring"; + path = "/var/lib/git/repositories/honeypot-monitoring.git"; + section = "Honeypot"; + owner = "emile"; + }; + ftp-grab-password = { + desc = "Grab ftp creds (made by twink0r)"; + path = "/var/lib/git/repositories/ftp-grab-password.git"; + section = "Honeypot"; + owner = "emile"; + }; + log-analyzer = { + desc = "Analyse the logs"; + path = "/var/lib/git/repositories/honeypot-log-analyzer.git"; + section = "Honeypot"; + owner = "emile"; + }; + http-grab-basicauth = { + desc = "Grab basicauth creds (made by maride)"; + path = "/var/lib/git/repositories/http-grab-basicauth.git"; + section = "Honeypot"; + owner = "emile"; + }; + http-grab-url = { + desc = "Grab urls (made by twink0r)"; + path = "/var/lib/git/repositories/http-grab-url.git"; + section = "Honeypot"; + owner = "emile"; + }; + ssh-grab-keypass = { + desc = "Grab keys from ssh logins (made by maride)"; + path = "/var/lib/git/repositories/ssh-grab-keypass.git"; + section = "Honeypot"; + owner = "emile"; + }; + ssh-grab-passwords = { + desc = "Grab passwords from ssh logins (made by maride)"; + path = "/var/lib/git/repositories/ssh-grab-passwords.git"; + section = "Honeypot"; + owner = "emile"; + }; + ssh-grab-passwords-map = { + desc = "A nice visual map of the login attempts"; + path = "/var/lib/git/repositories/ssh-grab-passwords-map.git"; + section = "Honeypot"; + owner = "emile"; + }; # fuzzing - stdin-to-tcp = { - desc = "Bending stdin to tcp"; - path = "/var/lib/git/repositories/stdin-to-tcp.git"; - section = "Fuzzing"; - owner = "emile"; - }; - - # firmware - firmware = { - desc = "Gathering firmware via nix"; - path = "/var/lib/git/repositories/firmware.git"; - section = "Firmware"; - owner = "emile"; - }; - - # crypto - Substitution-Cracker = { - desc = "Some code for cracking substitution ciphers"; - path = "/var/lib/git/repositories/Substitution-Cracker.git"; - section = "Crypto"; - owner = "emile"; - }; - - # fun - giff = { - desc = "A party service: give it gifs and it'll play them"; - path = "/var/lib/git/repositories/giff.git"; - section = "Fun"; - owner = "emile"; - }; - pixeltsunami = { - desc = "The obligatory pixelflut client"; - path = "/var/lib/git/repositories/pixeltsunami.git"; - section = "Fun"; - owner = "emile"; - }; - - # circus - companion = { - desc = "The companion spawned for one user."; - path = "/var/lib/git/repositories/companion.git"; - section = "Circus"; - owner = "emile"; - }; - compose = { - desc = "The docker-compose foo"; - path = "/var/lib/git/repositories/compose.git"; - section = "Circus"; - owner = "emile"; - }; - container-manager = { - desc = "The meta container managemer"; - path = "/var/lib/git/repositories/container-manager.git"; - section = "Circus"; - owner = "emile"; - }; - landingpage = { - desc = "The landing page"; - path = "/var/lib/git/repositories/landingpage.git"; - section = "Circus"; - owner = "emile"; - }; - manager = { - desc = "The manager"; - path = "/var/lib/git/repositories/manager.git"; - section = "Circus"; - owner = "emile"; - }; - register = { - desc = "The registration"; - path = "/var/lib/git/repositories/register.git"; - section = "Circus"; - owner = "emile"; - }; - scoreboard = { - desc = "The scoreboard"; - path = "/var/lib/git/repositories/scoreboard.git"; - section = "Circus"; - owner = "emile"; - }; - static = { - desc = "Some static files"; - path = "/var/lib/git/repositories/static.git"; - section = "Circus"; - owner = "emile"; - }; - vpn = { - desc = "The VPN stuff"; - path = "/var/lib/git/repositories/vpn.git"; - section = "Circus"; - owner = "emile"; - }; - - # articles - barnes-hut = { - desc = "A one pager compressing the JuFo19 project"; - path = "/var/lib/git/repositories/barnes-hut.git"; - section = "Articles"; - owner = "emile"; - }; - - # satellite - tle = { - desc = "golang tle lib"; - path = "/var/lib/git/repositories/tle.git"; - section = "Satellite"; - owner = "emile"; - }; - tle2json = { - desc = "golang tle to json"; - path = "/var/lib/git/repositories/tle2json.git"; - section = "Satellite"; - owner = "emile"; - }; - }; - settings = { - css = "https://emile.space/cgit.css"; - root-title = "git.emile.space"; - root-desc = ""; - - enable-index-owner = 0; # why show this? I own 'em all! - enable-commit-graph = 1; - max-repo-count = 5000; # like: why not? - - readme = ":README.md"; - about-filter = "${pkgs.cgit-pink}/lib/cgit/filters/about-formatting.sh"; - source-filter = "${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py"; - - summary-log = 50; + stdin-to-tcp = { + desc = "Bending stdin to tcp"; + path = "/var/lib/git/repositories/stdin-to-tcp.git"; + section = "Fuzzing"; + owner = "emile"; + }; + + # firmware + firmware = { + desc = "Gathering firmware via nix"; + path = "/var/lib/git/repositories/firmware.git"; + section = "Firmware"; + owner = "emile"; + }; + + # crypto + Substitution-Cracker = { + desc = "Some code for cracking substitution ciphers"; + path = "/var/lib/git/repositories/Substitution-Cracker.git"; + section = "Crypto"; + owner = "emile"; + }; + + # fun + giff = { + desc = "A party service: give it gifs and it'll play them"; + path = "/var/lib/git/repositories/giff.git"; + section = "Fun"; + owner = "emile"; + }; + pixeltsunami = { + desc = "The obligatory pixelflut client"; + path = "/var/lib/git/repositories/pixeltsunami.git"; + section = "Fun"; + owner = "emile"; + }; + + # circus + companion = { + desc = "The companion spawned for one user."; + path = "/var/lib/git/repositories/companion.git"; + section = "Circus"; + owner = "emile"; + }; + compose = { + desc = "The docker-compose foo"; + path = "/var/lib/git/repositories/compose.git"; + section = "Circus"; + owner = "emile"; + }; + container-manager = { + desc = "The meta container managemer"; + path = "/var/lib/git/repositories/container-manager.git"; + section = "Circus"; + owner = "emile"; + }; + landingpage = { + desc = "The landing page"; + path = "/var/lib/git/repositories/landingpage.git"; + section = "Circus"; + owner = "emile"; + }; + manager = { + desc = "The manager"; + path = "/var/lib/git/repositories/manager.git"; + section = "Circus"; + owner = "emile"; + }; + register = { + desc = "The registration"; + path = "/var/lib/git/repositories/register.git"; + section = "Circus"; + owner = "emile"; + }; + scoreboard = { + desc = "The scoreboard"; + path = "/var/lib/git/repositories/scoreboard.git"; + section = "Circus"; + owner = "emile"; + }; + static = { + desc = "Some static files"; + path = "/var/lib/git/repositories/static.git"; + section = "Circus"; + owner = "emile"; + }; + vpn = { + desc = "The VPN stuff"; + path = "/var/lib/git/repositories/vpn.git"; + section = "Circus"; + owner = "emile"; + }; + + # articles + barnes-hut = { + desc = "A one pager compressing the JuFo19 project"; + path = "/var/lib/git/repositories/barnes-hut.git"; + section = "Articles"; + owner = "emile"; + }; + + # satellite + tle = { + desc = "golang tle lib"; + path = "/var/lib/git/repositories/tle.git"; + section = "Satellite"; + owner = "emile"; + }; + tle2json = { + desc = "golang tle to json"; + path = "/var/lib/git/repositories/tle2json.git"; + section = "Satellite"; + owner = "emile"; + }; + }; + settings = { + css = "https://emile.space/cgit.css"; + root-title = "git.emile.space"; + root-desc = ""; + + enable-index-owner = 0; # why show this? I own 'em all! + enable-commit-graph = 1; + max-repo-count = 5000; # like: why not? + + readme = ":README.md"; + about-filter = "${pkgs.cgit-pink}/lib/cgit/filters/about-formatting.sh"; + source-filter = "${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py"; + + summary-log = 50; # mobile friendly - head-include = builtins.toFile "cgit_head.html" '' - - ''; - - footer = builtins.toFile "cgit_footer.html" '' -