mirror of
https://github.com/librephoenix/nixos-config
synced 2025-07-06 06:52:13 +05:30
Moved phoenix script to its own file
This commit is contained in:
parent
a86b50de25
commit
0acd3eccb6
2 changed files with 31 additions and 25 deletions
29
user/bin/phoenix.nix
Normal file
29
user/bin/phoenix.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, pkgs, myName, myDotfilesDir, ... }:
|
||||
|
||||
let
|
||||
# This sets up my "phoenix" script with my configuration paths
|
||||
# =phoenix= is just my wrapper script for easier access to nix/nixos commands
|
||||
myPhoenixScript = ''
|
||||
if [ "$1" = "sync" ]; then
|
||||
if [ "$2" != "user" ]; then
|
||||
pushd ''+myDotfilesDir+'';
|
||||
sudo nixos-rebuild switch --flake .#;
|
||||
popd;
|
||||
fi
|
||||
if [ "2" != "system" ]; then
|
||||
pushd ''+myDotfilesDir+'';
|
||||
home-manager switch --flake .#''+myName+'';
|
||||
popd;
|
||||
fi
|
||||
elif [ "$1" = "update" ]; then
|
||||
pushd ''+myDotfilesDir+'';
|
||||
nix flake update;
|
||||
popd;
|
||||
fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
(pkgs.writeScriptBin "phoenix" myPhoenixScript)
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue