From 217898c182c19b2428a6de99421a0ba5be6569f0 Mon Sep 17 00:00:00 2001 From: Random936 Date: Fri, 17 May 2024 15:22:55 -0700 Subject: [PATCH] Forgot to add these --- dotfiles/README.org | 9 ++ home-manager/.home.nix.~undo-tree~ | 7 ++ home-manager/home.nix | 43 ++++++++++ home-manager/home.nix~ | 41 ++++++++++ nixos/configuration.nix | 127 +++++++++++++++++++++++++++++ nixos/hardware-configuration.nix | 39 +++++++++ 6 files changed, 266 insertions(+) create mode 100644 dotfiles/README.org create mode 100644 home-manager/.home.nix.~undo-tree~ create mode 100644 home-manager/home.nix create mode 100644 home-manager/home.nix~ create mode 100644 nixos/configuration.nix create mode 100644 nixos/hardware-configuration.nix diff --git a/dotfiles/README.org b/dotfiles/README.org new file mode 100644 index 0000000..a8c9c48 --- /dev/null +++ b/dotfiles/README.org @@ -0,0 +1,9 @@ + +* Dotfiles Repo + +To install these dotfiles, you can use gnu stow. Running the following command will automatically create symlinks for every file in this repo. +#+begin_src bash +git clone https://github.com/Random936/dotfiles +cd dotfiles/ +stow . +#+end_src diff --git a/home-manager/.home.nix.~undo-tree~ b/home-manager/.home.nix.~undo-tree~ new file mode 100644 index 0000000..7588cbf --- /dev/null +++ b/home-manager/.home.nix.~undo-tree~ @@ -0,0 +1,7 @@ +(undo-tree-save-format-version . 1) +"7e49e649cf5d5cd0fe98d98d1acb574bc38cf9c4" +[nil nil nil nil (26183 55194 403169 247000) 0 nil] +([nil nil ((179 . 182) (t 26183 55051 535209 541000)) nil (26183 55194 403165 643000) 0 nil]) +([nil nil ((142 . 145) (t 26183 55194 404717 701000)) nil (26183 55225 797886 902000) 0 nil]) +([nil current ((147 . 159) (142 . 147) 112) nil (26183 55225 797884 200000) 0 nil]) +nil diff --git a/home-manager/home.nix b/home-manager/home.nix new file mode 100644 index 0000000..76d1dd8 --- /dev/null +++ b/home-manager/home.nix @@ -0,0 +1,43 @@ +{ inputs, config, pkgs, ... }: { + home = { + username = "random"; + homeDirectory = "/home/random"; + }; + + home.packages = with pkgs; [ + meslo-lgs-nf + ]; + + home.file.".p10k.zsh".source = ../dotfiles/.p10k.zsh; + + programs = { + home-manager.enable = true; + zoxide.enable = true; + eza.enable = true; + fzf.enable = true; + command-not-found.enable = true; + + git = { + enable = true; + userName = "Random936"; + userEmail = "randomdude936@gmail.com"; + }; + + zsh = { + enable = true; + enableCompletion = true; + enableAutosuggestions = true; + syntaxHighlighting.enable = true; + + zplug = { + enable = true; + plugins = [ + { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } + ]; + }; + + }; + }; + + home.stateVersion = "23.05"; +} diff --git a/home-manager/home.nix~ b/home-manager/home.nix~ new file mode 100644 index 0000000..51ccb61 --- /dev/null +++ b/home-manager/home.nix~ @@ -0,0 +1,41 @@ +{ inputs, config, pkgs, ... }: { + home = { + username = "random"; + homeDirectory = "/home/random"; + }; + + home.packages = with pkgs; []; + + home.file.".p10k.zsh".source = dotfiles/.p10k.zsh; + + programs = { + home-manager.enable = true; + zoxide.enable = true; + eza.enable = true; + fzf.enable = true; + command-not-found.enable = true; + + git = { + enable = true; + userName = "Random936"; + userEmail = "randomdude936@gmail.com"; + }; + + zsh = { + enable = true; + enableCompletion = true; + enableAutosuggestions = true; + syntaxHighlighting.enable = true; + + zplug = { + enable = true; + plugins = [ + { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } + ]; + }; + + }; + }; + + home.stateVersion = "23.05"; +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..697e788 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,127 @@ +# 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, inputs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ]; + + # Enable experimental nix features. + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # General setup + networking.hostName = "randomctf"; # Define your hostname. + networking.networkmanager.enable = true; + time.timeZone = "America/Los_Angeles"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Enable Nvidia drivers + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { + modesetting.enable = true; + + # Power management is experimental and known to cause issues. + powerManagement.enable = false; + powerManagement.finegrained = false; + open = false; # Don't use open source kernel. + nvidiaSettings = true; + }; + + # Fix issue with Nvidia display scaling. + services.xserver.dpi = 96; + environment.variables.GDK_SCALE = "0.5"; + + # Enable the X11 windowing system and i3 window manager. + environment.pathsToLink = [ "/libexec" ]; + services.xserver = { + enable = true; + windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + extraPackages = with pkgs; [ + rofi + polybar + rxvt-unicode + arandr + ]; + }; + }; + + # Configure keymap in X11 + services.xserver = { + layout = "us"; + xkbVariant = ""; + xkbOptions = "caps:escape"; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Change default shell to zsh. + users.defaultUserShell = pkgs.zsh; + programs.zsh = { + enable = true; + autosuggestions.enable = true; + syntaxHighlighting.enable = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.random = { + isNormalUser = true; + useDefaultShell = true; + description = "random"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim + git + tmux + clang + emacs + microsoft-edge + emacsPackages.vterm + emacsPackages.mu4e + isync + bitwarden + bitwarden-cli + nextcloud-client + ]; + system.stateVersion = "23.11"; + +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..26ececd --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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 = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/f4f207c5-08d5-4848-920c-76e99280b04c"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/7F2D-4654"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + 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.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}