From 46b8eb6a9379d23dd2845bc72e51ed16ad827fed Mon Sep 17 00:00:00 2001 From: pagedmov Date: Thu, 7 Nov 2024 15:02:47 -0500 Subject: [PATCH] added documentation for nix scripts --- docs/{ => scripts}/commands.md | 2 +- docs/scripts/nixshortcuts.md | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) rename docs/{ => scripts}/commands.md (98%) create mode 100644 docs/scripts/nixshortcuts.md diff --git a/docs/commands.md b/docs/scripts/commands.md similarity index 98% rename from docs/commands.md rename to docs/scripts/commands.md index ed14274..56f8c6e 100644 --- a/docs/commands.md +++ b/docs/scripts/commands.md @@ -35,7 +35,7 @@ - `viconf ` - Examples: - `viconf hyprland` - Opens $FLAKEPATH/modules/home/environment/hyprland.nix - - `viconf sys` - Opens fuzzyfinder window containing all nix files in modules/sys + - `viconf sys` - Opens fuzzyfinder window containing all nix files in modules/sys and its subdirectories - `viconf config` - Opens fuzzyfinder window containing all nix files called 'config.nix' - `viconf scripts/def` - Opens $FLAKEPATH/modules/home/scripts/default.nix - Defined in 'modules/home/scripts/commands/viconf.nix' diff --git a/docs/scripts/nixshortcuts.md b/docs/scripts/nixshortcuts.md new file mode 100644 index 0000000..a1b0975 --- /dev/null +++ b/docs/scripts/nixshortcuts.md @@ -0,0 +1,36 @@ +# pagedMov's Nix Aliases + +## fetchfromgh + - Given a username and repo name like someuser/somerepo, generates a full pkgs.fetchFromGitHub call. + - Usage: + - `fetchfromgh someuser/somerepo` + - Example: + - `fetchfromgh pagedMov/nixos-config` - returns this: + src = pkgs.fetchFromGitHub { + owner = "pagedMov"; + repo = "nixos-config"; + rev = "fcf19c65971c667f67abf57bcaf88be410fb0759"; + hash = "sha256-z+3E+ueSd2QNqtrbBKt8bwIfboPCXSUrGn690Hc/kl0="; + }; + - Defined in 'modules/home/scripts/nix/fetchfromgh.nix' + +## garbage-collect + - Runs the Nix garbage collector and also deletes all files in .local/share/Trash + - Usage: + - `garbage-collect` - Does not take any arguments + - Defined in 'modules/home/scripts/nix/garbage-collect.nix' + +## nsp + - Simple alias for `nix-shell -p` + - Usage: + - `nsp ` + - Example: + - `nsp hello` + - Defined in 'modules/home/scripts/nix/nsp.nix' + +## rebuild + - nh os switch and nh home switch packaged into one command + - Usage: + - `rebuild -h` - Runs `nh home switch -c $FLAKEPATH` + - `rebuild -s` - Runs `nh os switch -H $FLAKEPATH` + - Defined in 'modules/home/scripts/nix/rebuild.nix'