something works

This commit is contained in:
Jet Pham 2024-03-15 21:21:18 -07:00
parent 66607d4a5f
commit 342aa83849
8 changed files with 140 additions and 284 deletions

View file

@ -1 +0,0 @@
Made using https://github.com/Misterio77/nix-starter-configs

28
flake.lock generated
View file

@ -1,5 +1,20 @@
{ {
"nodes": { "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": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -7,11 +22,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1710452332, "lastModified": 1710532761,
"narHash": "sha256-+lKOoQ89fD6iz6Ro7Adml4Sx6SqQcTWII4t1rvVtdjs=", "narHash": "sha256-SUXGZNrXX05YA9G6EmgupxhOr3swI1gcxLUeDMUhrEY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "096d9c04b3e9438855aa65e24129b97a998bd3d9", "rev": "206f457fffdb9a73596a4cb2211a471bd305243d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +37,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1709703039, "lastModified": 1710451336,
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", "narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", "rev": "d691274a972b3165335d261cc4671335f5c67de9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -38,6 +53,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"hardware": "hardware",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

View file

@ -1,5 +1,5 @@
{ {
description = "Jet's Nix Config"; description = "Jet's nix config";
inputs = { inputs = {
# Nixpkgs # Nixpkgs
@ -9,12 +9,11 @@
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; 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 # Shameless plug: looking for a way to nixify your themes and make
# everything match nicely? Try nix-colors! # everything match nicely? Try nix-colors!
#nix-colors.url = "github:misterio77/nix-colors"; # nix-colors.url = "github:misterio77/nix-colors";
}; };
outputs = { outputs = {
@ -28,7 +27,7 @@
# NixOS configuration entrypoint # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = { nixosConfigurations = {
jet = nixpkgs.lib.nixosSystem { laptop = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;}; specialArgs = {inherit inputs outputs;};
# > Our main nixos configuration file < # > Our main nixos configuration file <
modules = [./nixos/configuration.nix]; modules = [./nixos/configuration.nix];

View file

@ -13,7 +13,7 @@
# inputs.nix-colors.homeManagerModule # inputs.nix-colors.homeManagerModule
# You can also split up your configuration and import pieces of it here: # You can also split up your configuration and import pieces of it here:
# ./nvim.nix ./neovim-flake/flake.nix
]; ];
nixpkgs = { nixpkgs = {
@ -43,66 +43,22 @@
homeDirectory = "/home/jet"; homeDirectory = "/home/jet";
}; };
xresources.properties = { # Add stuff for your user as you see fit:
"Xcursor.size" = 16; programs.neovim.enable = true;
"Xft.dpi" = 200;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
steam
neofetch neofetch
# archives
zip zip
xz
unzip unzip
eza
# 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
tree tree
which
file
btop
powertop
]; ];
# basic configuration of git, please change to your own # Enable home-manager and git
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
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.git.enable = true; programs.git.enable = true;

@ -0,0 +1 @@
Subproject commit 7bcc215d38226892849411721cfbc096fd7e4d2d

View file

@ -1,30 +1,80 @@
# Edit this configuration file to define what should be installed on # This is your system's configuration file.
# your system. Help is available in the configuration.nix(5) man page # Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ {
imports = inputs,
[ # Include the results of the hardware scan. lib,
./hardware-configuration.nix 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.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "laptop"; # Define your hostname. # Set your time zone.
# 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.
time.timeZone = "America/Los_Angeles"; time.timeZone = "America/Los_Angeles";
# Select internationalisation properties. # Select internationalisation properties.
@ -55,12 +105,7 @@
variant = ""; variant = "";
}; };
# Enable CUPS to print documents. # Enable sound with pipewire.
services.printing.enable = true;
hardware.bluetooth.enable = true;
# Enable sound with pipewire.
sound.enable = true; sound.enable = true;
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true;
@ -77,26 +122,22 @@
#media-session.enable = true; #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. # TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
users.users.jet = { users.users = {
isNormalUser = true; jet = {
description = "Jet Pham"; isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" ]; 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; [ packages = with pkgs; [
firefox firefox
# thunderbird # 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; [ environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget # wget
@ -107,32 +148,18 @@
]; ];
environment.variables.EDITOR = "vim"; 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 # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
# started in user sessions. system.stateVersion = "23.05";
# 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. Its 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?
} }

View file

@ -1,40 +1,10 @@
# Do not modify this file! It was generated by nixos-generate-config # This is just an example, you should generate yours with nixos-generate-config and put it in here.
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = fileSystems."/" = {
[ (modulesPath + "/installer/scan/not-detected.nix") device = "/dev/sda1";
]; fsType = "ext4";
};
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; # Set your system kind (needed for flakes)
boot.initrd.kernelModules = [ ]; nixpkgs.hostPlatform = "x86_64-linux";
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.<interface>.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;
} }

112
q
View file

@ -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.