Compare commits

...

3 Commits

Author SHA1 Message Date
tux
f6fcb02dde docs: update hosts list 2025-05-08 23:17:41 +05:30
tux
0cb28d1ef5 feat: update uid and gid 2025-05-08 23:14:01 +05:30
tux
d4cd75e9d2 feat: move capella to nix-on-droid 2025-05-08 23:13:43 +05:30
6 changed files with 83 additions and 157 deletions

View File

@ -28,8 +28,8 @@
| ☁️ | VPS | arcturus | 4 Core - 8 GB RAM | Primary server responsible for exposing my homelab applications to the internet. |
| 🥔 | VPS | alpha | 2 Core - 4 GB RAM | Monitors uptime and health status of all services across the infrastructure. |
| 🥔 | Server | vega | Cortex A53 - 1 GB RAM | Running AdGuard Home for network-wide ad blocking. |
| ☁️ | VPS | capella | 4 Core - 6 GB RAM | For running Minecraft, CS 2, Rust game servers. |
| 📱 | VPS | rigel | S21 Ultra - 12 GB RAM | Yes, I run nix on my android device. lol |
| 📱 | Phone | capella | S25 Ultra - 12 GB RAM | Yes, I run nix on my android device. lol |
| 📱 | Phone | rigel | Edge 30 - 8 GB RAM (Rooted) | Yes, I run nix on my android device. lol |
| ☁️ | VPS | node | i9-13900 - 64 GB RAM | Running Ethereum and BSC nodes. Currently in the process of migrating from Ubuntu. |
## Installation

View File

@ -66,7 +66,6 @@
alpha = nixosSystem (mkNixOSConfig "alpha");
sirius = nixosSystem (mkNixOSConfig "sirius");
vega = nixosSystem (mkNixOSConfig "vega");
capella = nixosSystem (mkNixOSConfig "capella");
vps = nixosSystem (mkNixOSConfig "vps");
isoImage = nixosSystem (mkNixOSConfig "isoImage");
homelab = nixosSystem (mkNixOSConfig "homelab");
@ -75,6 +74,7 @@
# NixOnDroid configuration entrypoint
# 'nix-on-droid switch --flake .#your-hostname'
nixOnDroidConfigurations = {
capella = nixOnDroidConfiguration (mkDroidConfig "capella");
rigel = nixOnDroidConfiguration (mkDroidConfig "rigel");
};

View File

@ -1,104 +1,63 @@
{
modulesPath,
inputs,
pkgs,
username,
lib,
outputs,
inputs,
email,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
inputs.disko.nixosModules.default
(import ./disko.nix {device = "/dev/vda";})
../common
../../modules/droid/sshd.nix
];
tux.services.openssh.enable = true;
android-integration.am.enable = true;
android-integration.termux-open-url.enable = true;
android-integration.xdg-open.enable = true;
android-integration.termux-setup-storage.enable = true;
android-integration.termux-reload-settings.enable = true;
nixpkgs = {
hostPlatform = "x86_64-linux";
};
terminal.font = let
firacode = pkgs.nerd-fonts.fira-code;
fontPath = "share/fonts/truetype/NerdFonts/FiraCode/FiraCodeNerdFont-Regular.ttf";
in "${firacode}/${fontPath}";
boot = {
initrd.systemd = {
enable = lib.mkForce true;
time.timeZone = "Asia/Kolkata";
services.wipe-my-fs = {
wantedBy = ["initrd.target"];
after = ["initrd-root-device.target"];
before = ["sysroot.mount"];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
mkdir /btrfs_tmp
mount /dev/disk/by-partlabel/disk-primary-root /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
};
};
loader = {
grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
};
};
networking = {
hostName = "capella";
firewall.enable = false;
};
users = {
users.${username} = {
password = "${username}";
hashedPasswordFile = lib.mkForce null;
};
};
programs.fuse.userAllowOther = true;
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist" = {
hideMounts = true;
directories = [
"/var/log"
"/var/lib/nixos"
];
files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
tux.services.openssh = {
enable = true;
ports = [8022];
authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+OzPUe2ECPC929DqpkM39tl/vdNAXfsRnmrGfR+X3D ${email}"
];
};
home-manager.users.${username} = {
imports = [
./home.nix
];
user = {
uid = 10479;
gid = 10479;
shell = "${pkgs.zsh}/bin/zsh";
};
system.stateVersion = "24.11";
environment.etcBackupExtension = ".backup";
environment.motd = '''';
environment.packages = with pkgs; [
nano
git
neovim
openssh
inputs.trok.packages."aarch64-linux".default
];
home-manager = {
config = ./home.nix;
backupFileExtension = "backup";
extraSpecialArgs = {inherit inputs outputs username email;};
useGlobalPkgs = true;
};
# Set up nix for flakes
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
system.stateVersion = "24.05";
}

View File

@ -1,53 +0,0 @@
{device ? throw "Set this to the disk device, e.g. /dev/nvme0n1", ...}: {
disko.devices.disk.primary = {
inherit device;
type = "disk";
content = {
type = "gpt"; # GPT partitioning scheme
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
# EFI Partition
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["defaults" "umask=0077"];
};
};
# Btrfs Root Partition
root = {
size = "100%"; # Use remaining space
type = "8300"; # Linux filesystem type
content = {
type = "btrfs";
subvolumes = {
"/root" = {
mountOptions = ["compress=zstd"]; # Compression for better performance
mountpoint = "/"; # Root subvolume
};
"/persist" = {
mountOptions = ["compress=zstd"]; # Compression for persistent data
mountpoint = "/persist"; # Persistent subvolume
};
"/nix" = {
mountOptions = [
"compress=zstd"
"noatime"
"noacl"
]; # Optimize for Nix store
mountpoint = "/nix"; # Nix subvolume
};
};
};
};
};
};
};
}

View File

@ -1,14 +1,34 @@
{username, ...}: {
home.persistence."/persist/home/${username}" = {
directories = [
"Projects"
".ssh"
];
files = [
".zsh_history"
];
allowOther = true;
{pkgs, ...}: {
imports = [
../../modules/home/git
../../modules/home/starship
];
programs = {
bat.enable = true;
zoxide = {
enable = true;
options = ["--cmd cd"];
};
zsh = {
enable = true;
shellAliases = {
ls = "lsd";
};
syntaxHighlighting.enable = true;
autosuggestion.enable = true;
initContent = ''
fastfetch
'';
};
};
home.stateVersion = "24.11";
home.packages = with pkgs; [
neovim
busybox
lsd
fastfetch
];
home.stateVersion = "24.05";
}

View File

@ -32,8 +32,8 @@
};
user = {
uid = 10395;
gid = 10395;
uid = 10225;
gid = 10225;
shell = "${pkgs.zsh}/bin/zsh";
};