fix
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
systemdIntegration = true;
|
systemdIntegration = true;
|
||||||
enableNvidiaPatches = true;
|
|
||||||
# extraConfig = builtins.readFile ./conf/hyprland.conf;
|
# extraConfig = builtins.readFile ./conf/hyprland.conf;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
{ config, pkgs, username,inputs, lib, ... }:
|
{ config, pkgs, username, inputs, lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.impermanence.nixosModules.impermanence
|
inputs.impermanence.nixosModules.impermanence
|
||||||
@@ -11,38 +11,29 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
# 启用 tmpfs 作为根文件系统
|
# 启用 tmpfs 作为根文件系统
|
||||||
fileSystems."/" = lib.mkForce{
|
fileSystems."/" = lib.mkForce {
|
||||||
device = "none";
|
device = "none";
|
||||||
fsType = "tmpfs";
|
fsType = "tmpfs";
|
||||||
options = [ "defaults" "size=2G" "mode=755" ];
|
options = [ "defaults" "size=2G" "mode=755" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# 将 /nix 存储在持久化分区
|
# 将 /nix 目录绑定到持久化存储
|
||||||
fileSystems."/nix" = lib.mkForce{
|
fileSystems."/nix" = {
|
||||||
device = "/nix/persistent/nix";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [ "compress-force=zstd" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# 建议的 fstab 配置
|
|
||||||
fileSystems."/nix/persistent" = {
|
|
||||||
device = "/dev/disk/by-label/nixos-persistent"; # 需要根据实际情况修改
|
device = "/dev/disk/by-label/nixos-persistent"; # 需要根据实际情况修改
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
neededForBoot = true;
|
options = [ "bind" ];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# 配置持久化存储
|
# 配置持久化存储
|
||||||
environment.persistence."/nix/persistent" = {
|
environment.persistence."/nix/persistent" = {
|
||||||
# 不在文件管理器中显示这些挂载点
|
|
||||||
hideMounts = true;
|
hideMounts = true;
|
||||||
|
|
||||||
directories = [
|
directories = [
|
||||||
"/etc/nixos" # NixOS 配置文件
|
"/etc/nixos"
|
||||||
"/etc/NetworkManager/system-connections" # 网络配置
|
"/etc/NetworkManager/system-connections"
|
||||||
"/var/log" # 系统日志
|
"/var/log"
|
||||||
"/var/lib" # 系统数据
|
"/var/lib"
|
||||||
"/root" # root 用户目录
|
"/root"
|
||||||
"/.nix"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
files = [
|
files = [
|
||||||
@@ -53,21 +44,16 @@
|
|||||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||||
];
|
];
|
||||||
|
|
||||||
# 用户目录持久化配置
|
|
||||||
users.${username} = {
|
users.${username} = {
|
||||||
directories = [
|
directories = [
|
||||||
# 应用配置
|
|
||||||
".config"
|
".config"
|
||||||
".cache"
|
".cache"
|
||||||
".local"
|
".local"
|
||||||
".ssh"
|
".ssh"
|
||||||
".gnupg"
|
".gnupg"
|
||||||
|
|
||||||
# 开发相关
|
|
||||||
".vscode"
|
".vscode"
|
||||||
".npm"
|
".npm"
|
||||||
".cargo"
|
".cargo"
|
||||||
|
|
||||||
"data"
|
"data"
|
||||||
"doc"
|
"doc"
|
||||||
];
|
];
|
||||||
@@ -79,7 +65,4 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user