mirror of
https://github.com/tuxdotrs/nixos-config.git
synced 2025-07-06 09:46:34 +05:30
feat: move capella to nix-on-droid
This commit is contained in:
@ -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");
|
||||
};
|
||||
|
||||
|
@ -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";
|
||||
}
|
||||
|
@ -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, ...}: {
|
||||
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";
|
||||
}
|
||||
|
Reference in New Issue
Block a user