This repo has been archived, go to Nix-Scripts on sourcehut
Everything beyond this point is outdated, development has been moved to the sourcehut repo
My personal repo for the scripts I use on my Linux systems.
This script makes building NixOS configurations simpler and more streamlined by simplifying the syntax
For normal users Main, available for flake and non-flake users
S - switch
B - build
v - verbose output
e - extra options e.g --version
t - enable show-trace option which helps with debugging and testing
i - enable the impure flag
d - use the --dry-run flag
For flake users
F - enable flakes
r - the repo which the flake.nix file is stored in, if not specified will check current directory. You must use either the auto flag or this flag
u - update packages, specifically updates all flake inputs in the flake.nix file
a - auto mode, uses your current directory and sets a default userstring
n - specify your hostname, can be used with auto mode
update-inputs - update specific inputs if you only want to update one but not the other
# This will build the NixOS configuration using flakes
nix-rebuild -Si -Fa
# Same as
nix flake update --commit-lock-file
sudo nixos-rebuild switch --flake .#hostname --impure- nix
This script is solely made for NixOS users and cannot be used on other distros without some extreme modification
I wrote this script to make building home manager configurations easier and faster with easy to remember and learn options.
Main, available for flake and non-flake users
S - switch
B - build
b - backup conflicting files
v - verbose output
e - extra options e.g --version
t - enable show-trace option which helps with debugging and testing
i - enable the impure flag
d - use the --dry-run flag
For flake users
F - enable flakes
r - the repo which the flake.nix file is stored in, if not specified will check current directory
u - update packages, specifically updates all flake inputs in the flake.nix file
a - auto mode, uses your current directory and sets a default userstring
n - specify your userstring, can be used with auto mode
update-inputs - update specific inputs if you only want to update one but not the other
Minimal example
# In this example
hm-build -Sb
# Is the same as
home-manager switch -b hmbakMaximal example, using flakes
# In this example
hm-build -Sivbtd -Fau
# Is the same as
# It will check if the current directory has a flake.nix file
nix-flake update --commit-lock-file
home-manager switch --flake .#user@hostname --verbose --dry-run -b backup --impure --show-traceSpecify a repo using -r
hm-build -S -Fr ~/repo
#You have to use this if you're not going to use -r, it will use the current directory:
# -a is for auto mode
hm-build -S -FaSpecify your userstring using
# This will take the hostname and username you specify and use it instead of the defaults for your system
hm-build -S -Fan user@hostname- nix
- home-manager
It will work on most distros in theory, I'm not so sure about in practice but I'm sure it should work
This script uses hyprpicker to pick a color from the screen. Using wl-clipboard's tools wl-copy and wl-paste to copy the color code in #AABBCC format to the clipboard and notify-send to to notify of the completed operation. All in less than 5 seconds!
- hyprpicker
- wl-clipboard
- libnotify
You can add this to your flake.nix inputs
{
inputs = {
useful-scripts = {
url = "github:Daru-san/useful-scripts";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}Install on nix
{ pkgs, inputs }:{
environment.systemPackges = [
inputs.useful-scripts.packages.${pkgs.system}.hm-build
inputs.useful-scripts.packages.${pkgs.system}.color-picker
];
}Install on home manager
{ pkgs, inputs }:{
home.packages = [
inputs.useful-scripts.packages.${pkgs.system}.hm-build
inputs.useful-scripts.packages.${pkgs.system}.color-picker
];
}- Create flake packages
- Update nix-rebuild
- Make docs
- Finish hm-build and nix-rebuild flake inputs
- Update hm-build and nix-rebuild flake options