summaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorPreston Pan <ret2pop@gmail.com>2025-09-12 19:32:06 -0700
committerPreston Pan <ret2pop@gmail.com>2025-09-12 19:32:06 -0700
commitcae70df061d9fc4f33a2da66a21c86eb3eb1fa3b (patch)
treebaa5edf5af062f3a28647f318165d196b0b7093d /nix
parentc15492d8aa38b7125dc6574c08f6a765aad44fcb (diff)
update before new lock file, working on VPS
Diffstat (limited to 'nix')
-rw-r--r--nix/disko/btrfs-simple.nix47
-rw-r--r--nix/flake.lock30
-rw-r--r--nix/modules/conduit.nix2
-rw-r--r--nix/modules/configuration.nix2
-rw-r--r--nix/modules/home/git.nix5
-rw-r--r--nix/modules/home/user.nix39
-rw-r--r--nix/modules/home/zsh.nix3
-rw-r--r--nix/modules/maddy.nix2
-rw-r--r--nix/modules/vars.nix7
-rw-r--r--nix/modules/znc.nix2
-rw-r--r--nix/systems/spontaneity/default.nix6
11 files changed, 124 insertions, 21 deletions
diff --git a/nix/disko/btrfs-simple.nix b/nix/disko/btrfs-simple.nix
new file mode 100644
index 0000000..08fafd4
--- /dev/null
+++ b/nix/disko/btrfs-simple.nix
@@ -0,0 +1,47 @@
+{ 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;
+}
diff --git a/nix/flake.lock b/nix/flake.lock
index f90d69b..7f2b3b2 100644
--- a/nix/flake.lock
+++ b/nix/flake.lock
@@ -378,11 +378,11 @@
},
"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": {
@@ -394,11 +394,11 @@
},
"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": {
@@ -410,11 +410,11 @@
},
"nixpkgs_4": {
"locked": {
- "lastModified": 1744868846,
- "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=",
+ "lastModified": 1757034884,
+ "narHash": "sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c",
+ "rev": "ca77296380960cd497a765102eeb1356eb80fed0",
"type": "github"
},
"original": {
@@ -430,11 +430,11 @@
"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": {
@@ -558,11 +558,11 @@
"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": {
diff --git a/nix/modules/conduit.nix b/nix/modules/conduit.nix
index ce2c23e..e47c7a2 100644
--- a/nix/modules/conduit.nix
+++ b/nix/modules/conduit.nix
@@ -10,7 +10,7 @@
];
address = "0.0.0.0";
port = 6167;
- allow_registration = true;
+ allow_registration = false;
};
};
}
diff --git a/nix/modules/configuration.nix b/nix/modules/configuration.nix
index 7234333..27002ff 100644
--- a/nix/modules/configuration.nix
+++ b/nix/modules/configuration.nix
@@ -284,7 +284,7 @@
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
diff --git a/nix/modules/home/git.nix b/nix/modules/home/git.nix
index 9c15aac..0e6e66c 100644
--- a/nix/modules/home/git.nix
+++ b/nix/modules/home/git.nix
@@ -14,10 +14,13 @@
};
aliases = {
+ pl = "pull";
+ ps = "push";
co = "checkout";
c = "commit";
a = "add";
- s = "switch";
+ st = "status";
+ sw = "switch";
b = "branch";
};
};
diff --git a/nix/modules/home/user.nix b/nix/modules/home/user.nix
index d0cad9a..24b61da 100644
--- a/nix/modules/home/user.nix
+++ b/nix/modules/home/user.nix
@@ -29,6 +29,7 @@
mupdf
zathura
+ fzf
# passwords
age sops
@@ -64,6 +65,44 @@
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
diff --git a/nix/modules/home/zsh.nix b/nix/modules/home/zsh.nix
index e12a2d8..cb4f1b0 100644
--- a/nix/modules/home/zsh.nix
+++ b/nix/modules/home/zsh.nix
@@ -21,6 +21,9 @@
};
shellAliases = {
+ se = "sops edit";
+ f = "vim $(fzf)";
+ e = "cd $(find . -type d -print | fzf)";
c = "clear";
g = "git";
v = "vim";
diff --git a/nix/modules/maddy.nix b/nix/modules/maddy.nix
index 158b6b5..f97ba05 100644
--- a/nix/modules/maddy.nix
+++ b/nix/modules/maddy.nix
@@ -3,7 +3,7 @@
services.maddy = {
enable = lib.mkDefault config.monorepo.profiles.server.enable;
openFirewall = true;
- primaryDomain = "ret2pop.net";
+ primaryDomain = "${config.monorepo.vars.remoteHost}";
tls = {
loader = "acme";
};
diff --git a/nix/modules/vars.nix b/nix/modules/vars.nix
index 4b7c894..de9736e 100644
--- a/nix/modules/vars.nix
+++ b/nix/modules/vars.nix
@@ -8,6 +8,13 @@
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";
diff --git a/nix/modules/znc.nix b/nix/modules/znc.nix
index d32d564..c2e2079 100644
--- a/nix/modules/znc.nix
+++ b/nix/modules/znc.nix
@@ -10,8 +10,6 @@
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 = [
diff --git a/nix/systems/spontaneity/default.nix b/nix/systems/spontaneity/default.nix
index 5460428..3ab7a9e 100644
--- a/nix/systems/spontaneity/default.nix
+++ b/nix/systems/spontaneity/default.nix
@@ -18,6 +18,12 @@
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