mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2025-06-23 13:31:34 +02:00
fix: home-manager related stuff
This commit is contained in:
parent
1cca60c94c
commit
8c923eccbf
@ -76,15 +76,6 @@ Note that the copied template cannot be used directly. You need to modify it to
|
|||||||
|
|
||||||
# Official NixOS package source, using nixos-23.11 branch here
|
# Official NixOS package source, using nixos-23.11 branch here
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||||
# home-manager, used for managing user configuration
|
|
||||||
home-manager = {
|
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
|
||||||
# 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.
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# `outputs` are all the build result of the flake.
|
# `outputs` are all the build result of the flake.
|
||||||
|
@ -180,9 +180,16 @@ After adjusting the parameters, the content of `/etc/nixos/flake.nix` is as foll
|
|||||||
description = "NixOS configuration";
|
description = "NixOS configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
# home-manager, used for managing user configuration
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager/release-23.11";
|
||||||
|
# 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.
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, home-manager, ... }: {
|
outputs = inputs@{ nixpkgs, home-manager, ... }: {
|
||||||
|
@ -72,14 +72,6 @@ cat flake.nix
|
|||||||
|
|
||||||
# NixOS 官方软件源,这里使用 nixos-23.11 分支
|
# NixOS 官方软件源,这里使用 nixos-23.11 分支
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||||
# home-manager,用于管理用户配置
|
|
||||||
home-manager = {
|
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
|
||||||
# `follows` 是 inputs 中的继承语法
|
|
||||||
# 这里使 sops-nix 的 `inputs.nixpkgs` 与当前 flake 的
|
|
||||||
# `inputs.nixpkgs` 保持一致,避免依赖的 nixpkgs 版本不一致导致问题
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# outputs 即 flake 的所有输出,其中的 nixosConfigurations 即 NixOS 系统配置
|
# outputs 即 flake 的所有输出,其中的 nixosConfigurations 即 NixOS 系统配置
|
||||||
|
@ -180,9 +180,16 @@ nix flake new example -t github:nix-community/home-manager#nixos
|
|||||||
description = "NixOS configuration";
|
description = "NixOS configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
# home-manager, used for managing user configuration
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager/release-23.11";
|
||||||
|
# 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.
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, home-manager, ... }: {
|
outputs = inputs@{ nixpkgs, home-manager, ... }: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user