dotfiles

My PC Dotfiles & Website
commit 3437057a6a446fa57b26ea727c76922c38bf8f86
parent cc852819221f8ca9524fb36f9f5e664929427696
Author: maydayv7 <maydayv7@gmail.com>
Date:   Sat,  9 Aug 2025 12:27:47 +0530

style: Update Formatting

Diffstat:

MCHANGELOG.md | 1+
MREADME.md | 2+-
Mfiles/flake.nix | 49++++++++++++++++++++++++-------------------------
Mmodules/apps/notes.nix | 3++-
Mmodules/apps/wine.nix | 3++-
Mmodules/gui/desktop/gnome/settings/extensions.nix | 110+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mmodules/gui/desktop/hyprland/apps/files.nix | 17+++++++++--------
Mmodules/gui/desktop/hyprland/apps/notify.nix | 9++++++---
Mmodules/gui/desktop/hyprland/apps/settings.nix | 33++++++++++++++++-----------------
Mmodules/gui/desktop/hyprland/apps/utilities.nix | 26++++++++++++--------------
Mmodules/gui/desktop/hyprland/settings/keybindings.nix | 155+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mmodules/gui/theme.nix | 13+++++++------
Mmodules/hardware/boot.nix | 135+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mmodules/hardware/filesystem.nix | 67++++++++++++++++++++++++++++++++++---------------------------------
Mpackages/overlays/chrome.nix | 12+++++-------
Mscripts/README.md | 29++---------------------------
Mscripts/nixos.nix | 18++----------------
Mshells/default.nix | 25++++++++++++-------------
18 files changed, 333 insertions(+), 374 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -2,6 +2,7 @@ ### July +- Add Hyprland Shaders - Update Hyprland to v0.50 - Rename `hardware.filesystem` -> `hardware.fs` and improve - Improve `nixos apply --delta` diff --git a/README.md b/README.md @@ -504,7 +504,7 @@ _Thanks a lot! ;)_ </details> -> Last Updated: **June** 2025 +> Last Updated: **August** 2025 If you like this project, consider leaving a [star](https://github.com/maydayv7/dotfiles) diff --git a/files/flake.nix b/files/flake.nix @@ -72,31 +72,30 @@ }; # Hyprland WM - hyprland = - { - # Custom Shaders - shaders = ./hyprland/shaders; - - # Pyprland - pypr = readFile ./hyprland/pypr.toml; - - # Hot Corners - waycorner = readFile ./hyprland/waycorner.toml; - - # Keybinds Viewer - kebihelp = readFile ./hyprland/kebihelp.json; - - # PcmanFM File Manager - pcmanfm = readFile ./hyprland/pcmanfm.conf; - - # Greeter Configuration - greeter = readFile ./hyprland/greeter.conf; - } - // map.files { - directory = ./hyprland/theme; - apply = readFile; - extension = ".css"; - }; + hyprland = { + # Custom Shaders + shaders = ./hyprland/shaders; + + # Pyprland + pypr = readFile ./hyprland/pypr.toml; + + # Hot Corners + waycorner = readFile ./hyprland/waycorner.toml; + + # Keybinds Viewer + kebihelp = readFile ./hyprland/kebihelp.json; + + # PcmanFM File Manager + pcmanfm = readFile ./hyprland/pcmanfm.conf; + + # Greeter Configuration + greeter = readFile ./hyprland/greeter.conf; + } + // map.files { + directory = ./hyprland/theme; + apply = readFile; + extension = ".css"; + }; # Pictures images = { diff --git a/modules/apps/notes.nix b/modules/apps/notes.nix @@ -39,7 +39,8 @@ in ".config/logseq/configs.edn".text = ''{:window/native-titlebar? true}''; ".logseq/preferences.json" = { text = prefs; - } // mutable; + } + // mutable; ".logseq/config/config.edn".text = mkIf ( cfg.style != "" ) ''{:custom-css-url "@import ${cfg.style};"}''; diff --git a/modules/apps/wine.nix b/modules/apps/wine.nix @@ -42,7 +42,8 @@ in ".wine" ".cache/wine" ".cache/winetricks" - ] ++ optionals cfg.utilities [ ".config/notepad++" ]; + ] + ++ optionals cfg.utilities [ ".config/notepad++" ]; environment.systemPackages = with pkgs.wine // pkgs; diff --git a/modules/gui/desktop/gnome/settings/extensions.nix b/modules/gui/desktop/gnome/settings/extensions.nix @@ -273,29 +273,28 @@ let { package = ddterm; path = "com/github/amezin/ddterm"; - settings = - { - dterm-toggle-hotkey = [ "<Super>t" ]; - hide-window-on-esc = true; - panel-icon-type = "none"; - shortcut-find = [ "<Control>f" ]; - shortcut-page-close = [ "<Control>w" ]; - shortcut-win-new-tab = [ "<Control>t" ]; - show-animation = "ease-in-sine"; - show-animation-duration = 0.2; - hide-animation = "ease-out-sine"; - hide-animation-duration = 0.1; - window-skip-taskbar = false; - } - // (listToAttrs ( - genList ( - n: - let - num = toString (n + 1); - in - nameValuePair "shortcut-switch-to-tab-${num}" [ "<Control>${num}" ] - ) 9 - )); + settings = { + dterm-toggle-hotkey = [ "<Super>t" ]; + hide-window-on-esc = true; + panel-icon-type = "none"; + shortcut-find = [ "<Control>f" ]; + shortcut-page-close = [ "<Control>w" ]; + shortcut-win-new-tab = [ "<Control>t" ]; + show-animation = "ease-in-sine"; + show-animation-duration = 0.2; + hide-animation = "ease-out-sine"; + hide-animation-duration = 0.1; + window-skip-taskbar = false; + } + // (listToAttrs ( + genList ( + n: + let + num = toString (n + 1); + in + nameValuePair "shortcut-switch-to-tab-${num}" [ "<Control>${num}" ] + ) 9 + )); } { package = pano; @@ -524,39 +523,38 @@ let ); in { - dconf.settings = - { - "org/gnome/shell" = - let - list = - enabled: - map (ext: ext.package.extensionUuid) ( - filter (ext: if enabled then (!(ext.disable or false)) else (ext.disable or false)) extensions - ); - in - { - disable-user-extensions = false; - disable-extension-version-validation = true; - disabled-extensions = list false; - enabled-extensions = list true; - }; - } - // foldr recursiveUpdate { } ( - map ( - ext: - if (hasAttr "settings" ext) then - ( - if (hasAttr "path" ext) then - { "${ext.path}" = ext.settings; } - else if (hasAttr "name" ext) then - { "org/gnome/shell/extensions/${ext.name}" = ext.settings; } - else - { "org/gnome/shell/extensions/${ext.package.extensionPortalSlug}" = ext.settings; } - ) - else - { } - ) extensions - ); + dconf.settings = { + "org/gnome/shell" = + let + list = + enabled: + map (ext: ext.package.extensionUuid) ( + filter (ext: if enabled then (!(ext.disable or false)) else (ext.disable or false)) extensions + ); + in + { + disable-user-extensions = false; + disable-extension-version-validation = true; + disabled-extensions = list false; + enabled-extensions = list true; + }; + } + // foldr recursiveUpdate { } ( + map ( + ext: + if (hasAttr "settings" ext) then + ( + if (hasAttr "path" ext) then + { "${ext.path}" = ext.settings; } + else if (hasAttr "name" ext) then + { "org/gnome/shell/extensions/${ext.name}" = ext.settings; } + else + { "org/gnome/shell/extensions/${ext.package.extensionPortalSlug}" = ext.settings; } + ) + else + { } + ) extensions + ); home = { packages = [ pkgs.dconf2nix ] ++ builtins.map (ext: ext.package) extensions; diff --git a/modules/gui/desktop/hyprland/apps/files.nix b/modules/gui/desktop/hyprland/apps/files.nix @@ -21,14 +21,15 @@ in { ## File Manager Configuration services.dbus.packages = [ nemo ]; - environment.systemPackages = - [ nemo ] - ++ (with pkgs; [ - cinnamon-desktop - bulky - file-roller - lxqt.pcmanfm-qt - ]); + environment.systemPackages = [ + nemo + ] + ++ (with pkgs; [ + cinnamon-desktop + bulky + file-roller + lxqt.pcmanfm-qt + ]); user = { persist.directories = [ diff --git a/modules/gui/desktop/hyprland/apps/notify.nix b/modules/gui/desktop/hyprland/apps/notify.nix @@ -66,14 +66,17 @@ in fullscreen_delay.fullscreen = "delay"; screenshot = { appname = "grimblast"; - } // system; + } + // system; utility = { appname = "utility"; - } // system; + } + // system; upower = { appname = "poweralertd"; new_icon = "/run/current-system/sw/share/icons/${icons.name}/24x24/apps/preferences-system-power.svg"; - } // system; + } + // system; }; }; }; diff --git a/modules/gui/desktop/hyprland/apps/settings.nix b/modules/gui/desktop/hyprland/apps/settings.nix @@ -57,23 +57,22 @@ in ]; ## Autostart - exec-once = - [ - "uwsm finalize" - "hyprctl setcursor ${cursor} ${toString cursors.size}" - ] - ++ (map (app: "uwsm app -t service -u ${util.build.until " " app}.service -- " + app) [ - "hyprutils daemon" - - # Pyprland - "pypr" - - # Application Drawer - "nwg-drawer -r" - - # Desktop Icons - "pcmanfm-qt --desktop" - ]); + exec-once = [ + "uwsm finalize" + "hyprctl setcursor ${cursor} ${toString cursors.size}" + ] + ++ (map (app: "uwsm app -t service -u ${util.build.until " " app}.service -- " + app) [ + "hyprutils daemon" + + # Pyprland + "pypr" + + # Application Drawer + "nwg-drawer -r" + + # Desktop Icons + "pcmanfm-qt --desktop" + ]); ## Shortcuts bind = diff --git a/modules/gui/desktop/hyprland/apps/utilities.nix b/modules/gui/desktop/hyprland/apps/utilities.nix @@ -46,20 +46,18 @@ in # Network Settings (gnome-control-center.overrideAttrs (old: { - postInstall = - old.postInstall - + '' - dir=$out/share/applications - for panel in $dir/* - do - [ "$panel" = "$dir/gnome-network-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-wifi-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-wwan-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-sharing-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-wacom-panel.desktop" ] && continue - rm "$panel" - done - ''; + postInstall = old.postInstall + '' + dir=$out/share/applications + for panel in $dir/* + do + [ "$panel" = "$dir/gnome-network-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-wifi-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-wwan-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-sharing-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-wacom-panel.desktop" ] && continue + rm "$panel" + done + ''; })) ]; diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -8,84 +8,83 @@ in ## Keybindings settings = { "$mod" = "SUPER"; - bind = - [ - # Compositor Commands - "ALT, F4, killactive," - "$mod, Q, killactive," - "$mod SHIFT, Q, forcekillactive," - "$mod SHIFT, E, fullscreen," - "$mod, C, centerwindow" - "$mod, C, movecursortocorner, 2" - "$mod, E, fullscreen, 1" - "$mod, P, pin" - "$mod, Space, togglesplit" - "$mod SHIFT, S, toggleswallow" - - # Window Focus - "$mod, left, movefocus, l" - "$mod, right, movefocus, r" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" - "ALT, A, focusurgentorlast" - "ALT, A, alterzorder, top" - - # Window Swap - "$mod SHIFT, left, swapwindow, l" - "$mod SHIFT, right, swapwindow, r" - "$mod SHIFT, up, swapwindow, u" - "$mod SHIFT, down, swapwindow, d" - - # Window Groups - "$mod SHIFT, space, togglegroup" - "ALT, grave, changegroupactive, f" - "ALT SHIFT, grave, changegroupactive, b" - "$mod CTRL, left, moveintogroup, l" - "$mod CTRL, right, moveintogroup, r" - "$mod CTRL, up, moveintogroup, u" - "$mod CTRL, down, moveintogroup, d" - - # Floating Mode - "$mod, semicolon, togglefloating," - "$mod, apostrophe, exec, hyprutils toggle float" - - # Cycle Workspaces - "$mod, comma, split:workspace, m-1" - "$mod, period, split:workspace, m+1" - "$mod CTRL, comma, split:workspace, r-1" - "$mod CTRL, period, split:workspace, r+1" - "$mod, mouse_up, split:workspace, r-1" - "$mod, mouse_down, split:workspace, r+1" - - # Special Workspace - "$mod, 0, togglespecialworkspace, Stash" - "$mod SHIFT, 0, exec, pypr toggle_special Stash" - - # Move Window to Workspace - "$mod SHIFT, comma, split:movetoworkspace, r-1" - "$mod SHIFT, period, split:movetoworkspace, r+1" - - # Cycle Monitors - "$mod ALT, comma, focusmonitor, l" - "$mod ALT, period, focusmonitor, r" - - # Move Window to Monitor - "$mod SHIFT ALT, comma, movewindow, mon:-1" - "$mod SHIFT ALT, period, movewindow, mon:+1" - - # Screen Lock - "$mod, L, exec, loginctl lock-session" - - # Window Minimization - "ALT, Q, movetoworkspacesilent, special:minimized" - "ALT SHIFT, Q, exec, hyprutils toggle minimized" - - # Screenshot - '', Print, exec, sh -c "pgrep slurp || grimblast --notify --freeze copysave area"'' - "CTRL, Print, exec, grimblast --notify --cursor copysave active" - "SHIFT, Print, exec, grimblast --notify --cursor copysave output" - ] - ++ + bind = [ + # Compositor Commands + "ALT, F4, killactive," + "$mod, Q, killactive," + "$mod SHIFT, Q, forcekillactive," + "$mod SHIFT, E, fullscreen," + "$mod, C, centerwindow" + "$mod, C, movecursortocorner, 2" + "$mod, E, fullscreen, 1" + "$mod, P, pin" + "$mod, Space, togglesplit" + "$mod SHIFT, S, toggleswallow" + + # Window Focus + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + "ALT, A, focusurgentorlast" + "ALT, A, alterzorder, top" + + # Window Swap + "$mod SHIFT, left, swapwindow, l" + "$mod SHIFT, right, swapwindow, r" + "$mod SHIFT, up, swapwindow, u" + "$mod SHIFT, down, swapwindow, d" + + # Window Groups + "$mod SHIFT, space, togglegroup" + "ALT, grave, changegroupactive, f" + "ALT SHIFT, grave, changegroupactive, b" + "$mod CTRL, left, moveintogroup, l" + "$mod CTRL, right, moveintogroup, r" + "$mod CTRL, up, moveintogroup, u" + "$mod CTRL, down, moveintogroup, d" + + # Floating Mode + "$mod, semicolon, togglefloating," + "$mod, apostrophe, exec, hyprutils toggle float" + + # Cycle Workspaces + "$mod, comma, split:workspace, m-1" + "$mod, period, split:workspace, m+1" + "$mod CTRL, comma, split:workspace, r-1" + "$mod CTRL, period, split:workspace, r+1" + "$mod, mouse_up, split:workspace, r-1" + "$mod, mouse_down, split:workspace, r+1" + + # Special Workspace + "$mod, 0, togglespecialworkspace, Stash" + "$mod SHIFT, 0, exec, pypr toggle_special Stash" + + # Move Window to Workspace + "$mod SHIFT, comma, split:movetoworkspace, r-1" + "$mod SHIFT, period, split:movetoworkspace, r+1" + + # Cycle Monitors + "$mod ALT, comma, focusmonitor, l" + "$mod ALT, period, focusmonitor, r" + + # Move Window to Monitor + "$mod SHIFT ALT, comma, movewindow, mon:-1" + "$mod SHIFT ALT, period, movewindow, mon:+1" + + # Screen Lock + "$mod, L, exec, loginctl lock-session" + + # Window Minimization + "ALT, Q, movetoworkspacesilent, special:minimized" + "ALT SHIFT, Q, exec, hyprutils toggle minimized" + + # Screenshot + '', Print, exec, sh -c "pgrep slurp || grimblast --notify --freeze copysave area"'' + "CTRL, Print, exec, grimblast --notify --cursor copysave active" + "SHIFT, Print, exec, grimblast --notify --cursor copysave output" + ] + ++ # Workspaces (concatLists ( genList ( diff --git a/modules/gui/theme.nix b/modules/gui/theme.nix @@ -67,12 +67,13 @@ in ## Application Theming ## config = rec { - environment.systemPackages = - [ stylix.cursor.package ] - ++ optionals enable [ - cfg.icons.package - cfg.cursors.package - ]; + environment.systemPackages = [ + stylix.cursor.package + ] + ++ optionals enable [ + cfg.icons.package + cfg.cursors.package + ]; stylix = { inherit enable; diff --git a/modules/hardware/boot.nix b/modules/hardware/boot.nix @@ -35,83 +35,82 @@ in }; ## Boot Configuration ## - config = + config = { + warnings = optional (loader == null) (options.hardware.boot.description + " is unset"); + } + // mkIf (loader != null) (mkMerge [ { - warnings = optional (loader == null) (options.hardware.boot.description + " is unset"); - } - // mkIf (loader != null) (mkMerge [ - { - boot = { - tmp.cleanOnBoot = true; + boot = { + tmp.cleanOnBoot = true; - # Plymouth - consoleLogLevel = 3; - initrd.verbose = false; - plymouth.enable = true; - kernelParams = [ - "quiet" - "splash" - "boot.shell_on_fail" - "i915.fastboot=1" - "rd.systemd.show_status=false" - "rd.udev.log_level=3" - "udev.log_priority=3" - ]; + # Plymouth + consoleLogLevel = 3; + initrd.verbose = false; + plymouth.enable = true; + kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "i915.fastboot=1" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; - # Boot Loader - loader = { - timeout = mkDefault 0; - efi.canTouchEfiVariables = true; + # Boot Loader + loader = { + timeout = mkDefault 0; + efi.canTouchEfiVariables = true; - grub.enable = mkDefault false; - systemd-boot.enable = mkDefault false; - }; + grub.enable = mkDefault false; + systemd-boot.enable = mkDefault false; }; + }; - # Debug - specialisation.recovery.configuration = { - system.nixos.label = "special.recovery"; - boot = { - initrd.verbose = mkForce true; - plymouth.enable = mkForce false; - }; + # Debug + specialisation.recovery.configuration = { + system.nixos.label = "special.recovery"; + boot = { + initrd.verbose = mkForce true; + plymouth.enable = mkForce false; }; - } + }; + } - ## GRUB MBR Boot Loader ## - (mkIf (loader == "mbr") { - boot.loader.grub = { - enable = mkForce true; - device = "nodev"; - efiSupport = true; - zfsSupport = true; - useOSProber = true; - splashImage = null; - extraConfig = "set timeout_style=hidden"; - }; - }) + ## GRUB MBR Boot Loader ## + (mkIf (loader == "mbr") { + boot.loader.grub = { + enable = mkForce true; + device = "nodev"; + efiSupport = true; + zfsSupport = true; + useOSProber = true; + splashImage = null; + extraConfig = "set timeout_style=hidden"; + }; + }) - ## SystemD EFI Boot Loader ## - (mkIf (loader == "efi") { - boot.loader.systemd-boot = { - enable = mkForce true; - editor = false; - configurationLimit = 15; - }; - }) + ## SystemD EFI Boot Loader ## + (mkIf (loader == "efi") { + boot.loader.systemd-boot = { + enable = mkForce true; + editor = false; + configurationLimit = 15; + }; + }) - ## EFI Secure Boot ## - (mkIf (loader == "secure") rec { - boot.lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - configurationLimit = 15; - }; + ## EFI Secure Boot ## + (mkIf (loader == "secure") rec { + boot.lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + configurationLimit = 15; + }; - environment = { - systemPackages = [ pkgs.sbctl ]; - persist.directories = [ boot.lanzaboote.pkiBundle ]; - }; - }) - ]); + environment = { + systemPackages = [ pkgs.sbctl ]; + persist.directories = [ boot.lanzaboote.pkiBundle ]; + }; + }) + ]); } diff --git a/modules/hardware/filesystem.nix b/modules/hardware/filesystem.nix @@ -26,12 +26,13 @@ let inherit (config.hardware.fs) scheme; in { - imports = - [ inputs.impermanence.nixosModule ] - ++ [ - (mkAliasOptionModule [ "environment" "persist" ] [ "environment" "persistence" files.path.persist ]) - (mkAliasOptionModule [ "hardware" "fs" "persist" ] [ "environment" "persistence" "/data" ]) - ]; + imports = [ + inputs.impermanence.nixosModule + ] + ++ [ + (mkAliasOptionModule [ "environment" "persist" ] [ "environment" "persistence" files.path.persist ]) + (mkAliasOptionModule [ "hardware" "fs" "persist" ] [ "environment" "persistence" "/data" ]) + ]; options = with types; { hardware.fs.scheme = mkOption { @@ -117,34 +118,33 @@ in ''; in { - fileSystems = - { - # ROOT Partition - "/" = { - device = "fspool/system/root"; - fsType = "zfs"; - }; + fileSystems = { + # ROOT Partition + "/" = { + device = "fspool/system/root"; + fsType = "zfs"; + }; - # NIX Partition - "/nix" = { - device = "fspool/system/nix"; - fsType = "zfs"; - }; + # NIX Partition + "/nix" = { + device = "fspool/system/nix"; + fsType = "zfs"; + }; - # PERSISTENT Partition - "/data" = { - device = "fspool/data"; - fsType = "zfs"; - neededForBoot = true; - }; - } - // filterAttrs (name: _: hasPrefix "/etc" name) ( - listToAttrs ( - map ( - item: nameValuePair item.directory { neededForBoot = true; } - ) config.environment.persist.directories - ) - ); + # PERSISTENT Partition + "/data" = { + device = "fspool/data"; + fsType = "zfs"; + neededForBoot = true; + }; + } + // filterAttrs (name: _: hasPrefix "/etc" name) ( + listToAttrs ( + map ( + item: nameValuePair item.directory { neededForBoot = true; } + ) config.environment.persist.directories + ) + ); # Boot Settings boot = { @@ -210,7 +210,8 @@ in directory = ".local/share/keyrings"; mode = "0700"; } - ] ++ config.user.persist.directories; + ] + ++ config.user.persist.directories; }) config.user.settings; }; }; diff --git a/packages/overlays/chrome.nix b/packages/overlays/chrome.nix @@ -1,12 +1,10 @@ final: prev: { # Google Chrome Flags google-chrome = prev.google-chrome.overrideAttrs (old: { - installPhase = - old.installPhase - + '' - fix=" --enable-features=TouchpadOverscrollHistoryNavigation --gtk-version=4" - substituteInPlace $out/share/applications/google-chrome.desktop \ - --replace $exe "$exe$fix" - ''; + installPhase = old.installPhase + '' + fix=" --enable-features=TouchpadOverscrollHistoryNavigation --gtk-version=4" + substituteInPlace $out/share/applications/google-chrome.desktop \ + --replace $exe "$exe$fix" + ''; }); } diff --git a/scripts/README.md b/scripts/README.md @@ -1,32 +1,7 @@ ### Scripts -The `scripts` directory contains a combination of custom Bash Scripts (with `nix` shebangs, and can be run using <code><i>./path/to/script</i></code>) as well as ones written in conjunction with the Nix Syntax (which can be accessed by `github:maydayv7/dotfiles#apps.${system}`) -A system management script is present, invoked with the command [`nixos`](./nixos.nix), which can be used to apply user and device configuration changes, setup the device on first boot, and perform various other useful functions (If you have a working NixOS install, you can check it out using `nix run github:maydayv7/dotfiles`) - -```shellsession -$ nixos -h -## Tool for NixOS System Management ## -# Legend # - xxx - Command - [ ] - Optional - Command Description - ' ' - Variable +The `scripts` directory contains a combination of custom Bash Scripts (with `nix` shebangs, and can be run using <code><i>./path/to/script</i></code>) as well as ones written in conjunction with the Nix Syntax (which can be accessed by `github:maydayv7/dotfiles#apps.${system}`) -# Usage # - apply [ --'option' ] - Applies Device and User Configuration - cache 'command' - Pushes Binary Cache Output to Cachix - check [ --trace ] - Checks System Configuration [ Displays Error to Trace ] - clean [ --all ] - Garbage Collects and Optimises Nix Store - explore - Opens Interactive Shell to explore Syntax and Configuration - iso 'variant' [ --burn ] - Builds Image for Specified Install Media or Device [ Burns '.iso' to USB ] - list [ 'pattern' ] - Lists all Installed Packages [ Returns Matches ] - locate 'package' - Locates Installed Package - run [ 'path' ] 'command' - Runs Specified Command [ from 'path' ] (Wraps 'nix run') - save - Saves Configuration State to Repository - search 'term' [ 'source' ] - Searches for Packages [ Providing 'term' ] or Configuration Options - secret 'choice' [ 'path' ] - Manages 'sops' Encrypted Secrets - setup - Sets up NixOS System (on First Boot) - shell [ 'name' ] - Opens desired Nix Developer Shell - update [ 'repo' / --'option' ] - Manages System Package Updates -``` +A system management script is present, invoked with the command [`nixos`](./nixos.nix), which can be used to apply user and device configuration changes, setup the device on first boot, and perform various other useful functions (If you have a working NixOS install, you can check it out using `nix run github:maydayv7/dotfiles`) There is also a system install script, invoked with the command [`os-install`](./install.nix), that painlessly installs the OS diff --git a/scripts/nixos.nix b/scripts/nixos.nix @@ -34,7 +34,6 @@ let list [ 'pattern' ] - Lists all Installed Packages [ Returns Matches ] locate 'package' - Locates Installed Package run [ 'path' ] 'command' - Runs Specified Command [ from 'path' ] (Wraps 'nix run') - save - Saves Configuration State to Repository search 'term' [ 'source' ] - Searches for Packages [ Providing 'term' ] or Configuration Options secret 'choice' [ 'path' ] - Manages 'sops' Encrypted Secrets setup - Sets up NixOS System (on First Boot) @@ -261,7 +260,7 @@ recursiveUpdate if grep -wq "$2" <<<"${nixosConfigurations}" &> /dev/null then echo "Building '$2' Image..." - nix build ${path.system}#nixosConfigurations."$2".config.system.build.images.iso + nom build ${path.system}#nixosConfigurations."$2".config.system.build.images.iso else error "Unknown Device '$2'" "# Available Devices #\n ${nixosConfigurations}" fi @@ -339,26 +338,13 @@ recursiveUpdate ;; "run") export NIXPKGS_ALLOW_UNFREE=1 - if [[ "$2" == *[:/]* ]] || grep -wq "$2" <<<"${list inputs + "nixpkgs"}" + if [[ "$2" == *[:/]* ]] || grep -wq "$2" <<<"${list inputs}" then nix run "$2"#"$3" --impure -- "''${@:4}" else nix run ${path.system}#"$2" --impure -- "''${@:3}" fi ;; - "save") - echo "Saving Changes..." - pushd ${path.system} &> /dev/null - git stash - git pull --rebase - git branch save - git checkout save - git stash pop - git add . - git commit - git push --set-upstream origin save --force - popd &> /dev/null - ;; "search") case $2 in "") error "Expected an Option" "${usage.search}";; diff --git a/shells/default.nix b/shells/default.nix @@ -5,19 +5,18 @@ with pkgs; mkShell { name = "devShell"; - packages = - [ - git - gnupg - jq - nixFlakes - sops - treefmt - ] - ++ [ - figlet - fastfetch - ]; + packages = [ + git + gnupg + jq + nixFlakes + sops + treefmt + ] + ++ [ + figlet + fastfetch + ]; shellHook = '' echo -e "\e[36m## Default Developer Shell ##"