wip new iso installer and onboarding instructions

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-11-24 22:20:26 -06:00
parent 1927da563a
commit 60f94c752d
6 changed files with 1094 additions and 128 deletions

View file

@ -1,48 +0,0 @@
{ pkgs, ... }:
{
networking.hostName = "%%HOSTNAME%%";
networking.networkmanager.enable = true;
services.openssh.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.systemPackages = with pkgs; [
vim
curl
git
sudo
];
users.users.%%USERNAME%% = {
initialPassword = "password1";
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "video" "input" ];
};
# Ensure SSH key pair generation for non-root users
systemd.services.generate_ssh_key = {
description = "Generate SSH key pair for %%USERNAME%%";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "%%USERNAME%%";
Type = "oneshot";
};
script = ''
#!/run/current-system/sw/bin/bash
if [ ! -f /home/%%USERNAME%%/.ssh/id_ed25519 ]; then
if [ -v DRY_RUN ]; then
echo "DRY_RUN is set. Would generate SSH key for %%USERNAME%%."
else
echo "Generating SSH key for %%USERNAME%%."
mkdir -p /home/%%USERNAME%%/.ssh
chmod 700 /home/%%USERNAME%%/.ssh
/run/current-system/sw/bin/ssh-keygen -t ed25519 -f /home/%%USERNAME%%/.ssh/id_ed25519 -N ""
fi
else
echo "SSH key already exists for %%USERNAME%%."
fi
'';
};
}

View file

@ -1,44 +0,0 @@
#!/bin/sh
# curl -O --proto '=https' --tlsv1.2 -sSf https://git.joshuabell.xyz/ringofstorms/dotfiles/raw/branch/master/onboard.sh
# Go to nix configuration
cd /mnt/etc/nixos
# Ask for required variables
VAR_HOST=$HOSTNAME
VAR_USER=$USERNAME
echo "Hostname will be: $VAR_HOST"
echo "Username will be: $VAR_USER"
while true; do
read -p "Do you wish to continue? (y/n)" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer y/n.";;
esac
done
# Switch to use labels in hardware-configuration
# ex +'/fileSystems."\/"' +"/by-uuid" +'s#by-uuid/.*"#by-label/NIXROOT"' \
# +'/fileSystems."\/boot"' +"/by-uuid" +'s#by-uuid/.*"#by-label/NIXBOOT"' \
# +"wq" hardware-configuration.nix
# echo "Switched hardware configuration to use labels"
# grep "by-uuid" hardware-configuration.nix # Should show nothing, this will help prompt for changes
# grep "by-label" hardware-configuration.nix
# echo
# echo "TODO add swap section here that asks for sizes..."
# echo
# Download settings needed for initial boot
curl -O https://git.joshuabell.xyz/ringofstorms/dotfiles/raw/branch/master/onboard.nix
# update username and hostname in onboard file
ex +"%s/%%HOSTNAME%%/$VAR_HOST/g" +"%s/%%USERNAME%%/$VAR_USER/g" +"wq" onboard.nix
# Import onboard file in configuration.nix
ex +"%s#hardware-configuration.nix#hardware-configuration.nix ./onboard.nix#g" +"wq" configuration.nix
echo "Setup onboard.nix in configuration.nix"
echo
echo "Run \`nixos-install\` to finish then reboot"
echo "It's recommended to verify contents of hardware config first."
echo

View file

