From 0171861a449e49926cbc0e6462c0fcb2903feffb Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 8 Apr 2024 13:01:54 +0100 Subject: [PATCH] Move `wsl2-*` commands to justfile --- justfile | 14 ++++++++++++++ run | 50 -------------------------------------------------- 2 files changed, 14 insertions(+), 50 deletions(-) delete mode 100755 run diff --git a/justfile b/justfile index 40392f0..0b6d34c 100644 --- a/justfile +++ b/justfile @@ -15,3 +15,17 @@ nixos-test: update: nix flake update + +wsl-build: + NIXPKGS_ALLOW_UNFREE=1 home-manager build \ + --extra-experimental-features flakes \ + --extra-experimental-features nix-command \ + --flake ".#wsl2" \ + --impure + +wsl-switch: + NIXPKGS_ALLOW_UNFREE=1 home-manager switch \ + --extra-experimental-features flakes \ + --extra-experimental-features nix-command \ + --flake ".#wsl2" \ + --impure diff --git a/run b/run deleted file mode 100755 index 242d5e1..0000000 --- a/run +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -# delete any temporary or generated files. -function clean { - rm -rf ./result -} - -# Display a list of all available commands. -function help { - printf "%s [args]\n\nTasks:\n" "${0}" - - compgen -A function | grep -v "^_" | cat -n - - printf "\nExtended help:\n Each task has comments for general usage\n" -} - -# Perform nixos-rebuild commands for a specified flake on NixOS. -function nixos { - clean - - local profile="${1}" - local command="${2}" - shift 2 - - sudo nixos-rebuild "${command}" \ - --flake ".#${profile}" "${@}" -} - -# Update the Nix Flake. -function update { - nix flake update -} - -# Perform home-manager commands on WSL2. -function wsl2 { - clean - - local command="${1}" - - NIXPKGS_ALLOW_UNFREE=1 home-manager "${command}" \ - --extra-experimental-features flakes \ - --extra-experimental-features nix-command \ - --flake ".#wsl2" \ - --impure -} - -TIMEFORMAT=$'\nTask completed in %3lR' -time "${@:-help}"