feat: update nixos's version to 23.05, update content in start-using-home-manager

This commit is contained in:
Ryan Yin
2023-07-08 11:44:49 +08:00
parent 7f28083a7f
commit 62369233a4
6 changed files with 21 additions and 14 deletions

View File

@ -13,8 +13,8 @@ Here's an example of how you can add multiple nixpkgs inputs, each using a diffe
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Latest stable branch of nixpkgs, used for version rollback
# The current latest version is 22.11
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.11";
# The current latest version is 23.05
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.05";
# You can also use a specific git commit hash to lock the version
nixpkgs-fd40cef8d.url = "github:nixos/nixpkgs/fd40cef8d797670e203a27a91e4b8e6decf0b90c";
@ -85,5 +85,4 @@ Next, you can refer to the packages from `pkgs-stable` or `pkgs-fd40cef8d` withi
By adjusting the configuration as shown above, you can deploy it using `sudo nixos-rebuild switch`. This will downgrade your Firefox/Chrome/VSCode versions to the ones corresponding to `nixpkgs-stable` or `nixpkgs-fd40cef8d`.
>According to [1000 instances of nixpkgs](https://discourse.nixos.org/t/1000-instances-of-nixpkgs/17347), it's not a good practice to use `import` in submodules to customize `nixpkgs`. Each `import` creates a new instance of nixpkgs, which increases build time and memory usage as the configuration grows. To avoid this problem, we create all nixpkgs instances in `flake.nix`.
> According to [1000 instances of nixpkgs](https://discourse.nixos.org/t/1000-instances-of-nixpkgs/17347), it's not a good practice to use `import` in submodules to customize `nixpkgs`. Each `import` creates a new instance of nixpkgs, which increases build time and memory usage as the configuration grows. To avoid this problem, we create all nixpkgs instances in `flake.nix`.

View File

@ -78,7 +78,7 @@ Note that the copied template cannot be used directly. You need to modify it to
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# home-manager, used for managing user configuration
home-manager = {
url = "github:nix-community/home-manager/release-22.11";
url = "github:nix-community/home-manager/release-23.05";
# The `follows` keyword in inputs is used for inheritance.
# Here, `inputs.nixpkgs` of home-manager is kept consistent with the `inputs.nixpkgs` of the current flake,
# to avoid problems caused by different versions of nixpkgs.

View File

@ -112,6 +112,7 @@ According to the official [Home Manager Manual](https://nix-community.github.io/
# starship - an customizable prompt for any shell
programs.starship = {
enable = true;
# custom settings
settings = {
add_newline = false;
aws.disabled = true;
@ -123,6 +124,7 @@ According to the official [Home Manager Manual](https://nix-community.github.io/
# alacritty - a cross-platform, GPU-accelerated terminal emulator
programs.alacritty = {
enable = true;
# custom settings
settings = {
env.TERM = "xterm-256color";
font = {
@ -137,15 +139,16 @@ According to the official [Home Manager Manual](https://nix-community.github.io/
programs.bash = {
enable = true;
enableCompletion = true;
# TODO add your cusotm bashrc here
bashrcExtra = ''
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
'';
# set some aliases, feel free to add more or remove some
shellAliases = {
k = "kubectl";
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
httpproxy = "export https_proxy=http://127.0.0.1:7890; export http_proxy=http://127.0.0.1:7890;";
};
};
@ -157,7 +160,7 @@ According to the official [Home Manager Manual](https://nix-community.github.io/
# You can update home Manager without changing this value. See
# the home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.11";
home.stateVersion = "23.05";
# Let home Manager install and manage itself.
programs.home-manager.enable = true;