convert "channel" from alias to script

This commit is contained in:
Sean Buckley 2020-10-01 11:40:28 -04:00
parent e285d3b362
commit 1d9c086a71

View file

@ -44,6 +44,13 @@
if ln.startswith('size '): if ln.startswith('size '):
print(str(int(ln.split(' ')[-1])/(1024*1024*1024))[:5],'GB') print(str(int(ln.split(' ')[-1])/(1024*1024*1024))[:5],'GB')
'') '')
(writeScriptBin "channel" ''
#!/bin/sh
echo "$(curl --silent -L https://channels.nixos.org/nixos-20.09/git-revision)" nixos-20.09
echo "$(cat /nix/var/nix/profiles/per-user/root/channels/nixos/.git-revision)" nixos local
echo "$(curl --silent -L https://channels.nixos.org/nixos-unstable/git-revision)" nixos-unstable
'')
]; ];
virtualisation.podman.enable = true; virtualisation.podman.enable = true;
@ -57,12 +64,6 @@
alias p=python3 alias p=python3
alias buildsys='nix build -f "<nixpkgs/nixos>" --no-link system' alias buildsys='nix build -f "<nixpkgs/nixos>" --no-link system'
alias channel='
echo "$(curl --silent -L https://channels.nixos.org/nixos-20.09/git-revision)" nixos-20.09;\
echo "$(cat /nix/var/nix/profiles/per-user/root/channels/nixos/.git-revision)" local nixos;\
echo "$(curl --silent -L https://channels.nixos.org/nixos-unstable/git-revision) nixos-unstable"
'
function _update_ps1() { function _update_ps1() {
PS1="\n$(${pkgs.callPackage ../pkgs/powerline-go-updated { }}/bin/powerline-go \ PS1="\n$(${pkgs.callPackage ../pkgs/powerline-go-updated { }}/bin/powerline-go \
-mode=flat \ -mode=flat \