Kieran's opinionated (and probably slightly dumb) nix config
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: add install script

dunkirk.sh cadf5b33 6383cf18

verified
+334 -1
+57
INSTALL_GUIDE.md
··· 1 + # So, you want to use my dots? 2 + 3 + Hey there! This guide supplements the README with additional details about using the installation scripts. I've tried to make installation as painless as possible. (mainly because i hate typing in commands manually with no autocomplete; yeah ik im not a "true" linux nerd but whatever lol) 4 + 5 + ## The Automated Way (Recommended) 6 + 7 + ### Step 1: Get connected 8 + 9 + First, make sure you've got internet! (this is already covered in [`README.md`](/README.md) so not duplicating here) Also don't forget to double check with `ping 1.1.1.1` 10 + 11 + ### Step 2: Run the install script 12 + 13 + ```bash 14 + curl -L https://raw.githubusercontent.com/taciturnaxolotl/dots/main/nixos/install.sh -o install.sh 15 + chmod +x install.sh 16 + ./install.sh 17 + ``` 18 + 19 + This magic script will: 20 + - Make sure you're online 21 + - Enable git (required for the rest of this charade) 22 + - Partition your disks with disko 23 + - Clone my dots to the right place 24 + - Let you add your SSH key if you've got one 25 + - Install the flake 26 + - Send you off to reboot land 27 + 28 + ### Step 3: First login after reboot 29 + 30 + After the system reboots, login with user `kierank` and password `lolzthisaintsecure!` 31 + 32 + (Please change this password immediately!) 33 + 34 + ### Step 4: Run the post-install script 35 + 36 + ```bash 37 + curl -L https://raw.githubusercontent.com/taciturnaxolotl/dots/main/nixos/post-install.sh -o post-install.sh 38 + chmod +x post-install.sh 39 + ./post-install.sh 40 + ``` 41 + 42 + This script will walk you through: 43 + - Changing your password (if you haven't already) 44 + - Moving config files to your home directory 45 + - Setting up the fingerprint reader (optional) 46 + - Configuring git (optional) 47 + - Rebuilding the system with your hostname 48 + 49 + ## Available System Configurations 50 + 51 + Currently, this repo has the following system configurations: 52 + 53 + - `moonlark` - My Framework laptop setup (default config) 54 + 55 + You'll be asked which one you want during the installation. 56 + 57 + Good luck, and may the nix gods be with you! 🙏
+25
LICENSE.md
··· 1 + The MIT License (MIT) 2 + ===================== 3 + 4 + Copyright © `2025` `Kieran Klukas` 5 + 6 + Permission is hereby granted, free of charge, to any person 7 + obtaining a copy of this software and associated documentation 8 + files (the “Software”), to deal in the Software without 9 + restriction, including without limitation the rights to use, 10 + copy, modify, merge, publish, distribute, sublicense, and/or sell 11 + copies of the Software, and to permit persons to whom the 12 + Software is furnished to do so, subject to the following 13 + conditions: 14 + 15 + The above copyright notice and this permission notice shall be 16 + included in all copies or substantial portions of the Software. 17 + 18 + THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, 19 + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 + OTHER DEALINGS IN THE SOFTWARE.
+27 -1
README.md
··· 30 30 31 31 > ~~I have absolutely no idea how to install this~~ I kinda understand now? 32 32 > 33 - > ⚠️ These installation instructions are being actively worked on as I test installation on a friend's computer 33 + > These instructions have been validated by installing on my friend's machine ([`Nat2-Dev/dots`](https://github.com/Nat2-Dev/dots)) 34 + 35 + You have two options for installation: either the full guide as follows or the install script below and instructions in [INSTALL_GUIDE.md](/INSTALL_GUIDE.md) 36 + 37 + ```bash 38 + curl -L https://raw.githubusercontent.com/taciturnaxolotl/dots/main/nixos/install.sh -o install.sh 39 + chmod +x install.sh 40 + ./install.sh 41 + ``` 42 + 43 + ### The manual way 34 44 35 45 Install NixOS via the [official guide](https://nixos.org/download.html) 36 46 ··· 165 175 - [gtk with home manager](https://hoverbear.org/blog/declarative-gnome-configuration-in-nixos/) 166 176 - [setting up the proper portals](https://github.com/NixOS/nixpkgs/issues/274554) 167 177 - [tuigreet setup](https://github.com/sjcobb2022/nixos-config/blob/29077cee1fc82c5296908f0594e28276dacbe0b0/hosts/common/optional/greetd.nix) 178 + 179 + ## 📜 License 180 + 181 + The code is licensed under `MIT`! That means MIT allows for free use, modification, and distribution of the software, requiring only that the original copyright notice and disclaimer are included in copies. All artwork and images are copyright reserved but may be used with proper attribution to the authors. 182 + 183 + <p align="center"> 184 + <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" /> 185 + </p> 186 + 187 + <p align="center"> 188 + <i><code>&copy 2025-present <a href="https://github.com/taciturnaxolotl">Kieran Klukas</a></code></i> 189 + </p> 190 + 191 + <p align="center"> 192 + <a href="https://github.com/taciturnaxolotl/dots/blob/master/LICENSE.md"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a> 193 + </p>
+140
install.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + # NixOS Installation Script 4 + # This script automates the post-network setup installation process 5 + 6 + set -e # Exit on any error 7 + 8 + echo "==== NixOS Installation Automation ====" 9 + echo "This script will automate the installation process after network setup." 10 + echo "Make sure you have already set up network connectivity before running this script." 11 + 12 + # Verify network connectivity 13 + echo -n "Checking network connectivity... " 14 + if ping -c 1 1.1.1.1 &> /dev/null; then 15 + echo "Success!" 16 + else 17 + echo "Failed!" 18 + echo "Error: No internet connection detected. Please set up your network first." 19 + echo "You can use the following commands to connect to WiFi:" 20 + echo " sudo systemctl start wpa_supplicant" 21 + echo " wpa_cli" 22 + echo " > add_network 0" 23 + echo " > set_network 0 ssid \"your SSID\"" 24 + echo " > set_network 0 psk \"your password\"" 25 + echo " > enable network 0" 26 + echo " > exit" 27 + exit 1 28 + fi 29 + 30 + # Get sudo privileges and maintain them 31 + echo "Acquiring root permissions..." 32 + sudo -v 33 + # Keep sudo privileges active 34 + while true; do sudo -v; sleep 60; done & 35 + KEEP_SUDO_PID=$! 36 + 37 + # Function to clean up the background sudo process on exit 38 + cleanup() { 39 + kill $KEEP_SUDO_PID 2>/dev/null 40 + } 41 + trap cleanup EXIT 42 + 43 + # Check if git is already enabled in the configuration 44 + echo "Checking git configuration..." 45 + if grep -q "programs.git.enable = true" /etc/nixos/configuration.nix; then 46 + echo "Git is already enabled in configuration.nix" 47 + else 48 + echo "Enabling git..." 49 + sudo sed -i 's/^{$/{\n programs.git.enable = true;/' /etc/nixos/configuration.nix 50 + sudo nixos-rebuild switch 51 + fi 52 + 53 + # Download and run the disk configuration 54 + echo "Downloading and running disk configuration..." 55 + curl -L https://github.com/taciturnaxolotl/dots/raw/main/moonlark/disk-config.nix -o /tmp/disk-config.nix 56 + sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode destroy,format,mount /tmp/disk-config.nix 57 + 58 + # Generate NixOS configuration 59 + echo "Generating NixOS configuration..." 60 + sudo nixos-generate-config --root /mnt 61 + cd /mnt/etc/nixos 62 + 63 + # Check if repository already exists 64 + echo "Setting up configuration..." 65 + if [ -d ".git" ]; then 66 + echo "Configuration already exists, pulling latest changes..." 67 + sudo git pull 68 + else 69 + # Clone the repository to the NixOS configuration directory 70 + echo "Cloning nixos repository..." 71 + sudo rm -f * 72 + sudo git clone https://github.com/taciturnaxolotl/dots.git . 73 + fi 74 + 75 + # Prompt user for SSH key setup 76 + echo "" 77 + echo "SSH Key Setup" 78 + read -p "Do you want to add an SSH private key? (y/n): " add_ssh_key 79 + if [[ "$add_ssh_key" =~ ^[Yy]$ ]]; then 80 + echo "How would you like to add your SSH key?" 81 + echo "1) From a local file" 82 + echo "2) From a URL" 83 + read -p "Enter your choice (1/2): " ssh_key_method 84 + 85 + sudo mkdir -p /mnt/etc/ssh/ 86 + 87 + if [[ "$ssh_key_method" == "1" ]]; then 88 + echo "Please enter the path to your SSH private key:" 89 + read ssh_key_path 90 + 91 + if [ -f "$ssh_key_path" ]; then 92 + sudo cp "$ssh_key_path" /mnt/etc/ssh/id_rsa 93 + sudo chmod 600 /mnt/etc/ssh/id_rsa 94 + echo "SSH key added from local file!" 95 + else 96 + echo "Warning: SSH key file not found. Proceeding without SSH key." 97 + fi 98 + elif [[ "$ssh_key_method" == "2" ]]; then 99 + echo "Please enter the URL to download your SSH private key:" 100 + read ssh_key_url 101 + 102 + echo "Downloading SSH key from URL..." 103 + if curl -s "$ssh_key_url" -o /tmp/downloaded_ssh_key; then 104 + sudo mv /tmp/downloaded_ssh_key /mnt/etc/ssh/id_rsa 105 + sudo chmod 600 /mnt/etc/ssh/id_rsa 106 + echo "SSH key successfully downloaded and added!" 107 + else 108 + echo "Warning: Failed to download SSH key from URL. Proceeding without SSH key." 109 + fi 110 + else 111 + echo "Invalid choice. Proceeding without SSH key." 112 + fi 113 + else 114 + echo "Proceeding without SSH key." 115 + fi 116 + 117 + # Prompt for hostname configuration 118 + echo "" 119 + echo "Hostname Configuration" 120 + echo "Available configurations in this repo:" 121 + echo "1) moonlark (default)" 122 + read -p "Which configuration would you like to use? (Press Enter for moonlark): " hostname_choice 123 + hostname=${hostname_choice:-moonlark} 124 + 125 + # Install the flake 126 + echo "Installing the flake for configuration: $hostname" 127 + sudo nixos-install --flake .#${hostname} --no-root-passwd 128 + 129 + echo "Installation complete! The system will now reboot." 130 + echo "" 131 + echo "After reboot, you'll need to complete these post-installation tasks:" 132 + echo "1. Change your password" 133 + echo "2. Move config to local directory: mkdir ~/etc; sudo mv /etc/nixos ~/etc" 134 + echo "3. Link to /etc/nixos: sudo ln -s ~/etc/nixos /etc" 135 + echo "4. Change permissions: sudo chown -R \$(id -un):users ~/etc/nixos" 136 + echo "5. Setup fingerprint reader (optional): sudo fprintd-enroll -f right-index-finger \$(whoami)" 137 + 138 + read -p "Press Enter to unmount and reboot..." 139 + sudo umount -R /mnt 140 + sudo reboot
+85
post-install.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + # NixOS Post-Installation Script 4 + # This script automates the post-installation tasks after the first reboot 5 + 6 + set -e # Exit on any error 7 + 8 + echo "==== NixOS Post-Installation Setup ====" 9 + echo "This script will automate the post-installation tasks." 10 + 11 + # Function to print current step 12 + print_step() { 13 + echo -e "\n\033[1;34m==== $1 ====\033[0m" 14 + } 15 + 16 + # Change password if needed 17 + print_step "Password Management" 18 + read -p "Do you want to change your password? (y/n): " change_password 19 + if [[ "$change_password" =~ ^[Yy]$ ]]; then 20 + passwd 21 + echo "Password changed successfully!" 22 + fi 23 + 24 + # Move config to local directory and fix permissions 25 + print_step "Setting up configuration files" 26 + if [ -L "/etc/nixos" ]; then 27 + echo "Configuration is already properly set up." 28 + else 29 + echo "Moving configuration to home directory..." 30 + mkdir -p ~/etc 31 + sudo mv /etc/nixos ~/etc/ 32 + sudo ln -s ~/etc/nixos /etc/ 33 + echo "Fixing permissions..." 34 + sudo chown -R $(id -un):users ~/etc/nixos 35 + sudo chown -R $(id -un) ~/etc/nixos/.* 36 + echo "Configuration files moved and linked successfully!" 37 + fi 38 + 39 + # Setup fingerprint reader (optional) 40 + print_step "Fingerprint Reader Setup" 41 + read -p "Do you want to set up the fingerprint reader? (y/n): " setup_fingerprint 42 + if [[ "$setup_fingerprint" =~ ^[Yy]$ ]]; then 43 + echo "Setting up fingerprint reader..." 44 + echo "You may need to swipe your finger across the fingerprint sensor instead of simply laying it there." 45 + sudo fprintd-enroll -f right-index-finger $(whoami) 46 + echo "Verifying fingerprint..." 47 + sudo fprintd-verify $(whoami) 48 + else 49 + echo "Skipping fingerprint reader setup." 50 + fi 51 + 52 + # Git configuration 53 + print_step "Git Configuration" 54 + read -p "Do you want to configure Git? (y/n): " setup_git 55 + if [[ "$setup_git" =~ ^[Yy]$ ]]; then 56 + read -p "Enter your Git taciturnaxolotl: " git_user 57 + read -p "Enter your Git email: " git_email 58 + 59 + git config --global user.name "$git_user" 60 + git config --global user.email "$git_email" 61 + 62 + echo "Git configuration complete!" 63 + fi 64 + 65 + # Rebuild system 66 + print_step "Rebuilding system" 67 + read -p "Do you want to rebuild the system to apply all changes? (y/n): " rebuild_system 68 + if [[ "$rebuild_system" =~ ^[Yy]$ ]]; then 69 + echo "Rebuilding system..." 70 + cd ~/etc/nixos 71 + 72 + # Get the hostname to use for the rebuild 73 + hostname=$(hostname) 74 + echo "Current hostname: $hostname" 75 + 76 + sudo nixos-rebuild switch --flake .#${hostname} 77 + echo "System rebuilt successfully!" 78 + else 79 + echo "Skipping system rebuild." 80 + fi 81 + 82 + print_step "Post-installation complete!" 83 + echo "Your NixOS setup is now complete! You may need to restart some applications or services for all changes to take effect." 84 + echo "To rebuild your system in the future, run: cd ~/etc/nixos && sudo nixos-rebuild switch --flake .#$(hostname)" 85 + echo "Enjoy your new NixOS installation!"