diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-04-20 19:42:26 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-04-20 19:42:26 -0700 |
| commit | 5f335caa401e9af3b54571dea189b90e90be533c (patch) | |
| tree | 4f28c99ddfc2146801e3df344a37569690745f53 | |
| parent | don't need devShell (diff) | |
| download | infra-5f335caa401e9af3b54571dea189b90e90be533c.tar.gz | |
clean up justfile and rename aliases
| -rw-r--r-- | flake.nix | 4 | ||||
| -rw-r--r-- | justfile | 58 |
2 files changed, 2 insertions, 60 deletions
@@ -89,14 +89,14 @@ devShells.${system}.default = pkgs.mkShellNoCC { packages = with pkgs; [ git - (writeScriptBin "build" '' + (writeScriptBin "nbuild" '' set -e echo "> Running darwin-rebuild switch..." ${inputs.darwin.packages.${system}.darwin-rebuild}/bin/darwin-rebuild build --flake . echo "> darwin-rebuild build was successful ✅" echo "> macOS config was successfully applied 🚀" '') - (writeScriptBin "switch" '' + (writeScriptBin "nswitch" '' set -e echo "> Running darwin-rebuild switch..." ${inputs.darwin.packages.${system}.darwin-rebuild}/bin/darwin-rebuild switch --flake . @@ -20,15 +20,6 @@ test-nix: verify-store: nix store verify --all -[doc('garbage collect all unused nix store entries (system-wide and home-manager)')] -[group('nix')] -gc: - # garbage collect all unused nix store entries(system-wide) - sudo nix-collect-garbage --delete-older-than 7d - # garbage collect all unused nix store entries(for the user - home-manager) - # https://github.com/NixOS/nix/issues/8508 - nix-collect-garbage --delete-older-than 7d - [doc('list recent version')] [group('nix')] history: @@ -39,55 +30,6 @@ history: gcroot: ls -al /nix/var/nix/gcroots/auto/ -[doc('build the configuration for the current host')] -[group('machines')] -[linux] -build: - nixos-rebuild build --flake .#{{ hostname }} - -[doc('switch the configuration for the current host')] -[group('machines')] -[linux] -switch: - nixos-rebuild switch --flake .#{{ hostname }} - -[group('vm')] -vm-bootstrap: - #!/usr/bin/env bash - set -euxo pipefail - ssh {{ SSH_OPTIONS }} root@{{ nixaddr }} " \ - parted /dev/{{ nixdisk }} -- mklabel gpt; \ - parted /dev/{{ nixdisk }} -- mkpart primary 512MB 100%; \ - parted /dev/{{ nixdisk }} -- mkpart ESP fat32 1MB 512MB; \ - parted /dev/{{ nixdisk }} -- set 2 esp on; \ - sleep 1; \ - mkfs.ext4 -L nixos /dev/{{ nixdisk }}1; \ - mkfs.fat -F 32 -n boot /dev/{{ nixdisk }}2; \ - sleep 1; \ - mount /dev/disk/by-label/nixos /mnt; \ - mkdir -p /mnt/boot; \ - mount /dev/disk/by-label/boot /mnt/boot; \ - nixos-generate-config --root /mnt; \ - sed --in-place '/system\.stateVersion = .*/a \ - nix.extraOptions = \"experimental-features = nix-command flakes\";\n \ - services.openssh.enable = true;\n \ - services.openssh.settings.PasswordAuthentication = true;\n \ - services.openssh.settings.PermitRootLogin = \"yes\";\n \ - users.users.root.initialPassword = \"root\";\n \ - ' /mnt/etc/nixos/configuration.nix; \ - nixos-install --no-root-passwd && reboot; \ - " - -[group('vm')] -vm-copy: - #!/usr/bin/env fish - rsync -av -e 'ssh {{ SSH_OPTIONS }}' \ - --exclude='.git/' \ - --exclude='result' \ - --exclude='.direnv/' \ - --rsync-path="sudo rsync" \ - $(dirname justfile)/ {{ nixaddr }}:/nix-config - [group('llm')] llm: #!/usr/bin/env fish |
