From ba0f8cf25b34846c3083b3c24a73d50fd9876bcb Mon Sep 17 00:00:00 2001 From: Emmet Date: Sun, 14 Apr 2024 12:36:03 -0500 Subject: [PATCH 1/6] tldr about phoenix wrapper script --- README.org | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.org b/README.org index aa4aa49..efd52f6 100644 --- a/README.org +++ b/README.org @@ -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]] From 9d7a5edf03d2b2d58dd00829326531098640af4e Mon Sep 17 00:00:00 2001 From: Emmet Date: Sun, 14 Apr 2024 12:38:03 -0500 Subject: [PATCH 2/6] Removed old todo --- install.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/install.sh b/install.sh index cb1ec55..ce94d71 100755 --- a/install.sh +++ b/install.sh @@ -3,8 +3,6 @@ # 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" ] then SCRIPT_DIR=$1 From c654aa2a4bcab7b409a50867d0600f3849ad4417 Mon Sep 17 00:00:00 2001 From: Emmet Date: Sun, 14 Apr 2024 12:51:44 -0500 Subject: [PATCH 3/6] Updated readme's wrt specialArg vars from flake --- system/README.org | 14 +++++--------- user/README.org | 19 ++++++++----------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/system/README.org b/system/README.org index 6a6690a..f304994 100644 --- a/system/README.org +++ b/system/README.org @@ -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 diff --git a/user/README.org b/user/README.org index a449dca..d6e1a6e 100644 --- a/user/README.org +++ b/user/README.org @@ -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 From eea5b5e14860546cb7e8926c3dcce432d34eb810 Mon Sep 17 00:00:00 2001 From: Emmet Date: Sun, 14 Apr 2024 13:02:41 -0500 Subject: [PATCH 4/6] Added dired jump with quick keybind --- user/app/doom-emacs/config.el | 10 ++++++---- user/app/doom-emacs/doom.org | 11 +++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/user/app/doom-emacs/config.el b/user/app/doom-emacs/config.el index 89d0615..9409433 100644 --- a/user/app/doom-emacs/config.el +++ b/user/app/doom-emacs/config.el @@ -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 ;;;-- diff --git a/user/app/doom-emacs/doom.org b/user/app/doom-emacs/doom.org index 2151480..1fc0260 100644 --- a/user/app/doom-emacs/doom.org +++ b/user/app/doom-emacs/doom.org @@ -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 From 2b7b783e55382ebc694f835203942727de8ace68 Mon Sep 17 00:00:00 2001 From: Emmet Date: Sun, 14 Apr 2024 13:11:08 -0500 Subject: [PATCH 5/6] Fixes install script for non ~/.dotfiles dirs --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index ce94d71..c167cf4 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ # Automated script to install my dotfiles # Clone dotfiles -if [ -z "$1" ] +if [ $# -gt 0 ] then SCRIPT_DIR=$1 else From e5260a945e77037aa01a49ced7166fb7533152b1 Mon Sep 17 00:00:00 2001 From: Emmet Date: Sun, 14 Apr 2024 13:16:57 -0500 Subject: [PATCH 6/6] Fixes typos on install.org --- install.org | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/install.org b/install.org index ac901b6..771fff8 100644 --- a/install.org +++ b/install.org @@ -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.