OPENAI_API_KEY=nothing
OPENAI_BASE_URL="http://localhost:11434/v1"
-OPENAI_MODEL=qwen3-coder-noloop:latest
+OPENAI_MODEL=renchris/qwen3-coder:30b-gguf-unsloth
+TAVILY_API_KEY=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
./website/**
-nix/result
\ No newline at end of file
+nix/result
+.env
--- /dev/null
+* Git Branch
+The main branch for this repo is `main`.
+* Updating
+When testing if the NixOS configuration builds, test with command `eval `
+* Project
+This project mainly deals with nix files and elisp. Otherwise it is emacs org mode.
:config
(lyrics-fetcher-use-backend 'genius))
+(defun insert-urandom-password (&optional length)
+ (interactive "P")
+ (let ((length (or length 32))
+ (chars "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>?"))
+ (insert
+ (with-temp-buffer
+ (call-process "head" nil t nil "-c" (number-to-string length) "/dev/urandom")
+ (let ((bytes (buffer-string)))
+ (mapconcat (lambda (c)
+ (string (elt chars (mod (string-to-char (char-to-string c)) (length chars)))))
+ bytes ""))))))
+
(use-package org-fragtog :hook (org-mode . org-fragtog-mode))
(use-package yasnippet
;; Programming Projects
"." '(counsel-find-file :wk "find file")
- "p I" '(projectile-add-known-project :wk "Add to project list")
+ "p a" '(projectile-add-known-project :wk "Add to project list")
"N f" '(nix-flake :wk "nix flake menu")
"f" '(:ignore t :wk "file operations")
"f p" '(projectile-switch-project :wk "find project to switch to")
- "f f" '(projectile-find-file :wk "find file in project")
+ "f f" '(counsel-fzf :wk "find file in project")
"f s" '(counsel-rg :wk "find string in project")
"y n s" '(yas-new-snippet :wk "Create new snippet")
"h m" '(woman :wk "Manual")
"h i" '(info :wk "Info")
+ "s i p" '(insert-urandom-password :wk "insert random password to buffer (for sops)")
"u w" '((lambda () (interactive) (shell-command "rsync -azvP ~/website_html/ root@nullring.xyz:/usr/share/nginx/ret2pop/")) :wk "rsync website update")
"h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/monorepo/config/emacs.org")))))
(add-to-list 'emms-info-functions 'emms-info-mpd)
(add-to-list 'emms-player-list 'emms-player-mpd)
:config (emms-player-mpd-connect))
+
+(use-package lean4-mode
+ :commands lean4-mode
+ :vc (:url "https://github.com/leanprover-community/lean4-mode.git"
+ :rev "76895d8939111654a472cfc617cfd43fbf5f1eb6"))
:config
(lyrics-fetcher-use-backend 'genius))
#+end_src
+* Passwords
+This is a function that inserts a random password into the buffer. I use this to manage sops-nix.
+#+begin_src emacs-lisp
+ (defun insert-urandom-password (&optional length)
+ (interactive "P")
+ (let ((length (or length 32))
+ (chars "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>?"))
+ (insert
+ (with-temp-buffer
+ (call-process "head" nil t nil "-c" (number-to-string length) "/dev/urandom")
+ (let ((bytes (buffer-string)))
+ (mapconcat (lambda (c)
+ (string (elt chars (mod (string-to-char (char-to-string c)) (length chars)))))
+ bytes ""))))))
+#+end_src
* Fragtog
This package is used to generate previews automatically when your cursor hovers over a latex
snippet.
;; Programming Projects
"." '(counsel-find-file :wk "find file")
- "p I" '(projectile-add-known-project :wk "Add to project list")
+ "p a" '(projectile-add-known-project :wk "Add to project list")
"N f" '(nix-flake :wk "nix flake menu")
"f" '(:ignore t :wk "file operations")
"f p" '(projectile-switch-project :wk "find project to switch to")
- "f f" '(projectile-find-file :wk "find file in project")
+ "f f" '(counsel-fzf :wk "find file in project")
"f s" '(counsel-rg :wk "find string in project")
"y n s" '(yas-new-snippet :wk "Create new snippet")
"h m" '(woman :wk "Manual")
"h i" '(info :wk "Info")
+ "s i p" '(insert-urandom-password :wk "insert random password to buffer (for sops)")
"u w" '((lambda () (interactive) (shell-command "rsync -azvP ~/website_html/ root@nullring.xyz:/usr/share/nginx/ret2pop/")) :wk "rsync website update")
"h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/monorepo/config/emacs.org")))))
(add-to-list 'emms-player-list 'emms-player-mpd)
:config (emms-player-mpd-connect))
#+end_src
+* Unpinned
+** Lean4
+For some reason, lean4-mode is not in MELPA currently so I have to do this ugly thing:
+#+begin_src emacs-lisp
+ (use-package lean4-mode
+ :commands lean4-mode
+ :vc (:url "https://github.com/leanprover-community/lean4-mode.git"
+ :rev "76895d8939111654a472cfc617cfd43fbf5f1eb6"))
+#+end_src
+and actually pull something from the internet instead of pinning. Thankfully this reproduction issue is probably localized to lean files. Also,
+we're pulling a specific commit so it is still pinned.
description = "device that NixOS is installed to";
};
+ fileSystem = lib.mkOption {
+ type = lib.types.str;
+ default = "ext4";
+ example = "btrfs";
+ description = "filesystem to install with disko";
+ };
+
diskoSpec = lib.mkOption {
type = lib.types.attrs;
description = "retains a copy of the disko spec for reflection";
virtualisation.docker.enable = true;
}
#+end_src
-
** Pipewire
My low latency pipewire configuration is used for music production, as well as for regular
desktop usage. Pipewire is much better than pulseaudio because it supports jack with the same
};
}
#+end_src
-** Murmur
+** TODO Murmur
#+begin_src nix :tangle ../nix/modules/murmur.nix
{ lib, config, ... }:
{
};
}
#+end_src
-** i2pd
+** TODO i2pd
I use i2p for some p2p connections. We enable it with the server profile:
#+begin_src nix :tangle ../nix/modules/i2pd.nix
{ config, lib, ... }:
};
}
#+end_src
-** Icecast
+** TODO Icecast
This is an internet radio which will host a ton of music.
#+begin_src nix :tangle ../nix/modules/icecast.nix
{ lib, config, ... }:
Method = sha256
Hash = d4abdd69aa24de69693885c5bd83a4a0e9ee989e1a69a905041b0dad9abc06ea
Salt = sDY,?H5AxC-!gH3a.:)D
- Hash = ${config.sops.secrets.znc_password_hash}
- Salt = ${config.sops.secrets.znc_password_salt}
</Pass>
'';
modules = [
];
address = "0.0.0.0";
port = 6167;
- allow_registration = true;
+ allow_registration = false;
};
};
}
] else []);
}
#+end_src
-** Maddy
+** TODO Maddy
#+begin_src nix :tangle ../nix/modules/maddy.nix
{ lib, config, options, ... }:
{
services.maddy = {
enable = lib.mkDefault config.monorepo.profiles.server.enable;
openFirewall = true;
- primaryDomain = "ret2pop.net";
+ hostName = "${config.monorepo.vars.remoteHost}";
+ primaryDomain = "mail.${config.monorepo.vars.remoteHost}";
tls = {
loader = "acme";
};
"imap tls://0.0.0.0:993 tcp://0.0.0.0:143"
"submission tls://0.0.0.0:465 tcp://0.0.0.0:587"
] options.services.maddy.config.default;
+ ensureCredentials = {
+ "preston@localhost" = {
+ passwordFile = "/secrets/preston-localhost";
+ };
+ };
};
}
#+end_src
xdg.portal = {
enable = (! config.monorepo.profiles.ttyonly.enable);
- wlr.enable = true;
+ wlr.enable = (! config.monorepo.profiles.ttyonly.enable);
extraPortals = with pkgs; if (! config.monorepo.profiles.ttyonly.enable) then [
xdg-desktop-portal-gtk
xdg-desktop-portal
** Disko
This is the disko configuration for my continuity system. It features a boot and ext4 partition,
with configurable disk.
+*** Btrfs
+#+begin_src nix :tangle ../nix/disko/btrfs-simple.nix
+ { lib, config, ... }:
+ let
+ spec = {
+ disko.devices = {
+ disk = {
+ main = {
+ type = "disk";
+ device = config.monorepo.vars.device;
+ content = {
+ type = "gpt";
+ partitions = {
+ ESP = {
+ priority = 1;
+ name = "ESP";
+ start = "1M";
+ end = "128M";
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ mountOptions = [ "umask=0077" ];
+ };
+ };
+ root = {
+ size = "100%";
+ content = {
+ type = "btrfs";
+ extraArgs = [ "-f" ]; # Override existing partition
+ mountpoint = "/";
+ mountOptions = [
+ "compress=zstd"
+ "noatime"
+ ];
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ in
+ {
+ monorepo.vars.diskoSpec = spec;
+ disko.devices = spec.disko.devices;
+ }
+#+end_src
*** Simple
This configuration is used for simple partitioning schemes with EFI.
#+begin_src nix :tangle ../nix/disko/drive-simple.nix
My git configuration uses information set in the ~vars.nix~ in order to set configuration options.
Make sure those are set correctly. I've set it to sign by default.
#+begin_src nix :tangle ../nix/modules/home/git.nix
-{ lib, config, ... }:
-{
- programs.git = {
- enable = lib.mkDefault config.monorepo.profiles.graphics.enable;
- userName = config.monorepo.vars.fullName;
- userEmail = config.monorepo.profiles.email.email;
- signing = {
- key = config.monorepo.vars.gpgKey;
- signByDefault = true;
- };
+ { lib, config, ... }:
+ {
+ programs.git = {
+ enable = lib.mkDefault config.monorepo.profiles.graphics.enable;
+ userName = config.monorepo.vars.fullName;
+ userEmail = config.monorepo.profiles.email.email;
+ signing = {
+ key = config.monorepo.vars.gpgKey;
+ signByDefault = true;
+ };
- extraConfig = {
- init.defaultBranch = "main";
- };
+ extraConfig = {
+ init.defaultBranch = "main";
+ };
- aliases = {
- co = "checkout";
- c = "commit";
- a = "add";
- s = "switch";
- b = "branch";
+ aliases = {
+ pl = "pull";
+ ps = "push";
+ co = "checkout";
+ c = "commit";
+ a = "add";
+ st = "status";
+ sw = "switch";
+ b = "branch";
+ };
};
- };
-}
+ }
#+end_src
*** Hyprland
My compositor/window manager. This automatically starts on startup. Instructions on how
};
shellAliases = {
+ se = "sops edit";
+ f = "vim $(fzf)";
+ e = "cd $(find . -type d -print | fzf)";
c = "clear";
g = "git";
v = "vim";
mupdf
zathura
+ fzf
# passwords
age sops
pfetch
libnotify
htop
+
+ (pkgs.writeShellScriptBin "help"
+ ''
+ #!/usr/bin/env sh
+ # Portable, colored, nicely aligned alias list
+
+ # Generate uncolored alias pairs
+ aliases=$(cat <<'EOF'
+ ${let aliases = config.programs.zsh.shellAliases;
+ in lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value:
+ "${name} -> ${value}"
+ ) aliases)}
+ EOF
+ )
+
+ # Align and color using awk
+ echo "$aliases" | awk '
+ BEGIN {
+ GREEN="\033[0;32m";
+ YELLOW="\033[0;33m";
+ RESET="\033[0m";
+ maxlen=0;
+ }
+ {
+ # Split line on " -> "
+ split($0, parts, / -> /);
+ name[NR]=parts[1];
+ cmd[NR]=parts[2];
+ if(length(parts[1])>maxlen) maxlen=length(parts[1]);
+ }
+ END {
+ for(i=1;i<=NR;i++) {
+ # printf with fixed width for alias name
+ printf "%s%-*s%s -> %s%s%s\n", GREEN, maxlen, name[i], RESET, YELLOW, cmd[i], RESET;
+ }
+ }'
+ '')
+
(writeShellScriptBin "remote-build"
''
#!/bin/bash
boot.loader.grub.device = "nodev";
networking = {
+ interfaces.ens3.ipv6.addresses = [
+ {
+ address = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+ prefixLength = 64;
+ }
+ ];
firewall.allowedTCPPorts = [
80
+ 143
443
465
+ 587
993
- 8448
6697
6667
+ 8448
];
domains = {
enable = true;
"${config.monorepo.vars.remoteHost}" = {};
"matrix.${config.monorepo.vars.remoteHost}" = {};
"www.${config.monorepo.vars.remoteHost}" = {};
- "mail.${config.monorepo.vars.remoteHost}" = {};
+ "mail.${config.monorepo.vars.remoteHost}" = {
+ mx.data = "10 mail.${config.monorepo.vars.remoteHost}.";
+ };
"nullring.xyz" = {};
"git.nullring.xyz" = {};
#+end_src
#+RESULTS:
+- [[file:20250909.org][20250909.org]]
+- [[file:20250908.org][20250908.org]]
+- [[file:20250826.org][20250826.org]]
+- [[file:20250723.org][20250723.org]]
+- [[file:20250720.org][20250720.org]]
+- [[file:20250703.org][20250703.org]]
+- [[file:20250626.org][20250626.org]]
+- [[file:20250602.org][20250602.org]]
+- [[file:20250321.org][20250321.org]]
+- [[file:20250317.org][20250317.org]]
+- [[file:20250313.org][20250313.org]]
+- [[file:20250311.org][20250311.org]]
+- [[file:20250310.org][20250310.org]]
+- [[file:20250308.org][20250308.org]]
+- [[file:20250305.org][20250305.org]]
+- [[file:20250302.org][20250302.org]]
+- [[file:20250222.org][20250222.org]]
+- [[file:20250220.org][20250220.org]]
+- [[file:20250218.org][20250218.org]]
+- [[file:20250214.org][20250214.org]]
+- [[file:20250211.org][20250211.org]]
+- [[file:20250203.org][20250203.org]]
- [[file:20250201.org][20250201.org]]
- [[file:20250123.org][20250123.org]]
- [[file:20250119.org][20250119.org]]
--- /dev/null
+{ lib, config, ... }:
+let
+ spec = {
+ disko.devices = {
+ disk = {
+ main = {
+ type = "disk";
+ device = config.monorepo.vars.device;
+ content = {
+ type = "gpt";
+ partitions = {
+ ESP = {
+ priority = 1;
+ name = "ESP";
+ start = "1M";
+ end = "128M";
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ mountOptions = [ "umask=0077" ];
+ };
+ };
+ root = {
+ size = "100%";
+ content = {
+ type = "btrfs";
+ extraArgs = [ "-f" ]; # Override existing partition
+ mountpoint = "/";
+ mountOptions = [
+ "compress=zstd"
+ "noatime"
+ ];
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+};
+in
+{
+ monorepo.vars.diskoSpec = spec;
+ disko.devices = spec.disko.devices;
+}
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1757068644,
- "narHash": "sha256-NOrUtIhTkIIumj1E/Rsv1J37Yi3xGStISEo8tZm3KW4=",
+ "lastModified": 1757347588,
+ "narHash": "sha256-tLdkkC6XnsY9EOZW9TlpesTclELy8W7lL2ClL+nma8o=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "8eb28adfa3dc4de28e792e3bf49fcf9007ca8ac9",
+ "rev": "b599843bad24621dcaa5ab60dac98f9b0eb1cabe",
"type": "github"
},
"original": {
},
"nixpkgs_3": {
"locked": {
- "lastModified": 1757068644,
- "narHash": "sha256-NOrUtIhTkIIumj1E/Rsv1J37Yi3xGStISEo8tZm3KW4=",
+ "lastModified": 1757347588,
+ "narHash": "sha256-tLdkkC6XnsY9EOZW9TlpesTclELy8W7lL2ClL+nma8o=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "8eb28adfa3dc4de28e792e3bf49fcf9007ca8ac9",
+ "rev": "b599843bad24621dcaa5ab60dac98f9b0eb1cabe",
"type": "github"
},
"original": {
},
"nixpkgs_4": {
"locked": {
- "lastModified": 1744868846,
- "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=",
+ "lastModified": 1757034884,
+ "narHash": "sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c",
+ "rev": "ca77296380960cd497a765102eeb1356eb80fed0",
"type": "github"
},
"original": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
- "lastModified": 1757367609,
- "narHash": "sha256-/sMr7GRnb7Y3i0w+qg/5y1LWB3FL8Wai0tPn9aiUlw4=",
+ "lastModified": 1757500034,
+ "narHash": "sha256-27oRr29r98W9/9AFsusHsI3SDtMJtZL2wVbvx/a9dIo=",
"owner": "nix-community",
"repo": "NUR",
- "rev": "6291367b23c38821ca01c64f93c11c5cb56748ad",
+ "rev": "356f3a0c8a844ca237d144bf8a58cf8ad706cf16",
"type": "github"
},
"original": {
"nixpkgs": "nixpkgs_4"
},
"locked": {
- "lastModified": 1754988908,
- "narHash": "sha256-t+voe2961vCgrzPFtZxha0/kmFSHFobzF00sT8p9h0U=",
+ "lastModified": 1757449901,
+ "narHash": "sha256-qwN8nYdSRnmmyyi+uR6m4gXnVktmy5smG1MOrSFD8PI=",
"owner": "Mic92",
"repo": "sops-nix",
- "rev": "3223c7a92724b5d804e9988c6b447a0d09017d48",
+ "rev": "3b4a369df9dd6ee171a7ea4448b50e2528faf850",
"type": "github"
},
"original": {
];
address = "0.0.0.0";
port = 6167;
- allow_registration = true;
+ allow_registration = false;
};
};
}
xdg.portal = {
enable = (! config.monorepo.profiles.ttyonly.enable);
- wlr.enable = true;
+ wlr.enable = (! config.monorepo.profiles.ttyonly.enable);
extraPortals = with pkgs; if (! config.monorepo.profiles.ttyonly.enable) then [
xdg-desktop-portal-gtk
xdg-desktop-portal
};
aliases = {
+ pl = "pull";
+ ps = "push";
co = "checkout";
c = "commit";
a = "add";
- s = "switch";
+ st = "status";
+ sw = "switch";
b = "branch";
};
};
mupdf
zathura
+ fzf
# passwords
age sops
pfetch
libnotify
htop
+
+ (pkgs.writeShellScriptBin "help"
+ ''
+#!/usr/bin/env sh
+# Portable, colored, nicely aligned alias list
+
+# Generate uncolored alias pairs
+aliases=$(cat <<'EOF'
+${let aliases = config.programs.zsh.shellAliases;
+ in lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value:
+ "${name} -> ${value}"
+ ) aliases)}
+EOF
+ )
+
+# Align and color using awk
+echo "$aliases" | awk '
+BEGIN {
+ GREEN="\033[0;32m";
+ YELLOW="\033[0;33m";
+ RESET="\033[0m";
+ maxlen=0;
+ }
+{
+ # Split line on " -> "
+ split($0, parts, / -> /);
+ name[NR]=parts[1];
+ cmd[NR]=parts[2];
+ if(length(parts[1])>maxlen) maxlen=length(parts[1]);
+}
+END {
+ for(i=1;i<=NR;i++) {
+ # printf with fixed width for alias name
+ printf "%s%-*s%s -> %s%s%s\n", GREEN, maxlen, name[i], RESET, YELLOW, cmd[i], RESET;
+ }
+}'
+'')
+
(writeShellScriptBin "remote-build"
''
#!/bin/bash
};
shellAliases = {
+ se = "sops edit";
+ f = "vim $(fzf)";
+ e = "cd $(find . -type d -print | fzf)";
c = "clear";
g = "git";
v = "vim";
services.maddy = {
enable = lib.mkDefault config.monorepo.profiles.server.enable;
openFirewall = true;
- primaryDomain = "ret2pop.net";
+ primaryDomain = "${config.monorepo.vars.remoteHost}";
tls = {
loader = "acme";
};
description = "device that NixOS is installed to";
};
+ fileSystem = lib.mkOption {
+ type = lib.types.str;
+ default = "ext4";
+ example = "btrfs";
+ description = "filesystem to install with disko";
+ };
+
diskoSpec = lib.mkOption {
type = lib.types.attrs;
description = "retains a copy of the disko spec for reflection";
Method = sha256
Hash = d4abdd69aa24de69693885c5bd83a4a0e9ee989e1a69a905041b0dad9abc06ea
Salt = sDY,?H5AxC-!gH3a.:)D
- Hash = ${config.sops.secrets.znc_password_hash}
- Salt = ${config.sops.secrets.znc_password_salt}
</Pass>
'';
modules = [
boot.loader.grub.device = "nodev";
networking = {
+ interfaces.ens3.ipv6.addresses = [
+ {
+ address = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+ prefixLength = 64;
+ }
+ ];
firewall.allowedTCPPorts = [
80
443