mirror of
https://github.com/tuxdotrs/nixos-config.git
synced 2025-07-06 17:56:35 +05:30
Compare commits
3 Commits
caa191c4ec
...
f6fcb02dde
Author | SHA1 | Date | |
---|---|---|---|
f6fcb02dde | |||
0cb28d1ef5
|
|||
d4cd75e9d2
|
@ -28,8 +28,8 @@
|
|||||||
| ☁️ | VPS | arcturus | 4 Core - 8 GB RAM | Primary server responsible for exposing my homelab applications to the internet. |
|
| ☁️ | 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. |
|
| 🥔 | 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. |
|
| 🥔 | 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. |
|
| 📱 | Phone | capella | S25 Ultra - 12 GB RAM | Yes, I run nix on my android device. lol |
|
||||||
| 📱 | VPS | rigel | S21 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. |
|
| ☁️ | VPS | node | i9-13900 - 64 GB RAM | Running Ethereum and BSC nodes. Currently in the process of migrating from Ubuntu. |
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
@ -66,7 +66,6 @@
|
|||||||
alpha = nixosSystem (mkNixOSConfig "alpha");
|
alpha = nixosSystem (mkNixOSConfig "alpha");
|
||||||
sirius = nixosSystem (mkNixOSConfig "sirius");
|
sirius = nixosSystem (mkNixOSConfig "sirius");
|
||||||
vega = nixosSystem (mkNixOSConfig "vega");
|
vega = nixosSystem (mkNixOSConfig "vega");
|
||||||
capella = nixosSystem (mkNixOSConfig "capella");
|
|
||||||
vps = nixosSystem (mkNixOSConfig "vps");
|
vps = nixosSystem (mkNixOSConfig "vps");
|
||||||
isoImage = nixosSystem (mkNixOSConfig "isoImage");
|
isoImage = nixosSystem (mkNixOSConfig "isoImage");
|
||||||
homelab = nixosSystem (mkNixOSConfig "homelab");
|
homelab = nixosSystem (mkNixOSConfig "homelab");
|
||||||
@ -75,6 +74,7 @@
|
|||||||
# NixOnDroid configuration entrypoint
|
# NixOnDroid configuration entrypoint
|
||||||
# 'nix-on-droid switch --flake .#your-hostname'
|
# 'nix-on-droid switch --flake .#your-hostname'
|
||||||
nixOnDroidConfigurations = {
|
nixOnDroidConfigurations = {
|
||||||
|
capella = nixOnDroidConfiguration (mkDroidConfig "capella");
|
||||||
rigel = nixOnDroidConfiguration (mkDroidConfig "rigel");
|
rigel = nixOnDroidConfiguration (mkDroidConfig "rigel");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,104 +1,63 @@
|
|||||||
{
|
{
|
||||||
modulesPath,
|
pkgs,
|
||||||
inputs,
|
|
||||||
username,
|
username,
|
||||||
lib,
|
outputs,
|
||||||
|
inputs,
|
||||||
|
email,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
../../modules/droid/sshd.nix
|
||||||
(modulesPath + "/profiles/qemu-guest.nix")
|
|
||||||
inputs.disko.nixosModules.default
|
|
||||||
(import ./disko.nix {device = "/dev/vda";})
|
|
||||||
|
|
||||||
../common
|
|
||||||
];
|
];
|
||||||
|
|
||||||
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 = {
|
terminal.font = let
|
||||||
hostPlatform = "x86_64-linux";
|
firacode = pkgs.nerd-fonts.fira-code;
|
||||||
};
|
fontPath = "share/fonts/truetype/NerdFonts/FiraCode/FiraCodeNerdFont-Regular.ttf";
|
||||||
|
in "${firacode}/${fontPath}";
|
||||||
|
|
||||||
boot = {
|
time.timeZone = "Asia/Kolkata";
|
||||||
initrd.systemd = {
|
|
||||||
enable = lib.mkForce true;
|
|
||||||
|
|
||||||
services.wipe-my-fs = {
|
tux.services.openssh = {
|
||||||
wantedBy = ["initrd.target"];
|
enable = true;
|
||||||
after = ["initrd-root-device.target"];
|
ports = [8022];
|
||||||
before = ["sysroot.mount"];
|
authorizedKeys = [
|
||||||
unitConfig.DefaultDependencies = "no";
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+OzPUe2ECPC929DqpkM39tl/vdNAXfsRnmrGfR+X3D ${email}"
|
||||||
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"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.${username} = {
|
user = {
|
||||||
imports = [
|
uid = 10479;
|
||||||
./home.nix
|
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";
|
||||||
}
|
}
|
||||||
|
@ -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
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,14 +1,34 @@
|
|||||||
{username, ...}: {
|
{pkgs, ...}: {
|
||||||
home.persistence."/persist/home/${username}" = {
|
imports = [
|
||||||
directories = [
|
../../modules/home/git
|
||||||
"Projects"
|
../../modules/home/starship
|
||||||
".ssh"
|
];
|
||||||
];
|
|
||||||
files = [
|
programs = {
|
||||||
".zsh_history"
|
bat.enable = true;
|
||||||
];
|
zoxide = {
|
||||||
allowOther = true;
|
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";
|
||||||
}
|
}
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
user = {
|
user = {
|
||||||
uid = 10395;
|
uid = 10225;
|
||||||
gid = 10395;
|
gid = 10225;
|
||||||
shell = "${pkgs.zsh}/bin/zsh";
|
shell = "${pkgs.zsh}/bin/zsh";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user