My Nix Infra
nix nixos
0
fork

Configure Feed

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

tidy up scripts and makefile

ydcjeff 7a3ef1f1 e24b8f8d

+67 -13
+16 -10
Makefile
··· 1 - cp: 2 - bash scripts/cp-config.sh 1 + nixos: 2 + bash scripts/nixos-install.sh $1 3 3 4 - sw: 5 - sudo nixos-rebuild switch --flake .#risu --impure 6 - 7 - setup: 4 + nixos-post: 8 5 $(MAKE) sw 9 6 $(MAKE) cp 10 7 bash scripts/init-work.sh 11 - bash scripts/kde-config.sh 12 8 reboot 13 9 14 - archsetup: 15 - bash scripts/archsetup.sh 10 + cp: 11 + bash scripts/cp-config.sh 12 + 13 + sw: 14 + sudo nixos-rebuild switch --flake . --impure 16 15 17 16 debug: 18 - sudo nixos-rebuild switch --flake .#risu --show-trace --verbose 17 + sudo nixos-rebuild switch --flake . --show-trace --verbose 19 18 20 19 gc: 21 20 nix store gc --debug ··· 23 22 24 23 up: 25 24 nix flake update 25 + 26 + check: 27 + nix flake check 28 + 29 + arch: 30 + bash scripts/arch-install.sh 31 +
-1
flake.nix
··· 48 48 cc-www = pkgs.mkShell { 49 49 name = "cc-www"; 50 50 packages = with pkgs; [ 51 - nodejs_24 52 51 phpEnv 53 52 phpEnv.packages.composer 54 53 kubelogin-oidc
+1
modules/pkgs.nix
··· 71 71 kubectl 72 72 k9s 73 73 74 + nodejs_24 74 75 pnpm 75 76 uv 76 77 ]
scripts/archsetup.sh scripts/arch-install.sh
+4 -2
scripts/cp-config.sh
··· 1 1 #!/usr/bin/env bash 2 2 3 - set -e 3 + set -ex 4 + 5 + DOTFILES="$(dirname "$(dirname "$(realpath "$0")")")" 4 6 5 7 mkdir -p "$HOME"/.config 6 8 rm -rf "$HOME"/.gitconfig 7 - cp -r "$HOME"/.dotfiles/config/* "$HOME"/.config 9 + cp -r "$DOTFILES"/config/* "$HOME"/.config 8 10 # LazyVim 9 11 if [[ ! -d "$HOME"/.config/nvim ]]; then 10 12 git clone https://github.com/LazyVim/starter "$HOME"/.config/nvim
+46
scripts/nixos-install.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + set -e 4 + 5 + DOTFILES="$(dirname "$(dirname "$(realpath "$0")")")" 6 + 7 + if [[ "$#" != 1 ]]; then 8 + echo "Usage: $0 <hostname>" 9 + exit 1 10 + fi 11 + 12 + # validation 13 + for host in "$DOTFILES"/hosts/*; do 14 + if [[ "$host" != "$1" ]]; then 15 + echo -n "Host $1 not found in " 16 + ls "$DOTFILES/hosts" 17 + exit 1 18 + fi 19 + done 20 + 21 + # 1. Boot into NixOS installer, change passwd of current user 22 + passwd "$(whoami)" 23 + 24 + # 2. Clone the repo 25 + git clone https://codeberg.org/ydcjeff/dotfiles.git || true 26 + 27 + # 3. Check disk-config.nix 28 + read -rp "Checked ./hosts/$1/disk-config.nix? (y/n): " ans 29 + 30 + if [[ "$ans" == "n" ]]; then 31 + echo "Please check disk-config.nix" 32 + exit 1 33 + else 34 + read -rp "Disk encryption passwd: " pw 35 + echo -n "$pw" >/tmp/key 36 + fi 37 + 38 + # 4. Final NixOS install 39 + if [[ -f "$DOTFILES/hosts/$1/hardware-configuration.nix" ]]; then 40 + nix run --extra-experimental-features 'nix-command flakes' \ 41 + github:nix-community/nixos-anywhere -- --flake .\#"$1" 42 + else 43 + nix run --extra-experimental-features 'nix-command flakes' \ 44 + github:nix-community/nixos-anywhere -- --flake .\#"$1" \ 45 + --generate-hardware-config nixos-generate-config "$DOTFILES/hosts/$1/hardware-configuration.nix" 46 + fi