refactor: what can I say
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
username,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
btrfs = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
|
||||
in
|
||||
{
|
||||
boot = {
|
||||
initrd = {
|
||||
@@ -29,27 +31,14 @@
|
||||
"fs.file-max" = 9223372036854775807;
|
||||
};
|
||||
|
||||
resumeDevice = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
|
||||
resumeDevice = btrfs;
|
||||
kernelParams = [
|
||||
"resume_offset=6444127"
|
||||
|
||||
# "quiet"
|
||||
# "splash"
|
||||
# "log_level=3"
|
||||
];
|
||||
consoleLogLevel = 3;
|
||||
|
||||
/*
|
||||
plymouth = {
|
||||
enable = true;
|
||||
theme = "bgrt";
|
||||
themePackages = [ pkgs.nixos-bgrt-plymouth ];
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
|
||||
device = btrfs;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd"
|
||||
@@ -64,7 +53,7 @@
|
||||
};
|
||||
|
||||
fileSystems."/persistent" = {
|
||||
device = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
|
||||
device = btrfs;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd"
|
||||
@@ -74,7 +63,7 @@
|
||||
};
|
||||
|
||||
fileSystems."/swap" = {
|
||||
device = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
|
||||
device = btrfs;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd"
|
||||
@@ -85,7 +74,7 @@
|
||||
|
||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||
mkdir /btrfs_tmp
|
||||
mount /dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c /btrfs_tmp
|
||||
mount ${btrfs} /btrfs_tmp
|
||||
mkdir -p /btrfs_tmp/old_roots
|
||||
if [[ -e /btrfs_tmp/root ]]; then
|
||||
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
||||
@@ -111,6 +100,12 @@
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/B7DC-E9AC";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"uid=0"
|
||||
"gid=0"
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/home/${username}/Documents" = {
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
wpsoffice-cn
|
||||
wps-office-fonts
|
||||
evince
|
||||
# siyuan-unlock
|
||||
|
||||
anki
|
||||
|
||||
@@ -53,36 +52,47 @@
|
||||
'';
|
||||
};
|
||||
|
||||
programs.niri.settings.outputs = {
|
||||
DP-2 = {
|
||||
enable = true;
|
||||
mode = {
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
refresh = 75.033;
|
||||
programs.niri.settings = {
|
||||
outputs = {
|
||||
DP-2 = {
|
||||
enable = true;
|
||||
mode = {
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
refresh = 75.033;
|
||||
};
|
||||
scale = 1.25;
|
||||
position = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
};
|
||||
};
|
||||
scale = 1.25;
|
||||
position = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
DP-3 = {
|
||||
enable = true;
|
||||
mode = {
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
refresh = 75.033;
|
||||
};
|
||||
scale = 1.25;
|
||||
};
|
||||
};
|
||||
DP-3 = {
|
||||
enable = true;
|
||||
mode = {
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
refresh = 75.033;
|
||||
};
|
||||
scale = 1.25;
|
||||
};
|
||||
spawn-at-startup = [
|
||||
{
|
||||
command = [
|
||||
"sh"
|
||||
"-c"
|
||||
"sleep 3; echo 'Xft.dpi: 120' | ${lib.getExe pkgs.xorg.xrdb} -merge"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
my = {
|
||||
autologin = {
|
||||
enable = true;
|
||||
user = "${username}";
|
||||
user = username;
|
||||
ttys = [
|
||||
1
|
||||
6
|
||||
@@ -90,12 +100,10 @@
|
||||
};
|
||||
|
||||
gpg.enable = true;
|
||||
cmd.all.enable = true;
|
||||
cli.all.enable = true;
|
||||
coding.all.enable = true;
|
||||
desktop.all.enable = true;
|
||||
|
||||
desktop.wm.dwm.enable = lib.mkForce false;
|
||||
|
||||
desktop.browser.librewolf.enable = lib.mkForce false;
|
||||
|
||||
i18n.fcitx5.enable = true;
|
||||
@@ -207,9 +215,6 @@
|
||||
".config/go-musicfox/cookie"
|
||||
".hmcl.json"
|
||||
];
|
||||
nixosFiles = [
|
||||
"/etc/davfs2/secrets"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
username,
|
||||
sopsRoot,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -266,54 +268,41 @@ in
|
||||
btreset
|
||||
];
|
||||
|
||||
fileSystems =
|
||||
let
|
||||
config = pkgs.writeText "rclone.conf" ''
|
||||
[Nextcloud]
|
||||
type = webdav
|
||||
url = https://192.168.3.2/remote.php/dav/files/imxyy_soope_
|
||||
vendor = nextcloud
|
||||
user = imxyy_soope_
|
||||
pass = C2UUiMyPoynWWKS9kf_Fr8rcoXxgUswPYi4s
|
||||
|
||||
[NAS]
|
||||
type = smb
|
||||
host = 192.168.3.2
|
||||
user = nas
|
||||
pass = O74S6-7jDFykwCvZ8vuIxohh00Ty7XJF
|
||||
'';
|
||||
in
|
||||
{
|
||||
"/home/${username}/Nextcloud" = {
|
||||
device = "Nextcloud:";
|
||||
fsType = "rclone";
|
||||
options = [
|
||||
"nodev"
|
||||
"nofail"
|
||||
"allow_other"
|
||||
"args2env"
|
||||
"config=${toString config}"
|
||||
"uid=1000"
|
||||
"gid=100"
|
||||
"rw"
|
||||
"no-check-certificate"
|
||||
"vfs-cache-mode=full"
|
||||
];
|
||||
};
|
||||
"/home/${username}/NAS" = {
|
||||
device = "//192.168.3.2/share";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
"username=nas"
|
||||
"password=nasshare"
|
||||
"x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"
|
||||
"nodev"
|
||||
"nofail"
|
||||
"uid=1000"
|
||||
"gid=100"
|
||||
"vers=3"
|
||||
"rw"
|
||||
];
|
||||
};
|
||||
sops.secrets.imxyy-nix-rclone = {
|
||||
sopsFile = sopsRoot + /imxyy-nix-rclone.conf;
|
||||
format = "binary";
|
||||
};
|
||||
fileSystems = {
|
||||
"/home/${username}/Nextcloud" = {
|
||||
device = "Nextcloud:";
|
||||
fsType = "rclone";
|
||||
options = [
|
||||
"nodev"
|
||||
"nofail"
|
||||
"allow_other"
|
||||
"args2env"
|
||||
"config=${config.sops.secrets.imxyy-nix-rclone.path}"
|
||||
"uid=1000"
|
||||
"gid=100"
|
||||
"rw"
|
||||
"no-check-certificate"
|
||||
"vfs-cache-mode=full"
|
||||
];
|
||||
};
|
||||
"/home/${username}/NAS" = {
|
||||
device = "//192.168.3.2/share";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
"username=nas"
|
||||
"password=nasshare"
|
||||
"x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"
|
||||
"nodev"
|
||||
"nofail"
|
||||
"uid=1000"
|
||||
"gid=100"
|
||||
"vers=3"
|
||||
"rw"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"version": 1,
|
||||
"rules": [
|
||||
{
|
||||
"domain": [
|
||||
"cm.steampowered.com",
|
||||
"ol.epicgames.com",
|
||||
"csgo.wmsj.cn",
|
||||
"dota2.wmsj.cn",
|
||||
"wmsjsteam.com",
|
||||
"dl.steam.clngaa.com",
|
||||
"dl.steam.ksyna.com",
|
||||
"gstore.val.manlaxy.com",
|
||||
"st.dl.bscstorage.net",
|
||||
"st.dl.eccdnx.com",
|
||||
"st.dl.pinyuncloud.com",
|
||||
"steampipe.steamcontent.tnkjmec.com",
|
||||
"steampowered.com.8686c.com",
|
||||
"steamstatic.com.8686c.com",
|
||||
"steambroadcast.akamaized.net",
|
||||
"steamcdn-a.akamaihd.net",
|
||||
"steamcommunity-a.akamaihd.net",
|
||||
"steamstore-a.akamaihd.net",
|
||||
"steamusercontent-a.akamaihd.net",
|
||||
"steamuserimages-a.akamaihd.net"
|
||||
],
|
||||
"domain_suffix": [
|
||||
".steamcontent.com",
|
||||
".steamserver.net",
|
||||
".steamchina.com"
|
||||
],
|
||||
"invert": false
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user