From 50fb9edaf0ee5c06bac1b81a17fb36cc21abdfa1 Mon Sep 17 00:00:00 2001 From: ChUrl Date: Mon, 8 Aug 2022 13:31:01 +0200 Subject: [PATCH] outsource shell config to shell.nix --- shell.nix | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..e8bfa138 --- /dev/null +++ b/shell.nix @@ -0,0 +1,57 @@ +{ pkgs }: + +pkgs.devshell.mkShell { + name = "NixFlake Shell"; + + packages = with pkgs; [ + jetbrains.clion + ]; + + commands = [ + { + name = "ide"; + help = "Launch clion in this folder"; + command = "clion ./ &>/dev/null &"; + } + { + name = "update"; + help = "Update the flake"; + command = "nix flake update"; + } + { + name = "check"; + help = "Validate the flake"; + command = "nix flake check"; + } + { + name = "pkgs-sys"; + help = "List currently installed system packages"; + command = "bat /etc/current-system-packages"; + } + { + name = "pkgs-usr"; + help = "List currently installed user packages"; + command = "bat ~/.local/share/current-user-packages"; + } + { + name = "switch-nixinator"; + help = "Rebuild and activate the nixinator config"; + command = "sudo nixos-rebuild switch --flake .#nixinator"; + } + { + name = "build-nixinator"; + help = "Rebuild and diff the nixinator config"; + command = "sudo nixos-rebuild build --flake .#nixinator | nvd diff /run/current-system result"; + } + { + name = "switch-nixtop"; + help = "Rebuild and activate the nixtop config"; + command = "sudo nixos-rebuild switch --flake .#nixtop"; + } + { + name = "build-nixtop"; + help = "Rebuild and diff the nixtop config"; + command = "sudo nixos-rebuild build --flake .#nixtop | nvd diff /run/current-system result"; + } + ]; +} \ No newline at end of file