From 297a1b846bad8ec4b176ac0c4b3e3560bb41347d Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Wed, 9 Jun 2021 14:36:52 -0400 Subject: [PATCH] add system-rev variable --- modules/cli.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/cli.nix b/modules/cli.nix index 154657c..578248c 100644 --- a/modules/cli.nix +++ b/modules/cli.nix @@ -12,6 +12,8 @@ let (x: (pkgs.writeShellScriptBin "sc-${x}" "nixos-rebuild ${x} --refresh --flake github:buckley310/nixos-config")) [ "switch" "build" "boot" ]; + system-rev = toString config.system.nixos.revision; + in { environment.systemPackages = with pkgs; [ @@ -47,11 +49,11 @@ in (writeShellScriptBin "nix-roots" "nix-store --gc --print-roots | grep -v ^/proc/") (writeShellScriptBin "ns" '' - exec nix shell "github:NixOS/nixpkgs/${toString config.system.nixos.revision}#$@" + exec nix shell "nixpkgs/${system-rev}#$@" '') (writeShellScriptBin "pip_install" '' - exec nix shell 'nixpkgs/nixos-unstable#python3.pkgs.pip' --command pip install --user -UI pip setuptools + exec nix shell 'nixpkgs/${system-rev}#python3.pkgs.pip' --command pip install --user -UI pip setuptools '') (writeShellScriptBin "nixos-check-reboot" '' @@ -79,7 +81,7 @@ in echo echo "NixOS ${config.system.nixos.release} (${config.system.defaultChannel})" echo - echo "${toString config.system.nixos.revision} current local" + echo "${system-rev} current local" echo "$(curl --silent -L ${config.system.defaultChannel}/git-revision) latest available" echo '')