diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 831eeee..d7f7bf1 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -8,7 +8,7 @@ ... }: { imports = [ - ./../../modules/sys + ./../../modules/sys/configuration.nix ./hardware.nix ./boot.nix ./services.nix diff --git a/hosts/laptop/environment.nix b/hosts/laptop/environment.nix index f467e1d..aca3a1b 100644 --- a/hosts/laptop/environment.nix +++ b/hosts/laptop/environment.nix @@ -1,7 +1,6 @@ {pkgs, ...}: { environment = { variables = { - XCURSOR_SIZE = "24"; PATH = "${pkgs.clang-tools}/bin:$PATH"; }; shells = with pkgs; [ diff --git a/hosts/laptop/hardware.nix.old b/hosts/laptop/hardware.nix.old new file mode 100644 index 0000000..1c21635 --- /dev/null +++ b/hosts/laptop/hardware.nix.old @@ -0,0 +1,53 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-partlabel/disk-main-root"; + fsType = "ext4"; + }; + + fileSystems."/nix" = { + device = "/dev/disk/by-partlabel/disk-main-nix"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-partlabel/disk-main-ESP"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-partlabel/disk-main-home"; + fsType = "ext4"; + }; + + swapDevices = []; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp14s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/home/scripts/default.nix b/modules/home/scripts/default.nix index 8294126..57eb091 100644 --- a/modules/home/scripts/default.nix +++ b/modules/home/scripts/default.nix @@ -44,26 +44,10 @@ self = self; pkgs = pkgs; }; - homep = import ./nix/homep.nix { - self = self; - pkgs = pkgs; - }; - homer = import ./nix/homer.nix { - self = self; - pkgs = pkgs; - }; nsp = import ./nix/nsp.nix { self = self; pkgs = pkgs; }; - nixr = import ./nix/nixr.nix { - self = self; - pkgs = pkgs; - }; - nixp = import ./nix/nixp.nix { - self = self; - pkgs = pkgs; - }; hyprland = import ./wm-controls/hyprland.nix {pkgs = pkgs;}; lofi = import ./wm-controls/lofi.nix { self = self; @@ -105,15 +89,6 @@ chscheme = import ./nix/chscheme.nix { pkgs = pkgs; }; - nixcommit = import ./nix/nixcommit.nix { - host = host; - self = self; - pkgs = pkgs; - }; - nixpush = import ./nix/nixpush.nix { - self = self; - pkgs = pkgs; - }; in { home.packages = [ compress @@ -122,17 +97,11 @@ in { crs extract garbage-collect - homep - homer hyprland invoke lofi mcd music - nixcommit - nixp - nixpush - nixr rebuild nsp runbg diff --git a/modules/home/scripts/nix/homep.nix b/modules/home/scripts/nix/homep.nix deleted file mode 100644 index bdd0fb9..0000000 --- a/modules/home/scripts/nix/homep.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - self, - pkgs, -}: -pkgs.writeShellScriptBin "homep" '' - #!/run/current-system/sw/bin/bash - - # Ensure the package manifest is generated or updated - if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then - echo "Generating Nixpkgs manifest..." - nix-env -qaP 2>/dev/null | awk '{print $1}' | sed 's/nixos\.//' > /tmp/nixpkgs_manifest.txt - fi - - # Select packages using fzf with multi-select enabled - selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m) - - # Check if any packages were selected - if [ -n "$selected_packages" ]; then - echo "$selected_packages" | while read -r package; do - # Append each selected package to the Nix config file - sed -i "/^\t]/i \ \t\t$package" "${self}/modules/home/userpkgs.nix" - echo "Added $package to the Home Manager configuration." - done - - echo "Packages added successfully. Rebuild system config?" - select yn in "Yes" "No"; do - case $yn in - "Yes" ) nixswitch;break;; - "No" ) exit;; - esac - done - - else - echo "No packages selected." - fi -'' diff --git a/modules/home/scripts/nix/homer.nix b/modules/home/scripts/nix/homer.nix deleted file mode 100644 index 95edebc..0000000 --- a/modules/home/scripts/nix/homer.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - self, - pkgs, -}: -pkgs.writeShellScriptBin "homer" '' - #!/run/current-system/sw/bin/bash - - selected_packages=$(sed -n '/\[/,/\]/p' "${self}/modules/home/userpkgs.nix" | sed '1d;$d' | fzf -m) - - if [ -n "$selected_packages" ]; then - echo "$selected_packages" | while read -r package; do - sed -i "/\b$package\b/d" "${self}/modules/home/userpkgs.nix" - echo "Removed $package from the Home Manager configuration." - done - - echo "Removed packages. Rebuild system config?" - select yn in "Yes" "No"; do - case $yn in - "Yes" ) nixswitch;break;; - "No" ) exit;; - esac - done - - else - echo "No packages removed." - fi - - - -'' diff --git a/modules/home/scripts/nix/nixcommit.nix b/modules/home/scripts/nix/nixcommit.nix deleted file mode 100644 index 98f2e0b..0000000 --- a/modules/home/scripts/nix/nixcommit.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - self, - pkgs, - host, -}: -pkgs.writeShellScriptBin "nixcommit" '' - #!/run/current-system/sw/bin/bash - - scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav - pushd "${self}" || exit - - if [ -n "$2" ]; then - echo "too many arguments" - exit - fi - - diffcheck=$(git status | grep "working tree clean") - if [ -n "$diffcheck" ]; then - scheck && runbg aplay ${self}/media/sound/warning.wav - echo "Nothing to commit" - exit - fi - - alejandra . &> /dev/null - git add . - - # Automatic fixup commit to the most recent commit (HEAD~1) - if [ -z "$1" ]; then - commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline) - if [ -n "$commits" ]; then - git commit --fixup HEAD - echo "No commit message given" - echo "Squashing into most recent commit" - git rebase --autosquash master - else - echo "No prior local commits to squash into, please provide a commit message" - exit - fi - else - # Generate the system generation number - gen=$(readlink /nix/var/nix/profiles/system | sed 's/.*system-\([0-9]*\)-link/\1/') - gen=$((gen + 1)) - git commit -m "(${host}) Gen $gen: $1" - fi - - scheck && runbg aplay ${self}/media/sound/gitcommit.wav - popd || exit -'' diff --git a/modules/home/scripts/nix/nixp.nix b/modules/home/scripts/nix/nixp.nix deleted file mode 100644 index 54e854a..0000000 --- a/modules/home/scripts/nix/nixp.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - self, - pkgs, -}: -pkgs.writeShellScriptBin "nixp" '' - #!/run/current-system/sw/bin/bash - - # Ensure the package manifest is generated or updated - if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then - echo "Generating Nixpkgs manifest..." - nix-env -qaP 2>/dev/null | awk '{print $1}' | sed 's/nixos\.//' > /tmp/nixpkgs_manifest.txt - fi - - # Select packages using fzf with multi-select enabled - selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m) - - # Check if any packages were selected - if [ -n "$selected_packages" ]; then - echo "$selected_packages" | while read -r package; do - # Append each selected package to the Nix config file - sed -i "/^\t]/i \ \t\t$package" "${self}/modules/sys/packages.nix" - echo "Added $package to the Nix configuration." - done - - echo "Packages added successfully. Rebuild system config?" - select yn in "Yes" "No"; do - case $yn in - "Yes" ) nixswitch;break;; - "No" ) exit;; - esac - done - - else - echo "No packages selected." - fi -'' diff --git a/modules/home/scripts/nix/nixpush.nix b/modules/home/scripts/nix/nixpush.nix deleted file mode 100644 index 63d0a68..0000000 --- a/modules/home/scripts/nix/nixpush.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - self, - pkgs, -}: -pkgs.writeShellScriptBin "nixpush" '' - #!/run/current-system/sw/bin/bash - - scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav - set -e - pushd "${self}" - - commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline) - if [ -z "$commits" ]; then - scheck && runbg aplay ${self}/media/sound/warning.wav - echo "Nothing to push" - exit - fi - - echo "Pushing the following commits upstream on branch '$(git branch | rg "\*" | awk '{print $2}')'" - echo "$commits" - - git push - scheck && runbg aplay ${self}/media/sound/gitpush.wav - popd -'' diff --git a/modules/home/scripts/nix/nixr.nix b/modules/home/scripts/nix/nixr.nix deleted file mode 100644 index 50066aa..0000000 --- a/modules/home/scripts/nix/nixr.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - self, - pkgs, -}: -pkgs.writeShellScriptBin "nixr" '' - #!/run/current-system/sw/bin/bash - - selected_packages=$(sed -n '/\[/,/\]/p' "${self}/modules/sys/packages.nix" | sed '1d;$d' | fzf -m) - - if [ -n "$selected_packages" ]; then - echo "$selected_packages" | while read -r package; do - sed -i "/\b$package\b/d" "${self}/modules/sys/packages.nix" - echo "Removed $package from the Nix configuration." - done - - echo "Removed packages. Rebuild system config?" - select yn in "Yes" "No"; do - case $yn in - "Yes" ) nixswitch;break;; - "No" ) exit;; - esac - done - - else - echo "No packages removed." - fi - - - -''