diff --git a/README.md b/README.md deleted file mode 100644 index 4959383..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -Made using https://github.com/Misterio77/nix-starter-configs diff --git a/flake.lock b/flake.lock index aea9538..5354826 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,20 @@ { "nodes": { + "hardware": { + "locked": { + "lastModified": 1710123225, + "narHash": "sha256-j3oWlxRZxB7cFsgEntpH3rosjFHRkAo/dhX9H3OfxtY=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "ad2fd7b978d5e462048729a6c635c45d3d33c9ba", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixos-hardware", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -7,11 +22,11 @@ ] }, "locked": { - "lastModified": 1710452332, - "narHash": "sha256-+lKOoQ89fD6iz6Ro7Adml4Sx6SqQcTWII4t1rvVtdjs=", + "lastModified": 1710532761, + "narHash": "sha256-SUXGZNrXX05YA9G6EmgupxhOr3swI1gcxLUeDMUhrEY=", "owner": "nix-community", "repo": "home-manager", - "rev": "096d9c04b3e9438855aa65e24129b97a998bd3d9", + "rev": "206f457fffdb9a73596a4cb2211a471bd305243d", "type": "github" }, "original": { @@ -22,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1709703039, - "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", + "lastModified": 1710451336, + "narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", + "rev": "d691274a972b3165335d261cc4671335f5c67de9", "type": "github" }, "original": { @@ -38,6 +53,7 @@ }, "root": { "inputs": { + "hardware": "hardware", "home-manager": "home-manager", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index 3f3c14f..b5e949e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Jet's Nix Config"; + description = "Jet's nix config"; inputs = { # Nixpkgs @@ -9,12 +9,11 @@ home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; - # TODO: Add any other flake you might need - # hardware.url = "github:nixos/nixos-hardware"; + hardware.url = "github:nixos/nixos-hardware"; # Shameless plug: looking for a way to nixify your themes and make # everything match nicely? Try nix-colors! - #nix-colors.url = "github:misterio77/nix-colors"; + # nix-colors.url = "github:misterio77/nix-colors"; }; outputs = { @@ -28,7 +27,7 @@ # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#your-hostname' nixosConfigurations = { - jet = nixpkgs.lib.nixosSystem { + laptop = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; # > Our main nixos configuration file < modules = [./nixos/configuration.nix]; diff --git a/home-manager/home.nix b/home-manager/home.nix index 0e13b11..823af19 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -13,7 +13,7 @@ # inputs.nix-colors.homeManagerModule # You can also split up your configuration and import pieces of it here: - # ./nvim.nix + ./neovim-flake/flake.nix ]; nixpkgs = { @@ -43,66 +43,22 @@ homeDirectory = "/home/jet"; }; - xresources.properties = { - "Xcursor.size" = 16; - "Xft.dpi" = 200; - }; - + # Add stuff for your user as you see fit: + programs.neovim.enable = true; home.packages = with pkgs; [ + steam neofetch - - # archives zip - xz unzip - - # utils - ripgrep # recursively searches directories for a regex pattern - eza # A modern replacement for ‘ls’ - fzf # A command-line fuzzy finder - - # misc - cowsay - file - which + eza tree + which + file + btop + powertop ]; - # basic configuration of git, please change to your own - programs.git = { - enable = true; - userName = "Jet Pham"; - userEmail = "55770902+jetpham@users.noreply.github.com"; - }; - - programs.neovim = { - enable = true; - defaultEditor = true; - }; - - # starship - an customizable prompt for any shell - programs.starship = { - enable = true; - enableNushellIntegration = true; - # custom settings - settings = { - add_newline = false; - aws.disabled = true; - gcloud.disabled = true; - line_break.disabled = true; - }; - }; - - # alacritty - a cross-platform, GPU-accelerated terminal emulator - programs.kitty = { - enable = true; - }; - - programs.nushell = { - enable = true; - }; - -# Enable home-manager and git + # Enable home-manager and git programs.home-manager.enable = true; programs.git.enable = true; diff --git a/home-manager/neovim-flake b/home-manager/neovim-flake new file mode 160000 index 0000000..7bcc215 --- /dev/null +++ b/home-manager/neovim-flake @@ -0,0 +1 @@ +Subproject commit 7bcc215d38226892849411721cfbc096fd7e4d2d diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 05353eb..36f6a96 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,30 +1,80 @@ -# 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, ... }: - +# This is your system's configuration file. +# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + inputs, + lib, + config, + pkgs, + ... +}: { + # You can import other NixOS modules here + imports = [ + # If you want to use modules from other flakes (such as nixos-hardware): + # inputs.hardware.nixosModules.common-cpu-amd + # inputs.hardware.nixosModules.common-ssd + inputs.hardware.nixosModules.lenovo-thinkpad-x1-6th-gen - # Bootloader. + # You can also split up your configuration and import pieces of it here: + # ./users.nix + + # Import your generated (nixos-generate-config) hardware configuration + ./hardware-configuration.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # If you want to use overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nix.nixPath = ["/etc/nix/path"]; + environment.etc = + lib.mapAttrs' + (name: value: { + name = "nix/path/${name}"; + value.source = value.flake; + }) + config.nix.registry; + + nix.settings = { + # Enable flakes and new 'nix' command + experimental-features = "nix-command flakes"; + # Deduplicate and optimize nix store + auto-optimise-store = true; + }; + + # FIXME: Add the rest of your current configuration + + networking.hostName = "laptop"; + networking.networkmanager.enable = true; + + hardware.bluetooth.enable = true; # enables support for Bluetooth + + # TODO: This is just an example, be sure to use whatever bootloader you prefer boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "laptop"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. + # Set your time zone. time.timeZone = "America/Los_Angeles"; # Select internationalisation properties. @@ -55,12 +105,7 @@ variant = ""; }; - # Enable CUPS to print documents. - services.printing.enable = true; - - hardware.bluetooth.enable = true; - - # Enable sound with pipewire. + # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; @@ -77,26 +122,22 @@ #media-session.enable = true; }; - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.jet = { - isNormalUser = true; - description = "Jet Pham"; - extraGroups = [ "networkmanager" "wheel" ]; + # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. + users.users = { + jet = { + isNormalUser = true; + openssh.authorizedKeys.keys = [ + # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect + ]; + # TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc) + extraGroups = ["wheel" "networkmanager"]; packages = with pkgs; [ firefox # thunderbird ]; + }; }; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - nix.settings.experimental-features = [ "nix-command" "flakes" ]; environment.systemPackages = with pkgs; [ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # wget @@ -107,32 +148,18 @@ ]; environment.variables.EDITOR = "vim"; + # This setups a SSH server. Very important if you're setting up a headless system. + # Feel free to remove if you don't need it. + services.openssh = { + enable = true; + settings = { + # Forbid root login through SSH. + PermitRootLogin = "no"; + # Use keys only. Remove if you want to SSH using password (not recommended) + PasswordAuthentication = false; + }; + }; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # 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 = "23.11"; # Did you read the comment? - + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "23.05"; } diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index 3fb2b5d..dd00939 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -1,40 +1,10 @@ -# 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, ... }: - +# This is just an example, you should generate yours with nixos-generate-config and put it in here. { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + fileSystems."/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/ecfaab5f-dc2e-4bf0-a4cc-9a873de92c6f"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5426-5447"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/db16204a-f762-4252-a7bb-1ff4f333fc17"; } - ]; - - # 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.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # Set your system kind (needed for flakes) + nixpkgs.hostPlatform = "x86_64-linux"; } diff --git a/q b/q deleted file mode 100644 index 02a7d54..0000000 --- a/q +++ /dev/null @@ -1,112 +0,0 @@ -commit 72e17f8ca37c1a0c711c6114cfc3cd06c59e29f9 (HEAD -> main, origin/main) -Author: Jet Pham <55770902+jetpham@users.noreply.github.com> -Date: Thu Mar 14 19:09:41 2024 -0700 - - fixing warning - -diff --git a/flake.lock b/flake.lock -index 177441e..d671653 100644 ---- a/flake.lock -+++ b/flake.lock -@@ -7,32 +7,32 @@ - ] - }, - "locked": { -- "lastModified": 1685599623, -- "narHash": "sha256-Tob4CMOVHue0D3RzguDBCtUmX5ji2PsdbQDbIOIKvsc=", -+ "lastModified": 1706981411, -+ "narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=", - "owner": "nix-community", - "repo": "home-manager", -- "rev": "93db05480c0c0f30382d3e80779e8386dcb4f9dd", -+ "rev": "652fda4ca6dafeb090943422c34ae9145787af37", - "type": "github" - }, - "original": { - "owner": "nix-community", -- "ref": "release-23.05", -+ "ref": "release-23.11", - "repo": "home-manager", - "type": "github" - } - }, - "nixpkgs": { - "locked": { -- "lastModified": 1686431482, -- "narHash": "sha256-oPVQ/0YP7yC2ztNsxvWLrV+f0NQ2QAwxbrZ+bgGydEM=", -+ "lastModified": 1709703039, -+ "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", - "owner": "nixos", - "repo": "nixpkgs", -- "rev": "d3bb401dcfc5a46ce51cdfb5762e70cc75d082d2", -+ "rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", - "type": "github" - }, - "original": { - "owner": "nixos", -- "ref": "nixos-23.05", -+ "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } -diff --git a/flake.nix b/flake.nix -index d4eb038..f2544b4 100644 ---- a/flake.nix -+++ b/flake.nix -@@ -3,10 +3,10 @@ -  - inputs = { - # Nixpkgs -- nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; -+ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; -  - # Home manager -- home-manager.url = "github:nix-community/home-manager/release-23.05"; -+ home-manager.url = "github:nix-community/home-manager/release-23.11"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; -  - # TODO: Add any other flake you might need -diff --git a/home-manager/home.nix b/home-manager/home.nix -index 8251f04..0e13b11 100644 ---- a/home-manager/home.nix -+++ b/home-manager/home.nix -@@ -45,7 +45,7 @@ -  - xresources.properties = { - "Xcursor.size" = 16; -- "Xft.dpi" = 172; -+ "Xft.dpi" = 200; - }; -  - home.packages = with pkgs; [ -@@ -111,5 +111,4 @@ -  - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - home.stateVersion = "23.05"; -- programs.home-manager.enable = true; - } -diff --git a/nixos/configuration.nix b/nixos/configuration.nix -index 2e109a0..dc9aa32 100644 ---- a/nixos/configuration.nix -+++ b/nixos/configuration.nix -@@ -14,7 +14,7 @@ - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; -  -- networking.hostName = "nixos"; # Define your hostname. -+ networking.hostName = "laptop"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. -  - # Configure network proxy if necessary -@@ -50,9 +50,9 @@ - services.xserver.desktopManager.plasma5.enable = true; -  - # Configure keymap in X11 -- services.xserver = { -+ services.xserver.xkb = { - layout = "us"; -- xkbVariant = ""; -+ variant = ""; - }; -  - # Enable CUPS to print documents.