mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-19 07:05:51 +05:30
Added phoenix gc and updated readme for flakes
This commit is contained in:
parent
0f2d420e04
commit
fe59fcdaef
17
README.org
17
README.org
|
@ -14,14 +14,15 @@ To get this running on a NixOS system, I will start by cloning the repo:
|
||||||
git clone https://gitlab.com/librephoenix/nixos-config.git /path/to/my/config/folder
|
git clone https://gitlab.com/librephoenix/nixos-config.git /path/to/my/config/folder
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
To get the hardware configuration, I can other copy from =/etc/nixos/hardware-configuration.nix= or run:
|
To get the hardware configuration on a new system, I can other copy from =/etc/nixos/hardware-configuration.nix= or run:
|
||||||
#+BEGIN_SRC sh :noeval
|
#+BEGIN_SRC sh :noeval
|
||||||
sudo nixos-generate-config --dir /dotfiles/path/system
|
sudo nixos-generate-config --dir /dotfiles/path/system
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Then, I can switch into the system configuration by running:
|
Then, I can switch into the system configuration by running:
|
||||||
#+BEGIN_SRC sh :noeval
|
#+BEGIN_SRC sh :noeval
|
||||||
sudo nixos-rebuild switch -I nixos-config=nixos-config=/dotfiles/path/system/configuration.nix
|
cd /dotfiles/path
|
||||||
|
sudo nixos-rebuild switch --flake .#snowfire
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Home manager can be installed with:
|
Home manager can be installed with:
|
||||||
|
@ -33,5 +34,15 @@ nix-shell '<home-manager>' -A install
|
||||||
|
|
||||||
Then, my home-manager configuration can be installed with:
|
Then, my home-manager configuration can be installed with:
|
||||||
#+BEGIN_SRC sh :noeval
|
#+BEGIN_SRC sh :noeval
|
||||||
home-manager switch -f /dotfiles/path/user/home.nix
|
home-manager switch --flake #.emmet
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
This loads in my convenience script =phoenix=, which replaces frequently used nix and nixos commands with more user friendly ones, namely:
|
||||||
|
- =phoenix sync= to build and switch system and home configuration
|
||||||
|
- =phoenix sync system= to build and switch only system configuration
|
||||||
|
- =phoenix sync user= to build and switch only home configuration
|
||||||
|
- =phoenix update= to update flake inputs
|
||||||
|
- =phoenix gc= to garbage collect
|
||||||
|
- If no argument is given, it cleans anything older than 30 days
|
||||||
|
- If a time argument is supplied (i.e. 10d), it cleans stuff older than that (10 days in this example)
|
||||||
|
- If the argument =full= is given, it deletes /all/ previous generations
|
||||||
|
|
|
@ -26,6 +26,14 @@ let
|
||||||
pushd ''+myDotfilesDir+'';
|
pushd ''+myDotfilesDir+'';
|
||||||
nix flake update;
|
nix flake update;
|
||||||
popd;
|
popd;
|
||||||
|
elif [ "$1" = "gc" ]; then
|
||||||
|
if [ "$2" = "full" ]; then
|
||||||
|
sudo nix-collect-garbage --delete-old;
|
||||||
|
elif [ "$2" ]; then
|
||||||
|
sudo nix-collect-garbage --delete-older-than $2;
|
||||||
|
else
|
||||||
|
sudo nix-collect-garbage --delete-older-than 30d;
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in a new issue