From 69f3a48313a19062a6c8f5c90540a98fbc3a8302 Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Fri, 26 Apr 2024 00:14:04 -0500 Subject: [PATCH] small updates --- hosts/_common/configuration.nix | 1 + readme.md | 78 ++++++---------------------- users/josh/home_manager/de/gnome.nix | 2 +- 3 files changed, 17 insertions(+), 64 deletions(-) diff --git a/hosts/_common/configuration.nix b/hosts/_common/configuration.nix index ae1365d..91f0380 100644 --- a/hosts/_common/configuration.nix +++ b/hosts/_common/configuration.nix @@ -71,6 +71,7 @@ in nn = "nvim --headless '+SessionDelete' +qa > /dev/null 2>&1 && nvim"; bat = "bat --theme Coldark-Dark"; cat = "bat --pager=never -p"; + # TODO this may not be needed now that I am using `nh` clean mode (see /hosts/_common/configuration.nix#programs.nh) nix-boot-clean = "find '/boot/loader/entries' -type f ! -name 'windows.conf' | head -n -4 | xargs -I {} rm {}; nix store gc; nixos-rebuild boot; echo; df"; # general unix diff --git a/readme.md b/readme.md index 6a1c95a..de48e03 100644 --- a/readme.md +++ b/readme.md @@ -15,79 +15,33 @@ export USERNAME=desired_username_for_admin_on_this_machine (josh) - `cat /etc/ssh/ssh_host_ed25519_key.pub ~/.ssh/id_ed25519.pub` - On an already onboarded computer copy these and add them to secrets/secrets.nix file - Rekey secrets: `nix run github:yaxitech/ragenix -- --rules ~/.config/nixos-config/secrets/secrets.nix -r` + - Maybe copy hardware/configs over and setup, otehrwise do it on the client machine - git clone nixos-config `git clone https://github.com/RingOfStorms/dotfiles.git ~/.config/nixos-config` +- Setup config as needed + - top level flake.nix additions + - add hosts dir and files needed - `sudo nixos-rebuild switch --flake ~/.config/nixos-config` - Update remote, ssh should work now: `cd ~/.config/nixos-config && git remote remove origin && git remote add origin "git@github.com:RingOfStorms/dotfiles.git" && git pull origin master` -- TODO ONBOARD NEW MACHINE CONFIGS, secrets, etc - - use hostname to make new folders in the repo, copy hardware config, and create config from template. Update flake.nix with top level info needed for this system with ARCH detected. - - Copy public keys into secrets.nix file - - `cat /etc/ssh/ssh_host_ed25519_key.pub ~/.ssh/id_ed25519.pub` - - `git commit -a --author="Bot " --email="bot@joshuabell.dev" -m "secrets update"` - - - rekey system with another onboarded device... (make this offlinable?), push there, pull here -- `sudo nixos-rebuild switch --flake ~/.config/nixos-config` -- reboot? done - - - ## Darwin - TODO + +### Notes + +Dual booting windows? +- If there is a new boot partition being used than the old windows one, copy over the /boot/EFI/Microsoft folder into the new boot partition, same place +- If the above auto probing for windows does not work, you can also manually add in a windows.conf in the loader entries: /boot/loader/entries/windows.conf: +``` +title Windows 11 +efi /EFI/Microsoft/Boot/bootmgfw.efi +``` + ### ### -### -### -### - - -# First Install on new Machine - -- First follow nixos installation guide: https://nixos.wiki/wiki/NixOS_Installation_Guide - - Follow up to generate config command -- in hardware-configuration.nix - - change to use by-labels made in nixos installation guide (optional but nice for updating device in the future) -- in configuration.nix - - set networking.hostname to HOSTNAME - - enable networkmanager - - uncomment systemPackages and add: git curl - - add `nix.settings.experimental-features = [ "nix-command" "flakes" ];` -- Install nixos: `cd /mnt` `sudo nixos-install` -- `passwd` to change root password (if not already prompted to do so) -- `reboot` - --- TODO come up with a way to pregen keys so onboarding is less stupid with secrets? - -- `cp -r /etc/nixos ~/nixos_bak` Backup configuration -- Checkout this repo into /etc/nixos: `rm -rf /etc/nixos` `git clone https://github.com/ringofstorms/dotfiles /etc/nixos` -- Copy the backup into the new /etc/nixos/hosts/HOSTNAME dir `mkdir /etc/nixos/hosts/HOSTNAME && cp -r ~/nixos_bak/* /etx/nixos/hosts/HOSTNAME` -- copy the existing configuration/other configuration nix of an existing system and edit it to desires state. [[ TODO make this step cleaner/easier... ]] -- switch into flake mode `nixos-rebuild switch --flake /etc/nixos[#HOSTNAME]` and switch to new system -- Add this host to the top level `flake.nix` myHosts section -- copy system ssh public key and create a key for user and copy those into the nixos secrets.nix file - - `cat /etc/ssh/ssh_host_ed25519_key.pub` - - `cat ~/.ssh/id_ed25519.pub` -- Push changes to remote using temp user password -- rekey secrets with any other onboarded system - - TODO -- copy over this host's ssh public key ( /etc/shh/*ed25519* ) into the ./secrets/secrets.nix file - push those up, using another computer re-key all the secrets, push up again - - pull new secrets down with new added keys and rebuild - clone neovim setup... -# Later updates - -- `nix flake update /etc/nixos` -- `nixos-rebuild switch --flake /etc/nixos` - -# Cleanup boot - -> TODO remove, no longer needed `nh` handles this - -I used the existing windows 100MB boot partition and it fills up constantly. Have to purge old stuff a lot this is how: - -- `find '/boot/loader/entries' -type f ! -name 'windows.conf' | head -n -4 | xargs -I {} rm {}; nix-collect-garbage -d; nixos-rebuild boot; echo; df` - # Settings references: - Flake docs: https://nixos.wiki/wiki/Flakes @@ -97,8 +51,6 @@ I used the existing windows 100MB boot partition and it fills up constantly. Hav # TODO -- Secret management? - - ssh keys for github/etc - Use top level split out home manager configurations instead of the one built into the system config... - Make a flake for neovim and move out some system packages required for that into that flake, re-use for root and user rather than cloning each place? - EDITOR env var set to neovim diff --git a/users/josh/home_manager/de/gnome.nix b/users/josh/home_manager/de/gnome.nix index 5e16707..1002e66 100644 --- a/users/josh/home_manager/de/gnome.nix +++ b/users/josh/home_manager/de/gnome.nix @@ -21,8 +21,8 @@ with lib.hm.gvariant; favorite-apps = [ # "vivaldi-stable.desktop" "Alacritty.desktop" - "org.gnome.Nautilus.desktop" "firefox-esr.desktop" + "org.gnome.Nautilus.desktop" "spotify.desktop" "discord.desktop" ];