Compare commits

...

6 commits

Author SHA1 Message Date
Emmet e5260a945e Fixes typos on install.org 2024-04-14 13:16:57 -05:00
Emmet 2b7b783e55 Fixes install script for non ~/.dotfiles dirs 2024-04-14 13:11:08 -05:00
Emmet eea5b5e148 Added dired jump with quick keybind 2024-04-14 13:02:41 -05:00
Emmet c654aa2a4b Updated readme's wrt specialArg vars from flake 2024-04-14 12:51:44 -05:00
Emmet 9d7a5edf03 Removed old todo 2024-04-14 12:38:03 -05:00
Emmet ba0f8cf25b tldr about phoenix wrapper script 2024-04-14 12:36:03 -05:00
7 changed files with 48 additions and 34 deletions

View file

@ -86,6 +86,25 @@ My profile can be conveniently selected in [[./flake.nix][my flake.nix]] by sett
More detailed information on these profiles is in the [[./profiles][profiles directory]].
** Nix Wrapper Script
Some Nix commands are confusing, really long to type out, or require me to be in the directory with my dotfiles. To solve this, I wrote a [[./system/bin/phoenix.nix][wrapper script called phoenix]], which calls various scripts in the root of this directory.
TLDR:
- =phoenix sync= - Synchronize system and home-manager state with config files (essentially =nixos-rebuild switch= + =home-manager switch=)
- =phoenix sync system= - Only synchronize system state (essentially =nixos-rebuild switch=)
- =phoenix sync user= - Only synchronize home-manager state (essentially =home-manager switch=)
- =phoenix update= - Update all flake inputs without synchronizing system and home-manager states
- =phoenix upgrade= - Update flake.lock and synchronize system and home-manager states (=phoenix update= + =phoenix sync=)
- =phoenix refresh= - Call synchronization posthooks (mainly to refresh stylix and some dependent daemons)
- =phoenix pull= - Pull changes from upstream git and attempt to merge local changes (I use this to update systems other than my main system)
- =phoenix harden= - Ensure that all "system-level" files cannot be edited by an unprivileged user
- =phoenix soften= - Relax permissions so all dotfiles can be edited by a normal user (use temporarily for git or other operations)
- =phoenix gc= - Garbage collect the system and user nix stores
- =phoenix gc full= - Delete everything not currently in use
- =phoenix gc 15d= - Delete everything older than 15 days
- =phoenix gc 30d= - Delete everything older than 30 days
- =phoenix gc Xd= - Delete everything older than X days
** Star History
Didn't think this would get that many [[https://star-history.com/#librephoenix/nixos-config&Date][stars on GitHub]], yet here we are:
[[https://api.star-history.com/svg?repos=librephoenix/nixos-config&type=Date.png]]

View file

@ -24,7 +24,7 @@ nix run git+https://codeberg.org/librephoenix/nixos-config
This will install the dotfiles to =~/.dotfiles=, but if you'd like to install to a custom directory, just supply it as a positional argument, i.e:
#+BEGIN_SRC sh :noeval
# Install from gitlab
nix run gitlab:librephoenix/nixos-config /your/custom/directory
nix run gitlab:librephoenix/nixos-config -- /your/custom/directory
#+END_SRC
The script will ask for sudo permissions at certain points, /but you should not run the script as root/.
@ -45,7 +45,7 @@ nix-shell -p git --command "nix run --experimental-features 'nix-command flakes'
This /should/ still work with a custom dotfiles directory too, i.e:
#+begin_src sh :noeval
nix-shell -p git --command "nix run --experimental-features 'nix-command flakes' gitlab:librephoenix/nixos-config /your/custom/directory"
nix-shell -p git --command "nix run --experimental-features 'nix-command flakes' gitlab:librephoenix/nixos-config -- /your/custom/directory"
#+end_src
At a certain point in the install script it will open =nano= (or whatever your $EDITOR is set to) and ask you to edit the =flake.nix=. You can edit as much or as little of the config variables as you like, and it will continue the install after you exit the editor.
@ -104,7 +104,6 @@ git clone https://gitlab.com/librephoenix/nixos-config.git ~/.dotfiles
Any custom directory should also work:
#+BEGIN_SRC sh :noeval
git clone https://gitlab.com/librephoenix/nixos-config.git /your/custom/directory
/your/custom/directory/install.sh
#+END_SRC
If you install to a custom directory, make sure to edit the =userSettings.dotfilesDir= in the beginning [[./flake.nix][flake.nix]], or else my [[./system/bin/phoenix.nix][phoenix wrapper script]] won't work.

View file

@ -3,9 +3,7 @@
# Automated script to install my dotfiles
# Clone dotfiles
# TODO make ~/.dotfiles path arbitrary and make all other scripts conform to this
# using SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [ -z "$1" ]
if [ $# -gt 0 ]
then
SCRIPT_DIR=$1
else

View file

@ -20,14 +20,10 @@ My system-level Nix modules are organized into this directory:
- [[./wm][wm]] - Necessary system-level configuration to get various window managers, wayland compositors, and/or desktop environments working
** Variables imported from flake.nix
# TODO update this
Variables can be imported from [[../flake.nix][flake.nix]] by setting the =specialArgs= block inside the flake (see [[../flake.nix][my flake]] for more details). This allows variables to merely be managed in one place ([[../flake.nix][flake.nix]]) rather than having to manage them in multiple locations.
I currently import the following variables to the system config:
- =username= - Username
- =hostname= - Hostname for machine
- =timezone= - Timezone for machine
- =locale= - Locale for machine
- =theme= - base16 theme stored in ../themes to be used
- =backgroundUrl= - Direct link to background wallpaper (used for login screen)
- =backgroundSha256= - Checksum for background image used when downloading
I use this to pass a few attribute sets:
- =userSettings= - Settings for the normal user (see [[../flake.nix][flake.nix]] for more details)
- =systemSettings= - Settings for the system (see [[../flake.nix][flake.nix]] for more details)
- =inputs= - Flake inputs (see [[../flake.nix][flake.nix]] for more details)
- =pkgs-stable= - Allows me to include stable versions of packages along with (my default) unstable versions of packages

View file

@ -31,20 +31,17 @@ My user-level Nix modules are organized into this directory:
- [[./shell/cli-collection.nix][cli-collection]] - Curated useful CLI utilities
- [[./style][style]] - Stylix setup (system-wide base16 theme generation)
- [[./wm][wm]] - Window manager, compositor, wayland compositor, and/or desktop environment setups
- [[./wm/hyprland][hyprland]]
- [[./wm/xmonad][xmonad]]
- [[./wm/picom][picom]]
** Variables imported from flake.nix
# TODO update this
Variables can be imported from [[../flake.nix][flake.nix]] by setting the =extraSpecialArgs= block inside the flake (see [[../flake.nix][my flake]] for more details). This allows variables to merely be managed in one place ([[../flake.nix][flake.nix]]) rather than having to manage them in multiple locations.
I currently import the following variables to the system config:
- =username= - Username
- =hostname= - Hostname for machine
- =myHomeDir= - Absolute path to home directory derived from =username=
- =email= - Email
- =dotfilesDir= - Path to my dotfiles directory on the system
- =theme= - base16 theme stored in ../themes to be used
- =themePolarity= - whether theme is =light= or =dark=
- =backgroundUrl= - Direct link to background wallpaper (used for login screen)
- =backgroundSha256= - Checksum for background image used when downloading
I use this to pass a few attribute sets:
- =userSettings= - Settings for the normal user (see [[../flake.nix][flake.nix]] for more details)
- =systemSettings= - Settings for the system (see [[../flake.nix][flake.nix]] for more details)
- =inputs= - Flake inputs (see [[../flake.nix][flake.nix]] for more details)
- =pkgs-stable= - Allows me to include stable versions of packages along with (my default) unstable versions of packages
- =pkgs-emacs= - Pinned version of nixpkgs I use for Emacs and its dependencies
- =pkgs-kdenlive= - Pinned version of nixpkgs I use for kdenlive

View file

@ -1244,7 +1244,11 @@ https://github.com/magit/magit/issues/460 (@cpitclaudel)."
"C-=" 'text-scale-increase
:desc "Decrease font size"
"C--" 'text-scale-decrease)
"C--" 'text-scale-decrease
:desc "Jump to dired"
"M-f" 'dired-jump
)
;;;------ ranger configuration ------;;;
@ -1254,9 +1258,7 @@ https://github.com/magit/magit/issues/460 (@cpitclaudel)."
:desc "Toggle mark on current file"
"x" 'ranger-toggle-mark
:desc "Open ranger"
"o d" 'ranger)
)
;;;-- hledger-mode configuration ;;;--

View file

@ -1435,7 +1435,12 @@ https://github.com/magit/magit/issues/460 (@cpitclaudel)."
"C-=" 'text-scale-increase
:desc "Decrease font size"
"C--" 'text-scale-decrease)
"C--" 'text-scale-decrease
:desc "Jump to dired"
"M-f" 'dired-jump
)
#+END_SRC
** Ranger Configuration
@ -1448,9 +1453,7 @@ https://github.com/magit/magit/issues/460 (@cpitclaudel)."
:desc "Toggle mark on current file"
"x" 'ranger-toggle-mark
:desc "Open ranger"
"o d" 'ranger)
)
#+END_SRC
** hledger-mode Configuration