@ -29,46 +29,30 @@
```bash ```bash
# Partition main drive with btrfs # Partition main drive with btrfs
lsblk # tip: lsblk
echo "Read the above output and determine what drive to install NixOS on" export D=sda # or whatever drive we will be installing on
read -p "Enter device name: " DEVICE
# Partitioning # Partitioning
echo "Creating partitions on $DEVICE..." echo "Creating partitions on $D..."
parted /dev/$DEVICE -- mklabel gpt # make GPT partition table parted /dev/$D -- mklabel gpt # make GPT partition table
parted /dev/$DEVICE -- mkpart NIXROOT 2GB 100% # make root partition (2GB offset for boot) parted /dev/$D -- mkpart NIXROOT 2GB 100% # make root partition (2GB offset for boot)
parted /dev/$DEVICE -- mkpart ESP fat32 1MB 2GB # make boot partition, 1MB alignment offset parted /dev/$D -- mkpart ESP fat32 1MB 2GB # make boot partition, 1MB alignment offset
parted /dev/$DEVICE -- set 2 esp on # make boot partition bootable parted /dev/$D -- set 2 esp on # make boot partition bootable
ROOT=$DEVICE"1" # NOTE this is not bulletproof, check actual name and set these appropriately
BOOT=$DEVICE"2" export ROOT=$D"1"
export BOOT=$D"2"
# Encryption Luks # Anything else to partition before moving on?
prompt="Use encryption on root partition?" var=ENC && read -r -p "$prompt (y/n) [n]: " resp && resp=$(echo "$resp" | tr '[:upper:]' '[:lower:]'); [[ "$resp" == "y" || "$resp" == "yes" || "$resp" == "1" ]] && export $var=true || export $var=false
if [ $ENC = true ]; then # Encryption Luks (optional)
while true; do export ENC=true
echo "Setting up encrypted root, you will want to save the passphrase somewhere!"
cryptsetup luksFormat /dev/$ROOT cryptsetup luksFormat /dev/$ROOT
if [ $? -eq 0 ]; then
echo "Encryption setup successful"
cryptsetup luksOpen /dev/$ROOT cryptroot cryptsetup luksOpen /dev/$ROOT cryptroot
break
elif [ $? -eq 2 ]; then
echo "Missmatched passphrase, try again or select NO to cancel encryption"
else
prompt="Failed to setup encrypted root, continue without encryption?" var=CON && read -r -p "$prompt (y/n) [n]: " resp && resp=$(echo "$resp" | tr '[:upper:]' '[:lower:]'); [[ "$resp" == "y" || "$resp" == "yes" || "$resp" == "1" ]] && export $var=true || export $var=false
if [ $CON = true ]; then
ENC=false
break
fi
fi
done
fi
if [ $ENC = true ]; then ROOTP="/dev/mapper/cryptroot" ; else ROOTP="/dev/$ROOT"; fi if [ $ENC = true ]; then ROOTP="/dev/mapper/cryptroot" ; else ROOTP="/dev/$ROOT"; fi
# Formatting # Formatting
echo "Formatting drives..."
mkfs.fat -F 32 -n NIXBOOT /dev/$BOOT mkfs.fat -F 32 -n NIXBOOT /dev/$BOOT
mkfs.btrfs -fL NIXROOT $ROOTP mkfs.btrfs -fL NIXROOT $ROOTP
@ -79,15 +63,18 @@ if [ $SUBV = true ]; then
btrfs subvolume create /mnt/root btrfs subvolume create /mnt/root
btrfs subvolume create /mnt/nix btrfs subvolume create /mnt/nix
btrfs subvolume create /mnt/snapshots btrfs subvolume create /mnt/snapshots
btrfs subvolume create /mnt/swap
umount /mnt umount /mnt
fi fi
if [ $SUBV = true ]; then if [ $SUBV = true ]; then
mount $ROOTP /mnt
mount -o subvol=root,compress=zstd,noatime $ROOTP /mnt mount -o subvol=root,compress=zstd,noatime $ROOTP /mnt
mkdir -p /mnt/{nix,boot,.snapshots} mkdir -p /mnt/{nix,boot,.snapshots,.swap}
chattr +C /mnt/.swap
mount -o subvol=nix,compress=zstd,noatime $ROOTP /mnt/nix mount -o subvol=nix,compress=zstd,noatime $ROOTP /mnt/nix
mount -o subvol=snapshots,compress=zstd,noatime $ROOTP /mnt/.snapshots mount -o subvol=snapshots,compress=zstd,noatime $ROOTP /mnt/.snapshots
mount -o subvol=swap,noatime $ROOTP /mnt/.swap
btrfs property set /mnt/.swap compression none
mount -o umask=077 /dev/disk/by-label/NIXBOOT /mnt/boot mount -o umask=077 /dev/disk/by-label/NIXBOOT /mnt/boot
else else
mount -o compress=zstd,noatime $ROOTP /mnt mount -o compress=zstd,noatime $ROOTP /mnt
@ -104,7 +91,11 @@ if [ $SWP = true ]; then
read -r -p "Custom size in GB? [$SIZE]" SIZE_OVERRIDE read -r -p "Custom size in GB? [$SIZE]" SIZE_OVERRIDE
SIZE="${SIZE_OVERRIDE:-$SIZE}" SIZE="${SIZE_OVERRIDE:-$SIZE}"
SWAP_DEVICE=' swapDevices = [ { device = "/.swapfile"; size = $SIZE * 1024; } ];' if [ $SUBV = true ]; then
SWAP_DEVICE=' swapDevices = [ { device = "/.swap/file"; size = '$SIZE' * 1024; } ];'
else
SWAP_DEVICE=' swapDevices = [ { device = "/.swapfile"; size = '$SIZE' * 1024; } ];'
fi
sed -i "/swapDevices/c\\$SWAP_DEVICE" /mnt/etc/nixos/hardware-configuration.nix sed -i "/swapDevices/c\\$SWAP_DEVICE" /mnt/etc/nixos/hardware-configuration.nix
echo "Added swap device to hardware configuration" echo "Added swap device to hardware configuration"
fi fi

View file

