diff --git a/configuration.nix b/configuration.nix index 157855f..0a85dee 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,25 +1,24 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: - -let - pkg_with_working_nitrogen = import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/c0c50dfcb70d48e5b79c4ae9f1aa9d339af860b4.tar.gz"; - sha256 = "17p3w4mgfr4yj2p0jz6kqgzhyr04h4fap5hnd837664xd1xhwdjb"; - }) { inherit (pkgs) system; }; - - old-nitrogen = pkg_with_working_nitrogen.nitrogen; -in - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ./system/system.nix - # inputs.home-manager.nixosModules.default - ]; + config, + pkgs, + ... +}: let + pkg_with_working_nitrogen = import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/c0c50dfcb70d48e5b79c4ae9f1aa9d339af860b4.tar.gz"; + sha256 = "17p3w4mgfr4yj2p0jz6kqgzhyr04h4fap5hnd837664xd1xhwdjb"; + }) {inherit (pkgs) system;}; + + old-nitrogen = pkg_with_working_nitrogen.nitrogen; +in { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ./system/system.nix + # inputs.home-manager.nixosModules.default + ]; # Bootloader. boot.loader.grub.enable = true; @@ -29,7 +28,7 @@ in networking.hostName = "thonkpad"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; nix = { nixPath = [ @@ -89,10 +88,9 @@ in # Define a user account. Don't forget to set a password with ‘passwd’. users.users.synchronous = { - isNormalUser = true; description = "jake"; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = ["networkmanager" "wheel"]; packages = with pkgs; [ kdePackages.kate firefox @@ -113,8 +111,10 @@ in librewolf eza flameshot - neofetch lolcat - nnn xclip + neofetch + lolcat + nnn + xclip brightnessctl xbindkeys pulseaudio @@ -123,10 +123,8 @@ in alejandra # procps # for pgrep # xorg.xrandr - # thunderbird + # thunderbird ]; - - }; # Install firefox. @@ -138,21 +136,21 @@ in # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - vim - neovim - linux-manual - man-pages - man-pages-posix - fontconfig - python3 - rofi - flameshot - tree - # nitrogen - polybar - sxhkd - bspwm - librewolf + vim + neovim + linux-manual + man-pages + man-pages-posix + fontconfig + python3 + rofi + flameshot + tree + # nitrogen + polybar + sxhkd + bspwm + librewolf ]; # Some programs need SUID wrappers, can be configured further or are @@ -181,5 +179,4 @@ in # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "24.11"; # Did you read the comment? - } diff --git a/flake.nix b/flake.nix index 59b7dd6..31d22cc 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ }; }; - outputs = inputs @ { + outputs = inputs @ { flake-parts, self, ... @@ -46,7 +46,7 @@ # The usual flake attributes can be defined here, including system- # agnostic ones like nixosModule and system-enumerating ones, although # those are more easily expressed in perSystem. - # nixosConfigurations.myhostname = "thonkpad"; + # nixosConfigurations.myhostname = "thonkpad"; nixosConfigurations.thonkpad = inputs.nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; pkgs = import inputs.nixpkgs { @@ -61,8 +61,8 @@ overlays = [ # inputs.emacs-overlay.overlay -- breaks doom on 30.?? ]; - - home.packages = with pkgs; [ xrandr procps bspwm sxhkd ]; + + home.packages = with pkgs; [xrandr procps bspwm sxhkd]; }; specialArgs = {inherit inputs;}; # extraSpecialArgs = {inherit inputs;}; @@ -87,15 +87,15 @@ }; }; - # outputs = { self, nixpkgs, ... }@inputs: { - # nixosConfigurations.default = nixpkgs.lib.nixosSystem { - # specialArgs = {inherit inputs;}; - # modules = [ - # ./configuration.nix - # # inputs.home-manager.nixosModules.default - # { home-manager.users.synch = import ./home.nix; } - # ]; - # }; - # }; - }; + # outputs = { self, nixpkgs, ... }@inputs: { + # nixosConfigurations.default = nixpkgs.lib.nixosSystem { + # specialArgs = {inherit inputs;}; + # modules = [ + # ./configuration.nix + # # inputs.home-manager.nixosModules.default + # { home-manager.users.synch = import ./home.nix; } + # ]; + # }; + # }; + }; } diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 5e27a3f..afc3905 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -1,24 +1,28 @@ # 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") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/05ca9d56-3506-43c5-b9ec-be928b782996"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/05ca9d56-3506-43c5-b9ec-be928b782996"; + fsType = "ext4"; + }; - swapDevices = [ ]; + 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 diff --git a/home/programs/zsh/default.nix b/home/programs/zsh/default.nix index 905d8d6..94895be 100644 --- a/home/programs/zsh/default.nix +++ b/home/programs/zsh/default.nix @@ -1,6 +1,7 @@ { pkgs, lib, + system, ... }: { home.packages = with pkgs; [zsh-powerlevel10k meslo-lgs-nf]; diff --git a/home/programs/zsh/zshrc b/home/programs/zsh/zshrc index db44859..6c63985 100644 --- a/home/programs/zsh/zshrc +++ b/home/programs/zsh/zshrc @@ -223,8 +223,9 @@ export LESS_TERMCAP_us=$'\e[1;4;31m' # ------ NNN (not no not november) export PATH=/home/synchronous/.scripts/nnn:$PATH -export VISUAL=wrapper.sh -export EDITOR="$VISUAL" +# export VISUAL=wrapper.sh +# export EDITOR="$VISUAL" +export EDITOR="nvim" export NNN_PLUG='m:preview-tui;' export NNN_FIFO=/tmp/nnn.fifo export NNN_TERMINAL=alacritty diff --git a/home/scripts/nixos-rebuild.sh b/home/scripts/nixos-rebuild.sh index 8dae3d2..40ad651 100644 --- a/home/scripts/nixos-rebuild.sh +++ b/home/scripts/nixos-rebuild.sh @@ -4,13 +4,13 @@ set -e # Edit your config -$EDITOR configuration.nix +# $EDITOR configuration.nix # cd to your config dir -pushd ~/dotfiles/nixos/ +pushd /home/synchronous/nix-cfg # Early return if no changes were detected (thanks @singiamtel!) -if git diff --quiet '*.nix'; then +if git --git-dir /home/synchronous/nix-cfg/.git diff --quiet '*.nix'; then echo "No changes detected, exiting." popd exit 0 @@ -21,18 +21,19 @@ alejandra . &>/dev/null \ || ( alejandra . ; echo "formatting failed!" && exit 1) # Shows your changes -git diff -U0 '*.nix' +git --git-dir /home/synchronous/nix-cfg/.git diff +# -U0 '*.nix' echo "NixOS Rebuilding..." # Rebuild, output simplified errors, log trackebacks -sudo nixos-rebuild switch &>nixos-switch.log || (cat nixos-switch.log | grep --color error && exit 1) +sudo nixos-rebuild switch --flake /home/synchronous/nix-cfg/flake.nix &>nixos-switch.log || (cat nixos-switch.log | grep --color error && exit 1) # Get current generation metadata current=$(nixos-rebuild list-generations | grep current) # Commit all changes witih the generation metadata -git commit -am "$current" +git --git-dir /home/synchronous/nix-cfg/.git commit -am "$current" # Back to where you were popd diff --git a/system/services/services.nix b/system/services/services.nix index 415bf5d..380f6f4 100644 --- a/system/services/services.nix +++ b/system/services/services.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { imports = [ ./synaptics/default.nix ]; diff --git a/system/services/synaptics/default.nix b/system/services/synaptics/default.nix index a2e5533..892f9b9 100644 --- a/system/services/synaptics/default.nix +++ b/system/services/synaptics/default.nix @@ -1,4 +1,8 @@ -{ config, pkgs, ... }: { +{ + config, + pkgs, + ... +}: { services.libinput = { enable = false; touchpad.naturalScrolling = true; @@ -21,13 +25,13 @@ palmMinWidth = 5; minSpeed = "0.6"; maxSpeed = "1.0"; - + additionalOptions = '' -Option "VertScrollDelta" "-111" -Option "HorizScrollDelta" "-111" -Option "FingerLow" "25" -Option "FingerHigh" "30" -Option "MaxTapTime" "0" + Option "VertScrollDelta" "-111" + Option "HorizScrollDelta" "-111" + Option "FingerLow" "25" + Option "FingerHigh" "30" + Option "MaxTapTime" "0" ''; }; } diff --git a/system/system.nix b/system/system.nix index 6d93ba7..b8fba01 100644 --- a/system/system.nix +++ b/system/system.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ...}: - { + config, + pkgs, + ... +}: { imports = [ ./wm/bspwm.nix ./services/services.nix diff --git a/system/wm/bspwm.nix b/system/wm/bspwm.nix index 3df9034..a6ed4a6 100644 --- a/system/wm/bspwm.nix +++ b/system/wm/bspwm.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { services.xserver = { enable = true; xkb.layout = "us"; @@ -11,7 +13,7 @@ windowManager.bspwm = { enable = true; - # extraConfig = builtins.readFile ./bspwmrc; + # extraConfig = builtins.readFile ./bspwmrc; # configFile = ./bspwmrc; # relative import to preserve locality of config # package = "bspwm-unstable"; # sxhkd.package = "sxhkd-unstable"; @@ -27,7 +29,6 @@ greeters.gtk.enable = true; }; }; - }; # xsession.windowManager.bspwm = { @@ -43,7 +44,7 @@ # services.displayManagrer.sddm.enable = true; # services.desktopManager.plasma6.enable = true; - # services.xserver.xkb = { + # services.xserver.xkb = { # layout = "us"; # variant = ""; # }