mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-19 07:05:51 +05:30
Moved phoenix script to its own file
This commit is contained in:
parent
a86b50de25
commit
0acd3eccb6
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)
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,28 +1,5 @@
|
||||||
{ config, lib, pkgs, myName, myEmail, myHomeDir, myDotfilesDir, myTheme, ... }:
|
{ config, lib, pkgs, myName, myEmail, myHomeDir, myDotfilesDir, myTheme, ... }:
|
||||||
|
|
||||||
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 Manager needs a bit of information about you and the paths it should
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
# manage.
|
# manage.
|
||||||
|
@ -34,6 +11,7 @@ in
|
||||||
imports = [
|
imports = [
|
||||||
./wm/xmonad/xmonad.nix # My xmonad config
|
./wm/xmonad/xmonad.nix # My xmonad config
|
||||||
./shell/sh.nix # My zsh and bash config
|
./shell/sh.nix # My zsh and bash config
|
||||||
|
./bin/phoenix.nix # My nix command wrapper
|
||||||
./app/git/git.nix # My git config
|
./app/git/git.nix # My git config
|
||||||
./style/stylix.nix # Styling and themes for my apps
|
./style/stylix.nix # Styling and themes for my apps
|
||||||
];
|
];
|
||||||
|
@ -56,7 +34,6 @@ in
|
||||||
feh
|
feh
|
||||||
git
|
git
|
||||||
xmobar
|
xmobar
|
||||||
(pkgs.writeScriptBin "phoenix" myPhoenixScript)
|
|
||||||
|
|
||||||
# Office
|
# Office
|
||||||
libreoffice-qt
|
libreoffice-qt
|
||||||
|
|
Loading…
Reference in a new issue