@ -1,11 +1,985 @@
{ {
"nodes": { "nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1764040936,
"narHash": "sha256-d1NFBVGQZ/Xb0pMviuzenqrfXymJs0m/pKrEg1tDGsE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b9491974f02dadeb5acca22649ccbd89a6a81afb",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nvim_plugin-Almo7aya/openingh.nvim": {
"flake": false,
"locked": {
"lastModified": 1746139196,
"narHash": "sha256-/FlNLWOSIrOYiWzAcgOdu9//QTorCDV1KWb+h6eqLwk=",
"owner": "Almo7aya",
"repo": "openingh.nvim",
"rev": "7cc8c897cb6b34d8ed28e99d95baccef609ed251",
"type": "github"
},
"original": {
"owner": "Almo7aya",
"repo": "openingh.nvim",
"type": "github"
}
},
"nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": {
"flake": false,
"locked": {
"lastModified": 1763599441,
"narHash": "sha256-RwCQQfgQIQITVSJSX+QOSIOChT7E2AXdIwfU07S9GaU=",
"owner": "CopilotC-Nvim",
"repo": "CopilotChat.nvim",
"rev": "df5376c132382dd47e3e552612940cbf25b3580c",
"type": "github"
},
"original": {
"owner": "CopilotC-Nvim",
"repo": "CopilotChat.nvim",
"type": "github"
}
},
"nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": {
"flake": false,
"locked": {
"lastModified": 1733574156,
"narHash": "sha256-AjDM3+n4+lNBQi8P2Yrh0Ab06uYCndBQT9TX36rDbOM=",
"owner": "JoosepAlviste",
"repo": "nvim-ts-context-commentstring",
"rev": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f",
"type": "github"
},
"original": {
"owner": "JoosepAlviste",
"repo": "nvim-ts-context-commentstring",
"type": "github"
}
},
"nvim_plugin-L3MON4D3/LuaSnip": {
"flake": false,
"locked": {
"lastModified": 1762213057,
"narHash": "sha256-Pil9m8zN3XzMtPT8spdr78dzkMW7dcpVnbWzie6524A=",
"owner": "L3MON4D3",
"repo": "LuaSnip",
"rev": "3732756842a2f7e0e76a7b0487e9692072857277",
"type": "github"
},
"original": {
"owner": "L3MON4D3",
"repo": "LuaSnip",
"type": "github"
}
},
"nvim_plugin-MeanderingProgrammer/render-markdown.nvim": {
"flake": false,
"locked": {
"lastModified": 1763430554,
"narHash": "sha256-0DwPuzqR+7R4lJFQ9f2xN26YhdQKg85Hw6+bPvloZoc=",
"owner": "MeanderingProgrammer",
"repo": "render-markdown.nvim",
"rev": "6e0e8902dac70fecbdd8ce557d142062a621ec38",
"type": "github"
},
"original": {
"owner": "MeanderingProgrammer",
"repo": "render-markdown.nvim",
"type": "github"
}
},
"nvim_plugin-MunifTanjim/nui.nvim": {
"flake": false,
"locked": {
"lastModified": 1749392788,
"narHash": "sha256-41slmnvt1z7sCxvpiVuFmQ9g7eCaxQi1dDCL3AxSL1A=",
"owner": "MunifTanjim",
"repo": "nui.nvim",
"rev": "de740991c12411b663994b2860f1a4fd0937c130",
"type": "github"
},
"original": {
"owner": "MunifTanjim",
"repo": "nui.nvim",
"type": "github"
}
},
"nvim_plugin-RRethy/vim-illuminate": {
"flake": false,
"locked": {
"lastModified": 1748105647,
"narHash": "sha256-KqAJRCtDBG5xsvNsqkxoBdDckg02u4NBBreYQw7BphA=",
"owner": "RRethy",
"repo": "vim-illuminate",
"rev": "0d1e93684da00ab7c057410fecfc24f434698898",
"type": "github"
},
"original": {
"owner": "RRethy",
"repo": "vim-illuminate",
"type": "github"
}
},
"nvim_plugin-Saecki/crates.nvim": {
"flake": false,
"locked": {
"lastModified": 1755956579,
"narHash": "sha256-jfmST/S9ymwgQ99PTCOlJkk5zaxE5HiDV16TmTISDII=",
"owner": "Saecki",
"repo": "crates.nvim",
"rev": "ac9fa498a9edb96dc3056724ff69d5f40b898453",
"type": "github"
},
"original": {
"owner": "Saecki",
"repo": "crates.nvim",
"type": "github"
}
},
"nvim_plugin-aznhe21/actions-preview.nvim": {
"flake": false,
"locked": {
"lastModified": 1759462626,
"narHash": "sha256-YUeWBXxxeurfWBi0PjUi6izqYAvUw9DHmvsuPXm7ohw=",
"owner": "aznhe21",
"repo": "actions-preview.nvim",
"rev": "cb938c25edaac38d362555f19244a9cb85d561e8",
"type": "github"
},
"original": {
"owner": "aznhe21",
"repo": "actions-preview.nvim",
"type": "github"
}
},
"nvim_plugin-b0o/schemastore.nvim": {
"flake": false,
"locked": {
"lastModified": 1763748041,
"narHash": "sha256-4KKj1zp+5Z2zbC31hpvw73BIuf4dW7rimepGOggmUp4=",
"owner": "b0o",
"repo": "schemastore.nvim",
"rev": "aa25399c48236b77af71d4b64cdf157d2ba4e990",
"type": "github"
},
"original": {
"owner": "b0o",
"repo": "schemastore.nvim",
"type": "github"
}
},
"nvim_plugin-catppuccin/nvim": {
"flake": false,
"locked": {
"lastModified": 1763995197,
"narHash": "sha256-i4WmQzSNWeR5rh61yonzR55yyklJ3xOL8D/XyEnDa+E=",
"owner": "catppuccin",
"repo": "nvim",
"rev": "180e0435707cf1fed09a98a9739e5807d92b69be",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "nvim",
"type": "github"
}
},
"nvim_plugin-chrisgrieser/nvim-early-retirement": {
"flake": false,
"locked": {
"lastModified": 1764013541,
"narHash": "sha256-Mzz1y7YYTYUWv9S/Yr26to7AuDCZ+9asHa3qzDz06D0=",
"owner": "chrisgrieser",
"repo": "nvim-early-retirement",
"rev": "6fb7d87a965e439cfb4e04a5c0e5038010fc015b",
"type": "github"
},
"original": {
"owner": "chrisgrieser",
"repo": "nvim-early-retirement",
"type": "github"
}
},
"nvim_plugin-declancm/cinnamon.nvim": {
"flake": false,
"locked": {
"lastModified": 1722992123,
"narHash": "sha256-kccQ4iFMSQ8kvE7hYz90hBrsDLo7VohFj/6lEZZiAO8=",
"owner": "declancm",
"repo": "cinnamon.nvim",
"rev": "450cb3247765fed7871b41ef4ce5fa492d834215",
"type": "github"
},
"original": {
"owner": "declancm",
"repo": "cinnamon.nvim",
"type": "github"
}
},
"nvim_plugin-folke/lazy.nvim": {
"flake": false,
"locked": {
"lastModified": 1762421181,
"narHash": "sha256-h5404njTAfqMJFQ3MAr2PWSbV81eS4aIs0cxAXkT0EM=",
"owner": "folke",
"repo": "lazy.nvim",
"rev": "85c7ff3711b730b4030d03144f6db6375044ae82",
"type": "github"
},
"original": {
"owner": "folke",
"repo": "lazy.nvim",
"type": "github"
}
},
"nvim_plugin-folke/neodev.nvim": {
"flake": false,
"locked": {
"lastModified": 1720260306,
"narHash": "sha256-hOjzlo/IqmV8tYjGwfmcCPEmHYsWnEIwtHZdhpwA1kM=",
"owner": "folke",
"repo": "neodev.nvim",
"rev": "46aa467dca16cf3dfe27098042402066d2ae242d",
"type": "github"
},
"original": {
"owner": "folke",
"repo": "neodev.nvim",
"type": "github"
}
},
"nvim_plugin-folke/which-key.nvim": {
"flake": false,
"locked": {
"lastModified": 1761664528,
"narHash": "sha256-rKaYnXM4gRkkF/+xIFm2oCZwtAU6CeTdRWU93N+Jmbc=",
"owner": "folke",
"repo": "which-key.nvim",
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
"type": "github"
},
"original": {
"owner": "folke",
"repo": "which-key.nvim",
"type": "github"
}
},
"nvim_plugin-hrsh7th/cmp-buffer": {
"flake": false,
"locked": {
"lastModified": 1743497185,
"narHash": "sha256-dG4U7MtnXThoa/PD+qFtCt76MQ14V1wX8GMYcvxEnbM=",
"owner": "hrsh7th",
"repo": "cmp-buffer",
"rev": "b74fab3656eea9de20a9b8116afa3cfc4ec09657",
"type": "github"
},
"original": {
"owner": "hrsh7th",
"repo": "cmp-buffer",
"type": "github"
}
},
"nvim_plugin-hrsh7th/cmp-nvim-lsp": {
"flake": false,
"locked": {
"lastModified": 1763018865,
"narHash": "sha256-CYZdfAsJYQyW413fRvNbsS5uayuc6fKDvDLZ2Y7j3ZQ=",
"owner": "hrsh7th",
"repo": "cmp-nvim-lsp",
"rev": "cbc7b02bb99fae35cb42f514762b89b5126651ef",
"type": "github"
},
"original": {
"owner": "hrsh7th",
"repo": "cmp-nvim-lsp",
"type": "github"
}
},
"nvim_plugin-hrsh7th/cmp-path": {
"flake": false,
"locked": {
"lastModified": 1753844861,
"narHash": "sha256-e4Rd2y1Wekp7aobpTGaUeoSBnlfIASDaBR8js5dh2Vw=",
"owner": "hrsh7th",
"repo": "cmp-path",
"rev": "c642487086dbd9a93160e1679a1327be111cbc25",
"type": "github"
},
"original": {
"owner": "hrsh7th",
"repo": "cmp-path",
"type": "github"
}
},
"nvim_plugin-hrsh7th/nvim-cmp": {
"flake": false,
"locked": {
"lastModified": 1763258674,
"narHash": "sha256-Z6F8auKq1jSgGoPhV4RbkB1YTexnolSbEjpa/JJI/Fc=",
"owner": "hrsh7th",
"repo": "nvim-cmp",
"rev": "d97d85e01339f01b842e6ec1502f639b080cb0fc",
"type": "github"
},
"original": {
"owner": "hrsh7th",
"repo": "nvim-cmp",
"type": "github"
}
},
"nvim_plugin-j-hui/fidget.nvim": {
"flake": false,
"locked": {
"lastModified": 1761243883,
"narHash": "sha256-XXTeJweQRIsC/WFhFxFbepOETV8e5Wfmh513su2Wve0=",
"owner": "j-hui",
"repo": "fidget.nvim",
"rev": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a",
"type": "github"
},
"original": {
"owner": "j-hui",
"repo": "fidget.nvim",
"type": "github"
}
},
"nvim_plugin-johmsalas/text-case.nvim": {
"flake": false,
"locked": {
"lastModified": 1722628320,
"narHash": "sha256-2IMufSMy9JW50VzZ3SgOtp8kYs81ANwV0eP0ZH3rTFo=",
"owner": "johmsalas",
"repo": "text-case.nvim",
"rev": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457",
"type": "github"
},
"original": {
"owner": "johmsalas",
"repo": "text-case.nvim",
"type": "github"
}
},
"nvim_plugin-lewis6991/gitsigns.nvim": {
"flake": false,
"locked": {
"lastModified": 1763280728,
"narHash": "sha256-w2/osNJwbtmUxxQIXBsyqMYrvyNUaVzXrUNGYqGmzi4=",
"owner": "lewis6991",
"repo": "gitsigns.nvim",
"rev": "cdafc320f03f2572c40ab93a4eecb733d4016d07",
"type": "github"
},
"original": {
"owner": "lewis6991",
"repo": "gitsigns.nvim",
"type": "github"
}
},
"nvim_plugin-lnc3l0t/glow.nvim": {
"flake": false,
"locked": {
"lastModified": 1693233815,
"narHash": "sha256-vdlwkIK2EkFviJmSiOqPWvc15xqJ9F2gHCC4ObJ5Qjk=",
"owner": "lnc3l0t",
"repo": "glow.nvim",
"rev": "5b38fb7b6e806cac62707a4aba8c10c5f14d5bb5",
"type": "github"
},
"original": {
"owner": "lnc3l0t",
"repo": "glow.nvim",
"type": "github"
}
},
"nvim_plugin-lukas-reineke/indent-blankline.nvim": {
"flake": false,
"locked": {
"lastModified": 1742224677,
"narHash": "sha256-0q/V+b4UrDRnaC/eRWOi9HU9a61vQSAM9/C8ZQyKt+Y=",
"owner": "lukas-reineke",
"repo": "indent-blankline.nvim",
"rev": "005b56001b2cb30bfa61b7986bc50657816ba4ba",
"type": "github"
},
"original": {
"owner": "lukas-reineke",
"repo": "indent-blankline.nvim",
"type": "github"
}
},
"nvim_plugin-m4xshen/hardtime.nvim": {
"flake": false,
"locked": {
"lastModified": 1757738091,
"narHash": "sha256-Jy9ARUHU1ySpSxxoS3hLRjxp5Lqt7juWN5Jnbdo0rg0=",
"owner": "m4xshen",
"repo": "hardtime.nvim",
"rev": "b4e431934af1fe224a3a801f632c008278cb7628",
"type": "github"
},
"original": {
"owner": "m4xshen",
"repo": "hardtime.nvim",
"type": "github"
}
},
"nvim_plugin-mbbill/undotree": {
"flake": false,
"locked": {
"lastModified": 1759186837,
"narHash": "sha256-EWOH08KAWyoT9m45/B1d5aKQQJtd3k4orJbagVsxe08=",
"owner": "mbbill",
"repo": "undotree",
"rev": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f",
"type": "github"
},
"original": {
"owner": "mbbill",
"repo": "undotree",
"type": "github"
}
},
"nvim_plugin-mfussenegger/nvim-lint": {
"flake": false,
"locked": {
"lastModified": 1763729870,
"narHash": "sha256-9fIZPUZhnQEHJtvboCs+A2QXo4UMTFejuHNagDkfkRk=",
"owner": "mfussenegger",
"repo": "nvim-lint",
"rev": "d1118791070d090777398792a73032a0ca5c79ff",
"type": "github"
},
"original": {
"owner": "mfussenegger",
"repo": "nvim-lint",
"type": "github"
}
},
"nvim_plugin-mrcjkb/rustaceanvim": {
"flake": false,
"locked": {
"lastModified": 1763539887,
"narHash": "sha256-aMyjQEEY6MlTBMMxjR6NxNhdbWmvRhOcfpgE1w712nE=",
"owner": "mrcjkb",
"repo": "rustaceanvim",
"rev": "6b7e0e18ad8fa0598bc038aef7bb6bba288adbad",
"type": "github"
},
"original": {
"owner": "mrcjkb",
"repo": "rustaceanvim",
"type": "github"
}
},
"nvim_plugin-neovim/nvim-lspconfig": {
"flake": false,
"locked": {
"lastModified": 1763880753,
"narHash": "sha256-huuWVUKo6CmxjXYRnGv8tUs+7bo85gNyL8vVnreiTAU=",
"owner": "neovim",
"repo": "nvim-lspconfig",
"rev": "30a2b191bccf541ce1797946324c9329e90ec448",
"type": "github"
},
"original": {
"owner": "neovim",
"repo": "nvim-lspconfig",
"type": "github"
}
},
"nvim_plugin-numToStr/Comment.nvim": {
"flake": false,
"locked": {
"lastModified": 1717957420,
"narHash": "sha256-h0kPue5Eqd5aeu4VoLH45pF0DmWWo1d8SnLICSQ63zc=",
"owner": "numToStr",
"repo": "Comment.nvim",
"rev": "e30b7f2008e52442154b66f7c519bfd2f1e32acb",
"type": "github"
},
"original": {
"owner": "numToStr",
"repo": "Comment.nvim",
"type": "github"
}
},
"nvim_plugin-nvim-lua/plenary.nvim": {
"flake": false,
"locked": {
"lastModified": 1753570668,
"narHash": "sha256-9Un7ekhBxcnmFE1xjCCFTZ7eqIbmXvQexpnhduAg4M0=",
"owner": "nvim-lua",
"repo": "plenary.nvim",
"rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509",
"type": "github"
},
"original": {
"owner": "nvim-lua",
"repo": "plenary.nvim",
"type": "github"
}
},
"nvim_plugin-nvim-lualine/lualine.nvim": {
"flake": false,
"locked": {
"lastModified": 1763865090,
"narHash": "sha256-OpLZH+sL5cj2rcP5/T+jDOnuxd1QWLHCt2RzloffZOA=",
"owner": "nvim-lualine",
"repo": "lualine.nvim",
"rev": "47f91c416daef12db467145e16bed5bbfe00add8",
"type": "github"
},
"original": {
"owner": "nvim-lualine",
"repo": "lualine.nvim",
"type": "github"
}
},
"nvim_plugin-nvim-telescope/telescope-file-browser.nvim": {
"flake": false,
"locked": {
"lastModified": 1754424906,
"narHash": "sha256-FlJ7w5Ywwq03E0oYdnFJFb+MMUMQMa+5QhDMy2O9tGQ=",
"owner": "nvim-telescope",
"repo": "telescope-file-browser.nvim",
"rev": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e",
"type": "github"
},
"original": {
"owner": "nvim-telescope",
"repo": "telescope-file-browser.nvim",
"type": "github"
}
},
"nvim_plugin-nvim-telescope/telescope-fzf-native.nvim": {
"flake": false,
"locked": {
"lastModified": 1762521376,
"narHash": "sha256-ChEM4jJonAE4qXd/dgTu2mdlpNBj5rEdpA8TgR38oRM=",
"owner": "nvim-telescope",
"repo": "telescope-fzf-native.nvim",
"rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c",
"type": "github"
},
"original": {
"owner": "nvim-telescope",
"repo": "telescope-fzf-native.nvim",
"type": "github"
}
},
"nvim_plugin-nvim-telescope/telescope-ui-select.nvim": {
"flake": false,
"locked": {
"lastModified": 1701723223,
"narHash": "sha256-YRhNmmG4gx9Ht8JwjQfbTjJyTHEuZmtP6lqnhOsk8bE=",
"owner": "nvim-telescope",
"repo": "telescope-ui-select.nvim",
"rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2",
"type": "github"
},
"original": {
"owner": "nvim-telescope",
"repo": "telescope-ui-select.nvim",
"type": "github"
}
},
"nvim_plugin-nvim-telescope/telescope.nvim": {
"flake": false,
"locked": {
"lastModified": 1763414201,
"narHash": "sha256-6hrylUCc6KlcbnMgcJNJhbX2Cgu0YHKoMPOqpaKRljE=",
"owner": "nvim-telescope",
"repo": "telescope.nvim",
"rev": "83a3a713d6b2d2a408491a1b959e55a7fa8678e8",
"type": "github"
},
"original": {
"owner": "nvim-telescope",
"repo": "telescope.nvim",
"type": "github"
}
},
"nvim_plugin-nvim-tree/nvim-tree.lua": {
"flake": false,
"locked": {
"lastModified": 1763712665,
"narHash": "sha256-YwaWMPQ3IC+z/utnkZ1Tfs5tZFex9Gdf/vS9sUaMDCA=",
"owner": "nvim-tree",
"repo": "nvim-tree.lua",
"rev": "3fb91e18a727ecc0385637895ec397dea90be42a",
"type": "github"
},
"original": {
"owner": "nvim-tree",
"repo": "nvim-tree.lua",
"type": "github"
}
},
"nvim_plugin-nvim-tree/nvim-web-devicons": {
"flake": false,
"locked": {
"lastModified": 1761440007,
"narHash": "sha256-klBjUtj0AvarN5a6O8Hh2t5BuOTe/m3ps2cHnlxVJvE=",
"owner": "nvim-tree",
"repo": "nvim-web-devicons",
"rev": "8dcb311b0c92d460fac00eac706abd43d94d68af",
"type": "github"
},
"original": {
"owner": "nvim-tree",
"repo": "nvim-web-devicons",
"type": "github"
}
},
"nvim_plugin-nvim-treesitter/nvim-treesitter-context": {
"flake": false,
"locked": {
"lastModified": 1762769683,
"narHash": "sha256-ICwAUXKngSPsJ6VV+84KUPqtAwlGPrm4FIf9ioisiz8=",
"owner": "nvim-treesitter",
"repo": "nvim-treesitter-context",
"rev": "660861b1849256398f70450afdf93908d28dc945",
"type": "github"
},
"original": {
"owner": "nvim-treesitter",
"repo": "nvim-treesitter-context",
"type": "github"
}
},
"nvim_plugin-rafamadriz/friendly-snippets": {
"flake": false,
"locked": {
"lastModified": 1745949052,
"narHash": "sha256-FzApcTbWfFkBD9WsYMhaCyn6ky8UmpUC2io/co/eByM=",
"owner": "rafamadriz",
"repo": "friendly-snippets",
"rev": "572f5660cf05f8cd8834e096d7b4c921ba18e175",
"type": "github"
},
"original": {
"owner": "rafamadriz",
"repo": "friendly-snippets",
"type": "github"
}
},
"nvim_plugin-rcarriga/nvim-notify": {
"flake": false,
"locked": {
"lastModified": 1757190131,
"narHash": "sha256-h7STMjY+CBTqBkIDJXgtJz4WhNeQ02ES2Jesi3jZXeM=",
"owner": "rcarriga",
"repo": "nvim-notify",
"rev": "8701bece920b38ea289b457f902e2ad184131a5d",
"type": "github"
},
"original": {
"owner": "rcarriga",
"repo": "nvim-notify",
"type": "github"
}
},
"nvim_plugin-rmagatti/auto-session": {
"flake": false,
"locked": {
"lastModified": 1761853983,
"narHash": "sha256-9/SfXUAZIiPAS5ojvJCxDCxmuLoL/kIrAsNWAoLWFq4=",
"owner": "rmagatti",
"repo": "auto-session",
"rev": "292492ab7af4bd8b9e37e28508bc8ce995722fd5",
"type": "github"
},
"original": {
"owner": "rmagatti",
"repo": "auto-session",
"type": "github"
}
},
"nvim_plugin-ron-rs/ron.vim": {
"flake": false,
"locked": {
"lastModified": 1660904719,
"narHash": "sha256-8/xJmymtVGVz2avzlamgK1cNflZ3NRL+B3c7xxbI964=",
"owner": "ron-rs",
"repo": "ron.vim",
"rev": "f749e543975a82e8dd9a6e7df9600a1c098ae800",
"type": "github"
},
"original": {
"owner": "ron-rs",
"repo": "ron.vim",
"type": "github"
}
},
"nvim_plugin-saadparwaiz1/cmp_luasnip": {
"flake": false,
"locked": {
"lastModified": 1730707109,
"narHash": "sha256-86lKQPPyqFz8jzuLajjHMKHrYnwW6+QOcPyQEx6B+gw=",
"owner": "saadparwaiz1",
"repo": "cmp_luasnip",
"rev": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90",
"type": "github"
},
"original": {
"owner": "saadparwaiz1",
"repo": "cmp_luasnip",
"type": "github"
}
},
"nvim_plugin-sindrets/diffview.nvim": {
"flake": false,
"locked": {
"lastModified": 1718279802,
"narHash": "sha256-SX+ybIzL/w6uyCy4iZKnWnzTFwqB1oXSgyYVAdpdKi8=",
"owner": "sindrets",
"repo": "diffview.nvim",
"rev": "4516612fe98ff56ae0415a259ff6361a89419b0a",
"type": "github"
},
"original": {
"owner": "sindrets",
"repo": "diffview.nvim",
"type": "github"
}
},
"nvim_plugin-stevearc/conform.nvim": {
"flake": false,
"locked": {
"lastModified": 1763939276,
"narHash": "sha256-2TLMJdbSbMbdGn6zhZwNSUZnxVGu+Y0ZYhTjinTc7Hs=",
"owner": "stevearc",
"repo": "conform.nvim",
"rev": "6208aefd675939cc7c8f1a57176135974dad269f",
"type": "github"
},
"original": {
"owner": "stevearc",
"repo": "conform.nvim",
"type": "github"
}
},
"nvim_plugin-stevearc/dressing.nvim": {
"flake": false,
"locked": {
"lastModified": 1739381641,
"narHash": "sha256-dBz+/gZA6O6fJy/GSgM6ZHGAR3MTGt/W1olzzTYRlgM=",
"owner": "stevearc",
"repo": "dressing.nvim",
"rev": "2d7c2db2507fa3c4956142ee607431ddb2828639",
"type": "github"
},
"original": {
"owner": "stevearc",
"repo": "dressing.nvim",
"type": "github"
}
},
"nvim_plugin-tpope/vim-sleuth": {
"flake": false,
"locked": {
"lastModified": 1726718493,
"narHash": "sha256-2Cr3h3uJvUL3CSoJs3aBFrkBeOBURSQItgQ4ep9sHXM=",
"owner": "tpope",
"repo": "vim-sleuth",
"rev": "be69bff86754b1aa5adcbb527d7fcd1635a84080",
"type": "github"
},
"original": {
"owner": "tpope",
"repo": "vim-sleuth",
"type": "github"
}
},
"nvim_plugin-tpope/vim-surround": {
"flake": false,
"locked": {
"lastModified": 1666730476,
"narHash": "sha256-DZE5tkmnT+lAvx/RQHaDEgEJXRKsy56KJY919xiH1lE=",
"owner": "tpope",
"repo": "vim-surround",
"rev": "3d188ed2113431cf8dac77be61b842acb64433d9",
"type": "github"
},
"original": {
"owner": "tpope",
"repo": "vim-surround",
"type": "github"
}
},
"nvim_plugin-uga-rosa/ccc.nvim": {
"flake": false,
"locked": {
"lastModified": 1746537659,
"narHash": "sha256-3TZ8VmvdgQ9n63m78C3r4OIUkVQHTHBvC24ixBdhTig=",
"owner": "uga-rosa",
"repo": "ccc.nvim",
"rev": "9d1a256e006decc574789dfc7d628ca11644d4c2",
"type": "github"
},
"original": {
"owner": "uga-rosa",
"repo": "ccc.nvim",
"type": "github"
}
},
"nvim_plugin-windwp/nvim-ts-autotag": {
"flake": false,
"locked": {
"lastModified": 1757545454,
"narHash": "sha256-nT2W5gKFEfzP7MztLjm7yqwam3ADk0svcMdLg2nmI/4=",
"owner": "windwp",
"repo": "nvim-ts-autotag",
"rev": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc",
"type": "github"
},
"original": {
"owner": "windwp",
"repo": "nvim-ts-autotag",
"type": "github"
}
},
"nvim_plugin-zbirenbaum/copilot-cmp": {
"flake": false,
"locked": {
"lastModified": 1733947099,
"narHash": "sha256-erRL8bY/zuwuCZfttw+avTrFV7pjv2H6v73NzY2bymM=",
"owner": "zbirenbaum",
"repo": "copilot-cmp",
"rev": "15fc12af3d0109fa76b60b5cffa1373697e261d1",
"type": "github"
},
"original": {
"owner": "zbirenbaum",
"repo": "copilot-cmp",
"type": "github"
}
},
"nvim_plugin-zbirenbaum/copilot.lua": {
"flake": false,
"locked": {
"lastModified": 1763512274,
"narHash": "sha256-NMIXOb/20aEmXvPgSDPzVuRIV+OUnJyfXVaVEuVAaTM=",
"owner": "zbirenbaum",
"repo": "copilot.lua",
"rev": "4383e05a47493d7ff77b058c0548129eb38ec7fb",
"type": "github"
},
"original": {
"owner": "zbirenbaum",
"repo": "copilot.lua",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"ros_neovim": "ros_neovim",
"stable": "stable", "stable": "stable",
"unstable": "unstable" "unstable": "unstable"
} }
}, },
"ros_neovim": {
"inputs": {
"nixpkgs": "nixpkgs",
"nvim_plugin-Almo7aya/openingh.nvim": "nvim_plugin-Almo7aya/openingh.nvim",
"nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim",
"nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring",
"nvim_plugin-L3MON4D3/LuaSnip": "nvim_plugin-L3MON4D3/LuaSnip",
"nvim_plugin-MeanderingProgrammer/render-markdown.nvim": "nvim_plugin-MeanderingProgrammer/render-markdown.nvim",
"nvim_plugin-MunifTanjim/nui.nvim": "nvim_plugin-MunifTanjim/nui.nvim",
"nvim_plugin-RRethy/vim-illuminate": "nvim_plugin-RRethy/vim-illuminate",
"nvim_plugin-Saecki/crates.nvim": "nvim_plugin-Saecki/crates.nvim",
"nvim_plugin-aznhe21/actions-preview.nvim": "nvim_plugin-aznhe21/actions-preview.nvim",
"nvim_plugin-b0o/schemastore.nvim": "nvim_plugin-b0o/schemastore.nvim",
"nvim_plugin-catppuccin/nvim": "nvim_plugin-catppuccin/nvim",
"nvim_plugin-chrisgrieser/nvim-early-retirement": "nvim_plugin-chrisgrieser/nvim-early-retirement",
"nvim_plugin-declancm/cinnamon.nvim": "nvim_plugin-declancm/cinnamon.nvim",
"nvim_plugin-folke/lazy.nvim": "nvim_plugin-folke/lazy.nvim",
"nvim_plugin-folke/neodev.nvim": "nvim_plugin-folke/neodev.nvim",
"nvim_plugin-folke/which-key.nvim": "nvim_plugin-folke/which-key.nvim",
"nvim_plugin-hrsh7th/cmp-buffer": "nvim_plugin-hrsh7th/cmp-buffer",
"nvim_plugin-hrsh7th/cmp-nvim-lsp": "nvim_plugin-hrsh7th/cmp-nvim-lsp",
"nvim_plugin-hrsh7th/cmp-path": "nvim_plugin-hrsh7th/cmp-path",
"nvim_plugin-hrsh7th/nvim-cmp": "nvim_plugin-hrsh7th/nvim-cmp",
"nvim_plugin-j-hui/fidget.nvim": "nvim_plugin-j-hui/fidget.nvim",
"nvim_plugin-johmsalas/text-case.nvim": "nvim_plugin-johmsalas/text-case.nvim",
"nvim_plugin-lewis6991/gitsigns.nvim": "nvim_plugin-lewis6991/gitsigns.nvim",
"nvim_plugin-lnc3l0t/glow.nvim": "nvim_plugin-lnc3l0t/glow.nvim",
"nvim_plugin-lukas-reineke/indent-blankline.nvim": "nvim_plugin-lukas-reineke/indent-blankline.nvim",
"nvim_plugin-m4xshen/hardtime.nvim": "nvim_plugin-m4xshen/hardtime.nvim",
"nvim_plugin-mbbill/undotree": "nvim_plugin-mbbill/undotree",
"nvim_plugin-mfussenegger/nvim-lint": "nvim_plugin-mfussenegger/nvim-lint",
"nvim_plugin-mrcjkb/rustaceanvim": "nvim_plugin-mrcjkb/rustaceanvim",
"nvim_plugin-neovim/nvim-lspconfig": "nvim_plugin-neovim/nvim-lspconfig",
"nvim_plugin-numToStr/Comment.nvim": "nvim_plugin-numToStr/Comment.nvim",
"nvim_plugin-nvim-lua/plenary.nvim": "nvim_plugin-nvim-lua/plenary.nvim",
"nvim_plugin-nvim-lualine/lualine.nvim": "nvim_plugin-nvim-lualine/lualine.nvim",
"nvim_plugin-nvim-telescope/telescope-file-browser.nvim": "nvim_plugin-nvim-telescope/telescope-file-browser.nvim",
"nvim_plugin-nvim-telescope/telescope-fzf-native.nvim": "nvim_plugin-nvim-telescope/telescope-fzf-native.nvim",
"nvim_plugin-nvim-telescope/telescope-ui-select.nvim": "nvim_plugin-nvim-telescope/telescope-ui-select.nvim",
"nvim_plugin-nvim-telescope/telescope.nvim": "nvim_plugin-nvim-telescope/telescope.nvim",
"nvim_plugin-nvim-tree/nvim-tree.lua": "nvim_plugin-nvim-tree/nvim-tree.lua",
"nvim_plugin-nvim-tree/nvim-web-devicons": "nvim_plugin-nvim-tree/nvim-web-devicons",
"nvim_plugin-nvim-treesitter/nvim-treesitter-context": "nvim_plugin-nvim-treesitter/nvim-treesitter-context",
"nvim_plugin-rafamadriz/friendly-snippets": "nvim_plugin-rafamadriz/friendly-snippets",
"nvim_plugin-rcarriga/nvim-notify": "nvim_plugin-rcarriga/nvim-notify",
"nvim_plugin-rmagatti/auto-session": "nvim_plugin-rmagatti/auto-session",
"nvim_plugin-ron-rs/ron.vim": "nvim_plugin-ron-rs/ron.vim",
"nvim_plugin-saadparwaiz1/cmp_luasnip": "nvim_plugin-saadparwaiz1/cmp_luasnip",
"nvim_plugin-sindrets/diffview.nvim": "nvim_plugin-sindrets/diffview.nvim",
"nvim_plugin-stevearc/conform.nvim": "nvim_plugin-stevearc/conform.nvim",
"nvim_plugin-stevearc/dressing.nvim": "nvim_plugin-stevearc/dressing.nvim",
"nvim_plugin-tpope/vim-sleuth": "nvim_plugin-tpope/vim-sleuth",
"nvim_plugin-tpope/vim-surround": "nvim_plugin-tpope/vim-surround",
"nvim_plugin-uga-rosa/ccc.nvim": "nvim_plugin-uga-rosa/ccc.nvim",
"nvim_plugin-windwp/nvim-ts-autotag": "nvim_plugin-windwp/nvim-ts-autotag",
"nvim_plugin-zbirenbaum/copilot-cmp": "nvim_plugin-zbirenbaum/copilot-cmp",
"nvim_plugin-zbirenbaum/copilot.lua": "nvim_plugin-zbirenbaum/copilot.lua",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1764043494,
"narHash": "sha256-5P84KpmpWfA4ZJ6EFuzBYtI1NEZivzSff7AOnkbTCKc=",
"ref": "refs/heads/master",
"rev": "4bf56c30b27f2be45cfd0f5fd461c74d44aea291",
"revCount": 322,
"type": "git",
"url": "https://git.joshuabell.xyz/ringofstorms/nvim"
},
"original": {
"type": "git",
"url": "https://git.joshuabell.xyz/ringofstorms/nvim"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"ros_neovim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1764038373,
"narHash": "sha256-M6w2wNBRelcavoDAyFL2iO4NeWknD40ASkH1S3C0YGM=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "ab3536fe850211a96673c6ffb2cb88aab8071cc9",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"stable": { "stable": {
"locked": { "locked": {
"lastModified": 1763622513, "lastModified": 1763622513,

View file

@ -4,10 +4,16 @@
inputs = { inputs = {
stable.url = "github:nixos/nixpkgs/nixos-25.05"; stable.url = "github:nixos/nixpkgs/nixos-25.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; unstable.url = "github:nixos/nixpkgs/nixos-unstable";
ros_neovim.url = "git+https://git.joshuabell.xyz/ringofstorms/nvim";
}; };
outputs = outputs =
{ stable, unstable, ... }: {
stable,
unstable,
ros_neovim,
...
}:
let let
lib = stable.lib; lib = stable.lib;
systems = lib.systems.flakeExposed; systems = lib.systems.flakeExposed;
@ -23,6 +29,7 @@
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
ros_neovim.nixosModules.default
( (
{ pkgs, modulesPath, ... }: { pkgs, modulesPath, ... }:
{ {
@ -40,6 +47,9 @@
fastfetch fastfetch
fzf fzf
]; ];
environment.shellAliases = {
n = "nvim";
};
services.openssh = { services.openssh = {
enable = true; enable = true;
@ -49,6 +59,9 @@
}; };
}; };
programs.zsh.enable = true;
environment.pathsToLink = [ "/share/zsh" ];
users.defaultUserShell = pkgs.zsh;
users.users.nixos = { users.users.nixos = {
password = "password"; password = "password";
initialHashedPassword = lib.mkForce null; initialHashedPassword = lib.mkForce null;

View file

@ -0,0 +1,80 @@
{
pkgs,
config,
lib,
...
}:
{
options.onboardOpts = {
hostName = lib.mkOption {
type = lib.types.str;
description = "Name of this machine/host";
};
primaryUser = lib.mkOption {
type = lib.types.str;
description = "Name of the user for this machine";
default = "luser";
};
};
config = {
networking.hostName = config.onboardOpts.hostName;
networking.networkmanager.enable = true;
services.openssh.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ];
# Nix options
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
environment.systemPackages = with pkgs; [
vim
curl
git
sudo
fastfetch
];
# Auto timezone
time.timeZone = null;
services.automatic-timezoned.enable = true;
users.users."${config.onboardOpts.primaryUser}" = {
initialHashedPassword = "$y$j9T$b8Fva/LoKIDdG/G2oHYG3.$D49NQrr5lJQnA5Bq2Wx9wEW1mU53W5Hvudw1K984gu6";
isNormalUser = true;
extraGroups = [
"wheel"
"networkmanager"
"video"
"input"
];
};
# Ensure SSH key pair generation for non-root users
systemd.services.generate_ssh_key = {
description = "Generate SSH key pair for ${config.onboardOpts.primaryUser}";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "${config.onboardOpts.primaryUser}";
Type = "oneshot";
};
script = ''
#!/run/current-system/sw/bin/bash
if [ ! -f /home/${config.onboardOpts.primaryUser}/.ssh/id_ed25519 ]; then
if [ -v DRY_RUN ]; then
echo "DRY_RUN is set. Would generate SSH key for ${config.onboardOpts.primaryUser}."
else
echo "Generating SSH key for ${config.onboardOpts.primaryUser}."
mkdir -p /home/${config.onboardOpts.primaryUser}/.ssh
chmod 700 /home/${config.onboardOpts.primaryUser}/.ssh
/run/current-system/sw/bin/ssh-keygen -t ed25519 -f /home/${config.onboardOpts.primaryUser}/.ssh/id_ed25519 -N ""
fi
else
echo "SSH key already exists for ${config.onboardOpts.primaryUser}."
fi
'';
};
};
}