feat: packages

This commit is contained in:
Philipp Hochkamp 2022-03-05 12:34:52 +01:00
parent 39f91ed113
commit 40f300f95a
7 changed files with 33 additions and 1 deletions

0
packages/.gitkeep Normal file
View file

9
packages/scripts.nix Normal file
View file

@ -0,0 +1,9 @@
{ stdenv, ...}:
stdenv.mkDerivation {
name = "scripts";
src = ./scripts;
installPhase = ''
mkdir -p $out/bin
cp * $out/bin
'';
}

8
packages/scripts/nosrebuild Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
REV=$(curl https://api.github.com/repos/ragon000/nixos-config/branches/main | jq -r .commit.sha)
if [[ $(uname) == "Linux" ]]; then
sudo nixos-rebuild switch --flake "github:ragon000/nixos-config?rev=$REV"
else # Darwin
/nix/var/nix/profiles/system/sw/bin/darwin-rebuild switch --flake "github:ragon000/nixos-config?rev=$REV"
fi

3
packages/scripts/nr Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
nix run nixpkgs#$1

3
packages/scripts/ns Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
nix shell nixpkgs#$1