Compare commits

...

63 Commits
ttyd ... color

Author SHA1 Message Date
chn
7c161d3521 devices.pc: use xcalib to load color profile 2024-02-16 10:50:12 +08:00
chn
7cb4c6ecec devices.pc: try to use colord 2024-02-16 10:48:24 +08:00
chn
aef16e54f1 devices.pc: add specialisation for nvidia graphic card 2024-02-16 10:04:07 +08:00
chn
536a96ce5e hardware.gpu: fix 2024-02-16 09:44:14 +08:00
chn
a94d6e3d21 devices.pc: switch to amd+nvidia 2024-02-15 23:20:56 +08:00
chn
0e09b925c2 hardware.gpu: rewrite 2024-02-15 23:17:20 +08:00
chn
9d1fae10d8 hardware: update nvidia driver 2024-02-15 20:28:51 +08:00
chn
ef1caae121 hardware: use default nvidia driver 2024-02-15 19:55:41 +08:00
chn
6d70eecc19 system.kernel: fix for surface 2024-02-15 19:38:33 +08:00
chn
1e42238723 system.kernel: update to 6.7 2024-02-15 19:38:17 +08:00
chn
fe089060ae Revert "add todo"
This reverts commit 54bfa1c8ac.
2024-02-15 16:54:57 +08:00
chn
8a5bb908c7 devices.nas: disable snapper 2024-02-15 16:17:16 +08:00
chn
54bfa1c8ac add todo 2024-02-15 16:16:40 +08:00
chn
54493a2ec6 users.chn.plasma: fix kwin shortcuts 2024-02-15 15:53:57 +08:00
chn
f1218571c5 fix build 2024-02-15 15:40:21 +08:00
chn
aecc530aa9 packages.firefox: fix cascade UI 2024-02-15 15:28:21 +08:00
chn
c43187a15c fix build 2024-02-15 15:27:39 +08:00
chn
86a781b327 packages.firefox: add grammarly 2024-02-12 18:39:05 +08:00
chn
0424d7eed7 users.chn.plasma.wallpaper: fix 2024-02-12 18:23:11 +08:00
chn
78a74a5aef users.chn.plasma.shortcuts: add shortcut for system monitor 2024-02-12 14:16:24 +08:00
chn
a4c04c9de2 devices.nas: use desktop-fat package set 2024-02-12 14:12:15 +08:00
chn
aad44c7edd users.chn.plasma.autostart: fix 2024-02-12 13:40:40 +08:00
chn
2a7e8d78be Revert "vps7: disable gui"
This reverts commit bffed3b584.
2024-02-12 13:39:37 +08:00
chn
8b90c0bc22 Revert "nas: disable gui"
This reverts commit 08df40f3a3.
2024-02-12 13:39:26 +08:00
chn
6f533e73ee packages.desktop: enable yubikey-touch-detector 2024-02-12 13:36:55 +08:00
chn
244b0e17fa users.chn.plasma.autostart: fix 2024-02-12 11:59:42 +08:00
chn
7f165fccf4 users.chn.plasma.autostart: add kmail and discord 2024-02-12 11:27:48 +08:00
chn
40f4d35b62 users.chn.plasma.autostart: add element 2024-02-12 11:09:26 +08:00
chn
02981d242f users.chn.plasma.autostart: init 2024-02-12 10:17:28 +08:00
chn
6a36fe0539 users.chn.plasma: split config 2024-02-12 10:04:56 +08:00
chn
45e5569d55 packages.firefox: force write profile.ini 2024-02-12 09:19:09 +08:00
chn
a9027c6127 Merge branch 'firefox' into production 2024-02-12 08:28:37 +08:00
chn
67079b0885 packages.firefox: add dualsub, pakkujs, rsspreview 2024-02-12 08:28:17 +08:00
chn
3384026e91 users.chn.plasma: use tela icon 2024-02-12 00:05:58 +08:00
chn
803b20ec96 users.chn.plasma: switch back to black background 2024-02-11 23:47:56 +08:00
chn
074f88d231 users.chn.konsole: fix opacity 2024-02-11 23:22:10 +08:00
chn
fd7fe508f5 localPackages.blurred-wallpaper: fix 2024-02-11 22:57:59 +08:00
chn
cf6a66f11e users.chn.plasma: fix 2024-02-11 22:45:59 +08:00
chn
c4c2e680a4 packages.firefox: do not use catppuccin 2024-02-11 22:23:02 +08:00
chn
bf16cc5593 packages.desktop.firefox: use catppucin color 2024-02-11 22:08:43 +08:00
chn
5d473887a3 Merge branch 'production' into firefox 2024-02-11 21:56:44 +08:00
chn
773b2e8cc1 users.chn.plasma: add impermanence 2024-02-11 21:53:12 +08:00
chn
c9cfbb515b users.chn.plasma: add yakuake and konsole 2024-02-11 21:41:43 +08:00
chn
82e2cd4e7d system.impermanence: do not persist fontconfig 2024-02-11 17:27:15 +08:00
chn
794657d0ea packages.desktop.firefox: add firefox-color 2024-02-11 17:26:24 +08:00
chn
4f621ce7f1 fix wallpaper 2024-02-11 17:17:24 +08:00
chn
4ebff80941 services.fontconfig: force set font config 2024-02-11 16:59:43 +08:00
chn
6080de15ca users.chn.wallpaper: use blurred-wallpaper package 2024-02-11 16:45:51 +08:00
chn
2310289c92 packages.desktop.firefox: enable language packs 2024-02-11 11:59:31 +08:00
chn
ef30e0f6dc packages.desktop.firefox: force set search engine 2024-02-11 11:32:22 +08:00
chn
e26e287603 packages.default.firefox: add zotero-connector 2024-02-11 11:26:42 +08:00
chn
f9227c3e85 packages.desktop.firefox: add some settings 2024-02-11 09:55:40 +08:00
chn
264be067ca packages.desktop.firefox: add user chrome 2024-02-10 11:21:49 +08:00
chn
047619ee17 packages.desktop.firefox: init 2024-02-10 10:53:57 +08:00
chn
fc6cbc6230 do not set wallpaper 2024-02-09 21:48:12 +08:00
chn
056f38dbf5 devices.pc: fix xcalib startup script 2024-02-09 21:32:12 +08:00
chn
61d7db84ba direct add wallpaper to flake 2024-02-09 21:24:20 +08:00
chn
6672ea7f4f plasma-manager: init 2024-02-09 17:05:34 +08:00
chn
4aead6cfc6 fix build 2024-02-09 12:38:12 +08:00
chn
139722dfdf fix waydroid 2024-02-09 12:12:58 +08:00
chn
ac85049d0f fix zip 2024-02-08 23:01:08 +08:00
chn
f5f71bee21 localPackages.win11os-kde: init 2024-02-05 18:18:10 +08:00
chn
08af6615af update plasma-manager 2024-02-05 11:45:56 +08:00
38 changed files with 883 additions and 427 deletions

View File

@@ -45,12 +45,13 @@ inputs:
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
kernel.patches = [ "cjktty" ];
networking.hostname = "nas";
gui.preferred = false;
};
hardware = { cpus = [ "intel" ]; gpus = [ "intel" ]; };
packages.packageSet = "server";
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
packages.packageSet = "desktop-fat";
services =
{
snapper.enable = true;
snapper.enable = false;
fontconfig.enable = true;
samba =
{
@@ -66,6 +67,7 @@ inputs:
serverName = "vps6.xserver.chn.moe";
dns.extraInterfaces = [ "docker0" ];
};
xrdp = { enable = true; hostname = [ "nas.chn.moe" "office.chn.moe" ]; };
groupshare.enable = true;
smartd.enable = true;
beesd =

View File

@@ -60,7 +60,8 @@ inputs:
hardware =
{
cpus = [ "amd" ];
gpus = [ "nvidia" ];
gpu = { type = "amd+nvidia"; prime.busId = { amd = "8:0:0"; nvidia = "1:0:0"; }; };
# gpu.type = "amd";
bluetooth.enable = true;
joystick.enable = true;
printer.enable = true;
@@ -133,16 +134,19 @@ inputs:
publicKey = "l1gFSDCeBxyf/BipXNvoEvVvLqPgdil84nmr5q6+EEw=";
wireguardIp = "192.168.83.3";
};
gamemode = { enable = true; drmDevice = 1; };
};
bugs = [ "xmunet" "backlight" "amdpstate" ];
};
# use plasma-x11 as default, instead of plasma-wayland
services.xserver.displayManager =
{
defaultSession = inputs.lib.mkForce "plasma";
setupCommands = "${inputs.pkgs.xcalib}/bin/xcalib -d :0 ${./color/TPLCD_161B_Default.icm}";
};
virtualisation.virtualbox.host = { enable = true; enableExtensionPack = true; };
hardware.nvidia.forceFullCompositionPipeline = true;
home-manager.users.chn.config.programs.plasma.startup.autoStartScript.xcalib.text =
"${inputs.pkgs.xcalib}/bin/xcalib -d :0 ${./color/TPLCD_161B_Default.icm}";
services.xserver.displayManager.defaultSession = inputs.lib.mkForce "plasma";
specialisation.nvidia.configuration =
{
system.nixos.tags = [ "discreate-graphic" ];
nixos.hardware.gpu.type = inputs.lib.mkForce "nvidia";
hardware.nvidia.forceFullCompositionPipeline = true;
};
};
}

View File

@@ -31,13 +31,13 @@ inputs:
nixpkgs.march = "skylake";
grub.installDevice = "efi";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
kernel.patches = [ "cjktty" "lantian" ];
kernel.patches = [ "cjktty" "lantian" "surface" ];
networking.hostname = "surface";
};
hardware =
{
cpus = [ "intel" ];
gpus = [ "intel" ];
gpu.type = "intel";
bluetooth.enable = true;
joystick.enable = true;
printer.enable = true;
@@ -61,21 +61,6 @@ inputs:
};
bugs = [ "xmunet" ];
};
boot.kernelPackages =
let
originalKernel = inputs.pkgs.linuxPackages_xanmod_latest.kernel;
version = originalKernel.version;
majorVersion =
let versionArray = builtins.splitVersion version;
in "${builtins.elemAt versionArray 0}.${builtins.elemAt versionArray 1}";
repoFile = "${inputs.topInputs.nixos-hardware}/microsoft/surface/common/kernel/linux-package.nix";
inherit (inputs.pkgs.callPackage repoFile {}) repos;
patchDir = repos.linux-surface + "/patches/${majorVersion}";
patchFile = "${inputs.topInputs.nixos-hardware}/microsoft/surface/common/kernel/linux-6.6.x/patches.nix";
kernelPatches = inputs.pkgs.callPackage patchFile { inherit (inputs.lib) kernel; inherit version patchDir; };
in
inputs.lib.mkForce (inputs.pkgs.linuxPackagesFor (originalKernel.override
(prev: { kernelPatches = prev.kernelPatches ++ kernelPatches; })));
environment.systemPackages = with inputs.pkgs; [ maliit-keyboard maliit-framework ];
};
}

View File

@@ -30,8 +30,9 @@ inputs:
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
initrd.sshd.enable = true;
networking.hostname = "vps7";
gui.preferred = false;
};
packages.packageSet = "server";
packages.packageSet = "desktop";
services =
{
snapper.enable = true;
@@ -49,6 +50,7 @@ inputs:
synapse.matrixHostname = "synapse.chn.moe";
matrix = { port = 8009; redisPort = 6380; slidingSyncPort = 9001; };
};
xrdp = { enable = true; hostname = [ "vps7.chn.moe" ]; };
vaultwarden.enable = true;
beesd = { enable = true; instances.root = { device = "/"; hashTableSizeMB = 1024; }; };
photoprism.enable = true;

View File

@@ -47,12 +47,12 @@ inputs:
hardware =
{
cpus = [ "amd" ];
gpus = [ "nvidia" ];
# gpus = [ "nvidia" ];
bluetooth.enable = true;
joystick.enable = true;
printer.enable = true;
sound.enable = true;
gamemode.drmDevice = 1;
# gamemode.drmDevice = 1;
};
packages.packageSet = "workstation";
virtualization = { docker.enable = true; kvmHost = { enable = true; gui = true; }; };

141
flake.lock generated
View File

@@ -21,6 +21,38 @@
"type": "github"
}
},
"blurred-wallpaper": {
"flake": false,
"locked": {
"lastModified": 1700747921,
"narHash": "sha256-mCqf03cXlTl4vuJIzVEiYhHQsAPG3i6yHQ3Xdt06HfA=",
"owner": "bouteillerAlan",
"repo": "blurredwallpaper",
"rev": "aecc88d43e458a0962a0091dcdb7baac34e263be",
"type": "github"
},
"original": {
"owner": "bouteillerAlan",
"repo": "blurredwallpaper",
"type": "github"
}
},
"cascade": {
"flake": false,
"locked": {
"lastModified": 1707981987,
"narHash": "sha256-6p4t7maih5I5BqkawqArnYSN+35iUPxlsHebk6SRf7A=",
"owner": "CHN-beta",
"repo": "cascade",
"rev": "7c5645ed390c8b829e241f3ed5495a9d5a473375",
"type": "github"
},
"original": {
"owner": "CHN-beta",
"repo": "cascade",
"type": "github"
}
},
"citation-style-language": {
"flake": false,
"locked": {
@@ -844,6 +876,22 @@
"type": "github"
}
},
"fluent-kde": {
"flake": false,
"locked": {
"lastModified": 1685119052,
"narHash": "sha256-jm8ztgoWV8sewCYbFxReiVPjuHY97NslKM1AIoooSiY=",
"owner": "vinceliuice",
"repo": "Fluent-kde",
"rev": "83d5cc2013751aa9eeb944dafa3a3460652690ce",
"type": "github"
},
"original": {
"owner": "vinceliuice",
"repo": "Fluent-kde",
"type": "github"
}
},
"format-all": {
"flake": false,
"locked": {
@@ -922,6 +970,22 @@
"type": "github"
}
},
"linux-surface": {
"flake": false,
"locked": {
"lastModified": 1707902187,
"narHash": "sha256-mGxhAvpBJ3wSgecz9mwghTjRUjwcsjE0cqdcUODLS+0=",
"owner": "linux-surface",
"repo": "linux-surface",
"rev": "fcc945709d89716a0012d3d42d0e9af0f7cd60ee",
"type": "github"
},
"original": {
"owner": "linux-surface",
"repo": "linux-surface",
"type": "github"
}
},
"lmix": {
"inputs": {
"nixpkgs": [
@@ -1260,15 +1324,15 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1705312285,
"narHash": "sha256-rd+dY+v61Y8w3u9bukO/hB55Xl4wXv4/yC8rCGVnK5U=",
"owner": "NixOS",
"lastModified": 1707989601,
"narHash": "sha256-Zq81JV6NnWI4dDOYVB7VeP3BEv/HswEvIvIwrcUZoaA=",
"owner": "CHN-beta",
"repo": "nixos-hardware",
"rev": "bee2202bec57e521e3bd8acd526884b9767d7fa0",
"rev": "b3e300fcdab6c004e25de94d5e23ae78a267ec4b",
"type": "github"
},
"original": {
"owner": "NixOS",
"owner": "CHN-beta",
"repo": "nixos-hardware",
"type": "github"
}
@@ -1429,11 +1493,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1707017659,
"narHash": "sha256-FZ3Q2WARF/hF9xvNvHnpg0fw7R8XdgvNMhb24ZYUQwc=",
"lastModified": 1708000057,
"narHash": "sha256-vpmOD7xoYaD08WqKhoRS7tyvB9JzAc4KGWW0lQW0cCw=",
"owner": "CHN-beta",
"repo": "nixpkgs",
"rev": "aa42cddc25be43252a175c369ad07aafc38db2a1",
"rev": "d780b53ae92422a50786c60a32b8d59f1eecbc54",
"type": "github"
},
"original": {
@@ -1703,11 +1767,11 @@
]
},
"locked": {
"lastModified": 1705946102,
"narHash": "sha256-0hy28d7qC7Hv6/KV7xefa03b2xFJIGHPYAPcsVwzTeM=",
"lastModified": 1707045317,
"narHash": "sha256-o2NZJcNu2/M3qycZ2Z9sgIESQEBFmihbbA7//sp7yVA=",
"owner": "pjones",
"repo": "plasma-manager",
"rev": "4d209a083aeefa7d4f8060de14896399bbc8f30b",
"rev": "290cd65b65e2da11ca9fda69781ea9beb8a6f6ac",
"type": "github"
},
"original": {
@@ -1777,6 +1841,8 @@
"root": {
"inputs": {
"aagl": "aagl",
"blurred-wallpaper": "blurred-wallpaper",
"cascade": "cascade",
"citation-style-language": "citation-style-language",
"concurrencpp": "concurrencpp",
"cppcoro": "cppcoro",
@@ -1785,8 +1851,10 @@
"dguibert-nur-packages": "dguibert-nur-packages",
"eigen": "eigen",
"envfs": "envfs",
"fluent-kde": "fluent-kde",
"home-manager": "home-manager",
"impermanence": "impermanence",
"linux-surface": "linux-surface",
"lmix": "lmix",
"matplotplusplus": "matplotplusplus",
"misskey": "misskey",
@@ -1811,9 +1879,12 @@
"pnpm2nix-nzbr": "pnpm2nix-nzbr",
"qchem": "qchem",
"rsshub": "rsshub",
"rycee": "rycee",
"slate": "slate",
"sops-nix": "sops-nix",
"tgbot-cpp": "tgbot-cpp",
"v-sim": "v-sim",
"win11os-kde": "win11os-kde",
"zpp-bits": "zpp-bits"
}
},
@@ -1849,6 +1920,38 @@
"type": "github"
}
},
"rycee": {
"flake": false,
"locked": {
"lastModified": 1707673696,
"narHash": "sha256-3+IgVATpdUFJ33QLIuK8mIzg5rSWA/wX0IoBMfPKzWo=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "22f2d8e0cbb3a8490a104ca5cb7bbc8ba10d262c",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"slate": {
"flake": false,
"locked": {
"lastModified": 1626631298,
"narHash": "sha256-3tbB16sWVUqiHAfeFc0FnFb0Cf6ZFxYWsYAyexeZVxk=",
"owner": "TheBigWazz",
"repo": "Slate",
"rev": "ff21b49c6e49b5a9f89497e4fea49a5a0c39bd6b",
"type": "github"
},
"original": {
"owner": "TheBigWazz",
"repo": "Slate",
"type": "github"
}
},
"sln-mode": {
"flake": false,
"locked": {
@@ -2196,6 +2299,22 @@
"type": "gitlab"
}
},
"win11os-kde": {
"flake": false,
"locked": {
"lastModified": 1684014177,
"narHash": "sha256-uumpEiPkrTf98oqYe+rR3zmb7H8esy1vXLuv1WiOV7M=",
"owner": "yeyushengfan258",
"repo": "Win11OS-kde",
"rev": "b5daaa322c312e016ff1508850287c32a8123693",
"type": "github"
},
"original": {
"owner": "yeyushengfan258",
"repo": "Win11OS-kde",
"type": "github"
}
},
"ws-butler": {
"flake": false,
"locked": {

View File

@@ -41,7 +41,7 @@
};
nix-doom-emacs = { url = "github:nix-community/nix-doom-emacs"; inputs.nixpkgs.follows = "nixpkgs"; };
nur-linyinfeng = { url = "github:linyinfeng/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nixos-hardware.url = "github:NixOS/nixos-hardware";
nixos-hardware.url = "github:CHN-beta/nixos-hardware";
envfs = { url = "github:Mic92/envfs"; inputs.nixpkgs.follows = "nixpkgs"; };
misskey = { url = "git+https://github.com/CHN-beta/misskey?submodules=1"; flake = false; };
@@ -57,6 +57,13 @@
nodesoup = { url = "github:olvb/nodesoup"; flake = false; };
tgbot-cpp = { url = "github:reo7sp/tgbot-cpp"; flake = false; };
v-sim = { url = "gitlab:l_sim/v_sim"; flake = false; };
win11os-kde = { url = "github:yeyushengfan258/Win11OS-kde"; flake = false; };
fluent-kde = { url = "github:vinceliuice/Fluent-kde"; flake = false; };
rycee = { url = "gitlab:rycee/nur-expressions"; flake = false; };
cascade = { url = "github:CHN-beta/cascade"; flake = false; };
blurred-wallpaper = { url = "github:bouteillerAlan/blurredwallpaper"; flake = false; };
slate = { url = "github:TheBigWazz/Slate"; flake = false; };
linux-surface = { url = "github:linux-surface/linux-surface"; flake = false; };
};
outputs = inputs:

View File

@@ -1,6 +1,6 @@
lib:
{
attrsToList = Attrs: builtins.map ( name: { inherit name; value = Attrs.${name}; } ) ( builtins.attrNames Attrs );
attrsToList = attrs: builtins.map (name: { inherit name; value = attrs.${name}; }) (builtins.attrNames attrs);
mkConditional = condition: trueResult: falseResult: let inherit (lib) mkMerge mkIf; in
mkMerge [ ( mkIf condition trueResult ) ( mkIf (!condition) falseResult ) ];

View File

@@ -0,0 +1,11 @@
{ stdenv, src }: stdenv.mkDerivation
{
name = "blurred-wallpaper";
inherit src;
phases = [ "installPhase" ];
installPhase =
''
mkdir -p $out/share/plasma/wallpapers/a2n.blur
cp -r $src/* $out/share/plasma/wallpapers/a2n.blur
'';
}

View File

@@ -45,4 +45,8 @@
pyreadline3 = python3Packages.callPackage ./pyreadline3 {};
torchdata = python3Packages.callPackage ./torchdata {};
torchtext = python3Packages.callPackage ./torchtext { inherit torchdata; };
win11os-kde = callPackage ./win11os-kde { src = topInputs.win11os-kde; };
fluent-kde = callPackage ./fluent-kde { src = topInputs.fluent-kde; };
blurred-wallpaper = callPackage ./blurred-wallpaper { src = topInputs.blurred-wallpaper; };
slate = callPackage ./slate { src = topInputs.slate; };
}

View File

@@ -0,0 +1,22 @@
{ lib, stdenv, src }: stdenv.mkDerivation
{
name = "fluent-kde";
inherit src;
installPhase =
''
mkdir -p $out/share/aurorae/themes
cp -r $src/aurorae/* $out/share/aurorae/themes
mkdir -p $out/share/color-schemes
cp -r $src/color-schemes/*.colors $out/share/color-schemes
mkdir -p $out/share/Kvantum
cp -r $src/Kvantum/Fluent* $out/share/Kvantum
mkdir -p $out/share/plasma/desktoptheme
cp -r $src/plasma/desktoptheme/* $out/share/plasma/desktoptheme
mkdir -p $out/share/plasma/layout-templates
cp -r $src/plasma/layout-templates/* $out/share/plasma/layout-templates
mkdir -p $out/share/plasma/look-and-feel
cp -r $src/plasma/look-and-feel/com.github.vinceliuice.Fluent* $out/share/plasma/look-and-feel
mkdir -p $out/share/wallpapers
cp -r $src/wallpaper/* $out/share/wallpapers
'';
}

View File

@@ -0,0 +1,10 @@
{ stdenv, src }: stdenv.mkDerivation
{
name = "slate";
src = "${src}/Slate.tar.gz";
installPhase =
''
mkdir -p $out/share/yakuake/skins/Slate
cp -r * $out/share/yakuake/skins/Slate
'';
}

View File

@@ -0,0 +1,20 @@
{ lib, stdenv, src }: stdenv.mkDerivation
{
name = "win11os-kde";
inherit src;
installPhase =
''
mkdir -p $out/share/aurorae/themes
cp -r $src/aurorae/* $out/share/aurorae/themes
mkdir -p $out/share/color-schemes
cp -r $src/color-schemes/*.colors $out/share/color-schemes
mkdir -p $out/share/Kvantum
cp -r $src/Kvantum/* $out/share/Kvantum
mkdir -p $out/share/plasma/desktoptheme
cp -r $src/plasma/desktoptheme/* $out/share/plasma/desktoptheme
mkdir -p $out/share/plasma/look-and-feel
cp -r $src/plasma/look-and-feel/* $out/share/plasma/look-and-feel
mkdir -p $out/share/wallpapers
cp -r $src/wallpaper/* $out/share/wallpapers
'';
}

View File

@@ -37,6 +37,7 @@ inputs:
# needed by mirism
nghttp2-2305 =
inputs.pkgs.callPackage "${inputs.topInputs.nixpkgs-2305}/pkgs/development/libraries/nghttp2" {};
firefox-addons = (import "${topInputs.rycee}" { inherit (prev) pkgs; }).firefox-addons;
})
];
home-manager.sharedModules =

View File

@@ -1,6 +1,6 @@
inputs:
{
imports = inputs.localLib.mkModules [ ./legion.nix ];
imports = inputs.localLib.mkModules [ ./gpu.nix ./legion.nix ];
options.nixos.hardware = let inherit (inputs.lib) mkOption types; in
{
bluetooth.enable = mkOption { type = types.bool; default = false; };
@@ -8,14 +8,6 @@ inputs:
printer.enable = mkOption { type = types.bool; default = false; };
sound.enable = mkOption { type = types.bool; default = false; };
cpus = mkOption { type = types.listOf (types.enum [ "intel" "amd" ]); default = []; };
gpus = mkOption { type = types.listOf (types.enum [ "intel" "nvidia" "amd" ]); default = []; };
prime =
{
enable = mkOption { type = types.bool; default = false; };
mode = mkOption { type = types.enum [ "offload" "sync" ]; default = "offload"; };
busId = mkOption { type = types.attrsOf types.str; default = {}; };
};
gamemode.drmDevice = mkOption { type = types.int; default = 0; };
halo-keyboard.enable = mkOption { type = types.bool; default = false; };
};
config =
@@ -82,80 +74,6 @@ inputs:
concatLists (map (cpu: modules.${cpu}) hardware.cpus);
}
)
# gpus
(
mkIf (hardware.gpus != [])
{
boot.initrd.availableKernelModules =
let
modules =
{
intel = [ "i915" ];
nvidia = [ "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" ];
amd = [ "amdgpu" ];
};
in
concatLists (map (gpu: modules.${gpu}) hardware.gpus);
hardware =
{
opengl =
{
enable = true;
driSupport = true;
extraPackages =
with inputs.pkgs;
let
packages =
{
intel = [ intel-compute-runtime intel-media-driver libvdpau-va-gl ]; # intel-vaapi-driver
nvidia = [ vaapiVdpau ];
amd = [ amdvlk rocmPackages.clr rocmPackages.clr.icd ];
};
in
concatLists (map (gpu: packages.${gpu}) hardware.gpus);
driSupport32Bit = true;
};
nvidia = mkIf (builtins.elem "nvidia" hardware.gpus)
{
modesetting.enable = true;
powerManagement.enable = true;
dynamicBoost.enable = true;
nvidiaSettings = true;
package = inputs.config.boot.kernelPackages.nvidiaPackages.production;
};
};
}
)
(mkIf (builtins.elem "intel" hardware.gpus) { services.xserver.videoDrivers = [ "modesetting" ]; })
(mkIf (builtins.elem "amd" hardware.gpus) { services.xserver.videoDrivers = [ "modesetting" ]; })
# prime
(
mkIf hardware.prime.enable
{
hardware.nvidia = mkMerge
[
(
mkIf (hardware.prime.mode == "offload")
{
prime.offload = { enable = true; enableOffloadCmd = true; };
powerManagement = { finegrained = true; enable = true; };
}
)
(
mkIf (hardware.prime.mode == "sync")
{
prime = { sync.enable = true; };
# prime.forceFullCompositionPipeline = true;
}
)
{
prime = listToAttrs
(map (gpu: { inherit (gpu) value; name = "${gpu.name}BusId"; }) (attrsToList hardware.prime.busId));
}
];
}
)
{ programs.gamemode.settings.gpu.gpu_device = "${toString hardware.gamemode.drmDevice}"; }
# halo-keyboard
(mkIf hardware.halo-keyboard.enable
(

80
modules/hardware/gpu.nix Normal file
View File

@@ -0,0 +1,80 @@
inputs:
{
options.nixos.hardware.gpu = let inherit (inputs.lib) mkOption types; in
{
type = mkOption
{
type = types.nullOr (types.enum
[
# single gpu
"intel" "nvidia" "amd"
# hibrid gpu: use nvidia prime offload mode
"intel+nvidia" "amd+nvidia"
]);
default = null;
};
prime.busId = mkOption { type = types.attrsOf types.nonEmptyStr; default = {}; };
};
config = let inherit (inputs.config.nixos.hardware) gpu; in inputs.lib.mkIf (gpu.type != null) (inputs.lib.mkMerge
[
# generic settings
(
let gpus = inputs.lib.strings.splitString "+" gpu.type; in
{
boot.initrd.availableKernelModules =
let modules =
{
intel = [ "i915" ];
nvidia = [ "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" ];
amd = [ "amdgpu" ];
};
in builtins.concatLists (builtins.map (gpu: modules.${gpu}) gpus);
hardware =
{
opengl =
{
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages =
let packages = with inputs.pkgs;
{
intel = [ intel-vaapi-driver libvdpau-va-gl intel-media-driver ];
nvidia = [ vaapiVdpau ];
amd = [ amdvlk rocmPackages.clr rocmPackages.clr.icd ];
};
in builtins.concatLists (builtins.map (gpu: packages.${gpu}) gpus);
extraPackages32 =
let packages = { intel = []; nvidia = []; amd = [ inputs.pkgs.driversi686Linux.amdvlk ]; };
in builtins.concatLists (builtins.map (gpu: packages.${gpu}) gpus);
};
nvidia = inputs.lib.mkIf (builtins.elem "nvidia" gpus)
{
modesetting.enable = true;
powerManagement.enable = true;
dynamicBoost.enable = true;
nvidiaSettings = true;
# package = inputs.config.boot.kernelPackages.nvidiaPackages.production;
};
};
boot.kernelParams = inputs.lib.mkIf (builtins.elem "amd" gpus)
[ "radeon.cik_support=0" "amdgpu.cik_support=1" "radeon.si_support=0" "amdgpu.si_support=1" "iommu=pt" ];
environment.variables.VDPAU_DRIVER = inputs.lib.mkIf (builtins.elem "intel" gpus) "va_gl";
services.xserver.videoDrivers =
let driver = { intel = "modesetting"; amd = "amdgpu"; nvidia = "nvidia"; };
in builtins.map (gpu: driver.${gpu}) gpus;
}
)
# nvidia prime offload
(
inputs.lib.mkIf (inputs.lib.strings.hasSuffix "+nvidia" gpu.type) { hardware.nvidia =
{
prime = { offload = { enable = true; enableOffloadCmd = true; }; }
// builtins.listToAttrs (builtins.map
(gpu: { name = "${if gpu.name == "amd" then "amdgpu" else gpu.name}BusId"; value = "PCI:${gpu.value}"; })
(inputs.localLib.attrsToList gpu.prime.busId));
powerManagement.finegrained = true;
};}
)
]);
}

View File

@@ -1,6 +1,6 @@
inputs:
{
imports = inputs.localLib.mkModules [ ./vscode.nix ];
imports = inputs.localLib.mkModules [ ./vscode.nix ./firefox.nix ];
config =
let
inherit (inputs.lib) mkIf;
@@ -30,23 +30,27 @@ inputs:
# media
mpv nomacs
# themes
tela-circle-icon-theme
tela-circle-icon-theme localPackages.win11os-kde localPackages.fluent-kde localPackages.blurred-wallpaper
localPackages.slate utterly-nord-plasma
];
users.sharedModules =
[{
config.home.file.".config/baloofilerc".text =
''
[Basic Settings]
Indexing-Enabled=false
'';
}];
[(homeInputs: {
config.home.file = mkIf (!homeInputs.config.programs.plasma.enable)
{
".config/baloofilerc".text =
''
[Basic Settings]
Indexing-Enabled=false
'';
};
})];
};
programs =
{
adb.enable = true;
wireshark = { enable = true; package = inputs.pkgs.wireshark; };
firefox = { enable = true; languagePacks = [ "zh-CN" "en-US" ]; };
vim.package = inputs.pkgs.vim-full;
yubikey-touch-detector.enable = true;
};
nixpkgs.config.packageOverrides = pkgs:
{

View File

@@ -0,0 +1,58 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
{
nixos.users.sharedModules = [{ config =
{
programs.firefox =
{
enable = true;
# TODO: switch to 24.05
# nativeMessagingHosts = [ inputs.pkgs.plasma-browser-integration ];
package = inputs.pkgs.firefox.override { nativeMessagingHosts = [ inputs.pkgs.plasma-browser-integration ]; };
policies.DefaultDownloadDirectory = "\${home}/Downloads";
profiles.default =
{
extensions = with inputs.pkgs.firefox-addons;
[
immersive-translate tampermonkey bitwarden cookies-txt dualsub firefox-color i-dont-care-about-cookies
metamask pakkujs switchyomega rsshub-radar rsspreview tabliss tree-style-tab ublock-origin wallabagger
wappalyzer grammarly
(
buildFirefoxXpiAddon
{
pname = "zotero-connector";
version = "5.0.114";
addonId = "zotero@chnm.gmu.edu";
url = "https://download.zotero.org/connector/firefox/release/Zotero_Connector-5.0.114.xpi";
sha256 = "1g9d991m4vfj5x6r86sw754bx7r4qi8g5ddlqp7rcw6wrgydhrhw";
meta = {};
}
)
];
search = { default = "Google"; force = true; };
userChrome = builtins.concatStringsSep "\n" (builtins.map
(file: builtins.readFile "${inputs.topInputs.cascade}/chrome/includes/cascade-${file}.css")
[ "config-mouse" "colours" "layout" "responsive" "floating-panel" "nav-bar" "tabs" ]);
settings =
{
# general
"browser.search.region" = "CN";
"intl.locale.requested" = "zh-CN,en-US";
"browser.aboutConfig.showWarning" = false;
"browser.bookmarks.showMobileBookmarks" = true;
"browser.download.panel.shown" = true;
"browser.download.useDownloadDir" = true;
"browser.newtab.extensionControlled" = true;
"browser.toolbars.bookmarks.visibility" = "never";
# allow to apply userChrome.css
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
};
};
home.file.".mozilla/firefox/profiles.ini".force = true;
};}];
# still enable global firefox, to install language packs
programs.firefox = { enable = true; languagePacks = [ "zh-CN" "en-US" ]; };
};
}

View File

@@ -17,7 +17,7 @@ inputs:
{
packages = with inputs.pkgs;
{
_packages =
_packages =
[
# shell
ksh
@@ -51,6 +51,11 @@ inputs:
# development
gdb try inputs.topInputs.plasma-manager.packages.x86_64-linux.rc2nix hexo-cli
] ++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ]);
_pythonPackages = [(pythonPackages: with pythonPackages;
[
openai python-telegram-bot fastapi pypdf2 pandas matplotlib plotly gunicorn redis jinja2
certifi charset-normalizer idna orjson psycopg2 inquirerpy requests tqdm
])];
};
users.sharedModules = [(home-inputs:
{

View File

@@ -41,10 +41,7 @@ inputs:
];
_pythonPackages = [(pythonPackages: with pythonPackages;
[
phonopy tensorflow keras openai scipy scikit-learn jupyterlab autograd
# localPackages.pix2tex
inquirerpy requests python-telegram-bot tqdm fastapi pypdf2 pandas matplotlib plotly gunicorn redis jinja2
certifi charset-normalizer idna orjson psycopg2
phonopy tensorflow keras scipy scikit-learn jupyterlab autograd # localPackages.pix2tex
])];
_prebuildPackages =
[
@@ -71,29 +68,7 @@ inputs:
anime-game-launcher = { enable = true; package = inputs.pkgs.anime-game-launcher; };
honkers-railway-launcher = { enable = true; package = inputs.pkgs.honkers-railway-launcher; };
nix-ld.enable = true;
gamemode =
{
enable = true;
settings =
{
general.renice = 10;
gpu =
{
apply_gpu_optimisations = "accept-responsibility";
nv_powermizer_mode = 1;
};
custom = let notify-send = "${inputs.pkgs.libnotify}/bin/notify-send"; in
{
start = "${notify-send} 'GameMode started'";
end = "${notify-send} 'GameMode ended'";
};
};
};
chromium =
{
enable = true;
extraOpts.PasswordManagerEnabled = false;
};
chromium = { enable = true; extraOpts.PasswordManagerEnabled = false; };
};
};
}

View File

@@ -40,6 +40,7 @@ inputs:
./fail2ban.nix
./wireguard.nix
./akkoma.nix
./gamemode.nix
];
options.nixos.services = let inherit (inputs.lib) mkOption types; in
{

View File

@@ -23,5 +23,6 @@ inputs:
serif = [ "Noto Serif CJK SC" "Source Han Serif SC" "DejaVu Serif" ];
};
};
nixos.users.sharedModules = [{ config.xdg.configFile."fontconfig/conf.d/10-hm-fonts.conf".force = true; }];
};
}

View File

@@ -0,0 +1,30 @@
inputs:
{
options.nixos.services.gamemode = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
drmDevice = mkOption { type = types.int; };
};
config = let inherit (inputs.config.nixos.services) gamemode; in inputs.lib.mkIf gamemode.enable
{
programs.gamemode =
{
enable = true;
settings =
{
general.renice = 10;
gpu =
{
apply_gpu_optimisations = "accept-responsibility";
nv_powermizer_mode = 1;
gpu_device = builtins.toString gamemode.drmDevice;
};
custom = let notify-send = "${inputs.pkgs.libnotify}/bin/notify-send"; in
{
start = "${notify-send} 'GameMode started'";
end = "${notify-send} 'GameMode ended'";
};
};
};
};
}

View File

@@ -19,7 +19,6 @@ inputs:
enable = true;
displayManager = { sddm.enable = true; defaultSession = "plasmawayland"; };
desktopManager.plasma5.enable = true;
videoDrivers = inputs.config.nixos.hardware.gpus;
};
systemd.services.display-manager = { after = [ "network-online.target" ]; enable = gui.autoStart; };
environment =

View File

@@ -56,7 +56,7 @@ inputs:
{
users.chn =
{
directories = [ ".cache" ];
directories = [ ".cache" ".config/fontconfig" ];
};
} else {});
"${impermanence.nodatacow}" =

View File

@@ -39,7 +39,8 @@ inputs:
patches =
{
cjktty =
{
[{
name = "cjktty";
patch =
let
version = builtins.splitVersion inputs.config.boot.kernelPackages.kernel.version;
@@ -54,15 +55,16 @@ inputs:
hashes =
{
"6.1" = "11ddiammvjxx2m9v32p25l1ai759a1d6xhdpszgnihv7g2fzigf5";
"6.6" = "19ib0syj3207ifr315gdrnpv6nhh435fmgl05c7k715nng40i827";
"6.7" = "1yfsmc0873xiwlirir0xfp9zyrpd09q1srgr3z4rl7i7lxzaqls8";
};
in hashes."${major}.${minor}";
};
extraStructuredConfig =
{ FONT_CJK_16x16 = inputs.lib.kernel.yes; FONT_CJK_32x32 = inputs.lib.kernel.yes; };
};
}];
lantian =
{
[{
name = "lantian";
patch = null;
# pick from xddxdd/nur-packages dce93a
extraStructuredConfig = with inputs.lib.kernel;
@@ -79,9 +81,47 @@ inputs:
HZ_250 = inputs.lib.mkForce no;
HZ = inputs.lib.mkForce (freeform "1000");
};
};
}];
surface =
let
version =
let versionArray = builtins.splitVersion inputs.config.boot.kernelPackages.kernel.version;
in "${builtins.elemAt versionArray 0}.${builtins.elemAt versionArray 1}";
kernelPatches = builtins.map
(file:
{
name = "surface-${file.name}";
patch = "${inputs.topInputs.linux-surface}/patches/${version}/${file.name}";
})
(builtins.filter
(file: file.value == "regular")
(inputs.localLib.attrsToList (builtins.readDir
"${inputs.topInputs.linux-surface}/patches/${version}")));
kernelConfig = builtins.removeAttrs
(builtins.listToAttrs (builtins.concatLists (builtins.map
(configString:
if builtins.match "CONFIG_.*=." configString == [] then
(
let match = builtins.match "CONFIG_(.*)=(.)" configString; in with inputs.lib.kernel;
[{
name = builtins.elemAt match 0;
value = { m = module; y = yes; }.${builtins.elemAt match 1};
}]
)
else if builtins.match "# CONFIG_.* is not set" configString == [] then
[{
name = builtins.elemAt (builtins.match "# CONFIG_(.*) is not set" configString) 0;
value = inputs.lib.kernel.unset;
}]
else if builtins.match "#.*" configString == [] then []
else if configString == "" then []
else throw "could not parse: ${configString}"
)
(inputs.lib.strings.splitString "\n"
(builtins.readFile "${inputs.topInputs.linux-surface}/configs/surface-${version}.config")))))
[ "VIDEO_IPU3_IMGU" ];
in kernelPatches ++ [{ name = "surface-config"; patch = null; extraStructuredConfig = kernelConfig; }];
};
in
builtins.map (name: { inherit name; } // patches.${name}) kernel.patches;
in builtins.concatLists (builtins.map (name: patches.${name}) kernel.patches);
};};
}

View File

@@ -1,6 +1,6 @@
inputs:
{
# imports = inputs.localLib.mkModules [ ./plasma.nix ];
imports = inputs.localLib.mkModules [ ./plasma ];
config =
let
inherit (inputs.lib) mkIf;

View File

@@ -1,251 +0,0 @@
inputs:
{
config.home-manager.users.chn.config.programs.plasma =
{
enable = true;
shortcuts = inputs.lib.mkMerge
[
# firefox
{ "firefox.desktop"._launch = "Meta+B"; }
# crow translate
{ "io.crow_translate.CrowTranslate.desktop".TranslateSelectedText = "Ctrl+Alt+E"; }
# display
{
kded5.display = [ "Display" "Meta+P" ];
kwin = { view_actual_size = "Meta+0"; view_zoom_in = [ "Meta++" "Meta+=" ]; view_zoom_out = "Meta+-"; };
org_kde_powerdevil =
{
"Decrease Screen Brightness" = "Monitor Brightness Down";
"Increase Screen Brightness" = "Monitor Brightness Up";
};
}
# volume
{
kmix =
{
decrease_volume = "Volume Down";
increase_volume = "Volume Up";
mic_mute = [ "Meta+Volume Mute" ];
mute = "Volume Mute";
};
}
# session
{
ksmserver = { "Lock Session" = [ "Meta+L" "Screensaver" ]; "Log Out" = "Ctrl+Alt+Del"; };
org_kde_powerdevil."Turn Off Screen" = "Meta+Ctrl+L";
}
# window
{
kwin =
{
Overview = "Meta+Tab";
"Show Desktop" = "Meta+D";
"Suspend Compositing" = "Alt+Shift+F12";
"Walk Through Windows" = "Alt+Tab";
"Walk Through Windows (Reverse)" = "Alt+Shift+Backtab";
"Window Above Other Windows" = "Meta+Shift+PgUp";
"Window Below Other Windows" = "Meta+Shift+PgDown";
"Window Close" = "Alt+F4";
"Window Maximize" = "Meta+PgUp";
"Window Minimize" = "Meta+PgDown";
"Window Operations Menu" = "Alt+F3";
"Window Quick Tile Bottom" = "Meta+Down";
"Window Quick Tile Left" = "Meta+Left";
"Window Quick Tile Right" = "Meta+Right";
"Window Quick Tile Top" = "Meta+Up";
};
}
# virtual desktop
{
kwin =
{
"Switch One Desktop Down" = "Meta+Ctrl+Down";
"Switch One Desktop Up" = "Meta+Ctrl+Up";
"Switch One Desktop to the Left" = "Meta+Ctrl+Left";
"Switch One Desktop to the Right" = "Meta+Ctrl+Right";
"Window One Desktop Down" = "Meta+Ctrl+Shift+Down";
"Window One Desktop Up" = "Meta+Ctrl+Shift+Up";
"Window One Desktop to the Left" = "Meta+Ctrl+Shift+Left";
"Window One Desktop to the Right" = "Meta+Ctrl+Shift+Right";
};
}
# media
{
mediacontrol =
{
nextmedia = "Media Next";
pausemedia = "Media Pause";
playpausemedia = [ "Pause" "Media Play" ];
previousmedia = "Media Previous";
stopmedia = "Media Stop";
};
}
# dolphin
{ "org.kde.dolphin.desktop"._launch = "Meta+E"; }
# konsole
{ "org.kde.konsole.desktop"._launch = "Ctrl+Alt+T"; }
# krunner
{ "org.kde.krunner.desktop"._launch = "Alt+Space"; }
# screenshot
{
"org.kde.spectacle.desktop" =
{
OpenWithoutScreenshot = "Ctrl+Print";
RectangularRegionScreenShot = "Print";
};
}
# settings
{ "systemsettings.desktop"._launch = "Meta+I"; }
# yakuake
{ yakuake.toggle-window-state = "Meta+Space"; }
# virt-manager
{ "virt-manager.desktop"._launch = "Meta+V"; }
];
configFile = inputs.lib.mkMerge
[
# baloo
# "baloofilerc"."Basic Settings"."Indexing-Enabled" = false;
# dolphin
{
dolphinrc =
{
General = { ShowFullPath = true; FilterBar = true; RememberOpenedTabs = false; };
PreviewSettings.Plugins = builtins.concatStringsSep ","
[
"blenderthumbnail"
"comicbookthumbnail"
"djvuthumbnail"
"ebookthumbnail"
"exrthumbnail"
"marble_thumbnail_geojson"
"marble_thumbnail_gpx"
"jpegthumbnail"
"marble_thumbnail_kmz"
"marble_thumbnail_kml"
"kraorathumbnail"
"windowsimagethumbnail"
"windowsexethumbnail"
"mltpreview"
"mobithumbnail"
"opendocumentthumbnail"
"marble_thumbnail_osm"
"palathumbcreator"
"gsthumbnail"
"rawthumbnail"
"svgthumbnail"
"imagethumbnail"
"fontthumbnail"
"directorythumbnail"
"textthumbnail"
"webarchivethumbnail"
"ffmpegthumbs"
"audiothumbnail"
];
};
}
# theme
{
kcminputrc.Mouse.cursorTheme = "breeze_cursors";
}
]
{
"kcminputrc"."Mouse"."cursorTheme" = "breeze_cursors";
"kdeglobals"."KDE"."widgetStyle" = "kvantum";
"kdeglobals"."KFileDialog Settings"."Allow Expansion" = true;
"kdeglobals"."KFileDialog Settings"."Automatically select filename extension" = true;
"kdeglobals"."KFileDialog Settings"."Show Bookmarks" = true;
"kdeglobals"."KFileDialog Settings"."Show Full Path" = true;
"kdeglobals"."KFileDialog Settings"."Show Inline Previews" = true;
"kdeglobals"."KFileDialog Settings"."Show Preview" = true;
"kdeglobals"."KFileDialog Settings"."Show Speedbar" = true;
"kdeglobals"."KFileDialog Settings"."Show hidden files" = true;
"kdeglobals"."KFileDialog Settings"."Sort by" = "Name";
"kdeglobals"."KFileDialog Settings"."Sort directories first" = true;
"kdeglobals"."KFileDialog Settings"."Sort hidden files last" = true;
"kdeglobals"."KFileDialog Settings"."View Style" = "DetailTree";
"krunnerrc"."General"."FreeFloating" = true;
"krunnerrc"."Plugins"."baloosearchEnabled" = false;
"kscreenlockerrc"."Daemon"."Autolock" = false;
# https://www.fanbox.cc/@peas0125/posts/5405326
"kscreenlockerrc"."Greeter.Wallpaper.org.kde.image.General"."Image" = ./wallpaper/fanbox-5405326-x4-chop.png;
"kscreenlockerrc"."Greeter.Wallpaper.org.kde.image.General"."PreviewImage" =
./wallpaper/fanbox-5405326-x4-chop.png;
"kwinrc"."Effect-blur"."BlurStrength" = 10;
"kwinrc"."Effect-kwin4_effect_translucency"."MoveResize" = 75;
"kwinrc"."Effect-wobblywindows"."AdvancedMode" = true;
"kwinrc"."Effect-wobblywindows"."Drag" = 85;
"kwinrc"."Effect-wobblywindows"."Stiffness" = 10;
"kwinrc"."Effect-wobblywindows"."WobblynessLevel" = 1;
"kwinrc"."Plugins"."blurEnabled" = true;
"kwinrc"."Plugins"."contrastEnabled" = false;
"kwinrc"."Plugins"."kwin4_effect_dimscreenEnabled" = true;
"kwinrc"."Plugins"."kwin4_effect_translucencyEnabled" = true;
"kwinrc"."Plugins"."padding" = 4;
"kwinrc"."Plugins"."wobblywindowsEnabled" = true;
"kwinrc"."SubSession: 3435a388-a8b3-4d1d-9794-b8c30162ce16"."active" = "-1";
"kwinrc"."SubSession: 3435a388-a8b3-4d1d-9794-b8c30162ce16"."count" = 0;
"kwinrc"."SubSession: 6a473a77-85df-4e49-8c74-bdb06d1f0efd"."active" = "-1";
"kwinrc"."SubSession: 6a473a77-85df-4e49-8c74-bdb06d1f0efd"."count" = 0;
"kwinrc"."Tiling"."padding" = 4;
"kwinrc"."Wayland"."InputMethod[$e]" = "/run/current-system/sw/share/applications/org.fcitx.Fcitx5.desktop";
"kwinrc"."Windows"."RollOverDesktops" = true;
"kwinrc"."Xwayland"."Scale" = 1;
"kwinrc"."Xwayland"."XwaylandEavesdrops" = "Combinations";
"kwinrc"."org.kde.kdecoration2"."ButtonsOnLeft" = "M";
"kwinrc"."org.kde.kdecoration2"."ButtonsOnRight" = "BFIAX";
"kwinrulesrc"."06734e18-08f2-47f9-a6dc-9085d95fe9b0"."Description" = "org.kde.kruler ";
"kwinrulesrc"."06734e18-08f2-47f9-a6dc-9085d95fe9b0"."above" = true;
"kwinrulesrc"."06734e18-08f2-47f9-a6dc-9085d95fe9b0"."aboverule" = 2;
"kwinrulesrc"."06734e18-08f2-47f9-a6dc-9085d95fe9b0"."skipswitcher" = true;
"kwinrulesrc"."06734e18-08f2-47f9-a6dc-9085d95fe9b0"."skipswitcherrule" = 2;
"kwinrulesrc"."06734e18-08f2-47f9-a6dc-9085d95fe9b0"."wmclass" = "org.kde.kruler";
"kwinrulesrc"."06734e18-08f2-47f9-a6dc-9085d95fe9b0"."wmclassmatch" = 1;
"kwinrulesrc"."1"."Description" = "element ";
"kwinrulesrc"."1"."activity" = "00000000-0000-0000-0000-000000000000";
"kwinrulesrc"."1"."activityrule" = 2;
"kwinrulesrc"."1"."wmclass" = "element";
"kwinrulesrc"."1"."wmclassmatch" = 1;
"kwinrulesrc"."2"."Description" = "org.telegram.desktop ";
"kwinrulesrc"."2"."activity" = "00000000-0000-0000-0000-000000000000";
"kwinrulesrc"."2"."activityrule" = 2;
"kwinrulesrc"."2"."wmclass" = "org.telegram.desktop";
"kwinrulesrc"."2"."wmclassmatch" = 1;
"kwinrulesrc"."3"."Description" = "org.kde.kruler ";
"kwinrulesrc"."3"."above" = true;
"kwinrulesrc"."3"."aboverule" = 2;
"kwinrulesrc"."3"."skipswitcher" = true;
"kwinrulesrc"."3"."skipswitcherrule" = 2;
"kwinrulesrc"."3"."wmclass" = "org.kde.kruler";
"kwinrulesrc"."3"."wmclassmatch" = 1;
"kwinrulesrc"."8c1ccf0b-abf4-4d24-a848-522a76a2440d"."Description" = "element ";
"kwinrulesrc"."8c1ccf0b-abf4-4d24-a848-522a76a2440d"."activity" = "00000000-0000-0000-0000-000000000000";
"kwinrulesrc"."8c1ccf0b-abf4-4d24-a848-522a76a2440d"."activityrule" = 2;
"kwinrulesrc"."8c1ccf0b-abf4-4d24-a848-522a76a2440d"."wmclass" = "element";
"kwinrulesrc"."8c1ccf0b-abf4-4d24-a848-522a76a2440d"."wmclassmatch" = 1;
"kwinrulesrc"."General"."count" = 3;
"kwinrulesrc"."General"."rules" = "1,2,3";
"kwinrulesrc"."e75e010c-c094-4e6c-a98e-fe011e563466"."Description" = "org.telegram.desktop ";
"kwinrulesrc"."e75e010c-c094-4e6c-a98e-fe011e563466"."activity" = "00000000-0000-0000-0000-000000000000";
"kwinrulesrc"."e75e010c-c094-4e6c-a98e-fe011e563466"."activityrule" = 2;
"kwinrulesrc"."e75e010c-c094-4e6c-a98e-fe011e563466"."wmclass" = "org.telegram.desktop";
"kwinrulesrc"."e75e010c-c094-4e6c-a98e-fe011e563466"."wmclassmatch" = 1;
"kxkbrc"."Layout"."DisplayNames" = "";
"kxkbrc"."Layout"."LayoutList" = "us";
"kxkbrc"."Layout"."Use" = true;
"kxkbrc"."Layout"."VariantList" = "";
"plasma-localerc"."Formats"."LANG" = "en_US.UTF-8";
"plasma-localerc"."Translations"."LANGUAGE" = "zh_CN";
"plasmanotifyrc"."Notifications"."PopupPosition" = "BottomRight";
"plasmarc"."Wallpapers"."usersWallpapers" = "/home/chn/Desktop/./twin_96734339_x2.png,/home/chn/Desktop/./E_yCTfDUUAgykjX_x8.jpeg,/home/chn/Desktop/./102692178_p0_[L1][x2.00].png,/home/chn/Desktop/./111392869_p0.png,/home/chn/Desktop/./HlszomyrfyxKLtpkVixEtikq_x4_chop.png";
};
};
}

View File

@@ -0,0 +1,63 @@
inputs:
{
config = inputs.lib.mkIf inputs.config.nixos.system.gui.enable
{
home-manager.users.chn.config.home.file =
let
programs =
{
nheko =
let
drv = inputs.pkgs.writeTextDir "nheko.desktop" (builtins.replaceStrings
[ "Exec=nheko %u" ] [ "Exec=bash -c 'sleep 5 && nheko'" ]
(builtins.readFile "${inputs.pkgs.nheko}/share/applications/nheko.desktop"));
in "${drv}/nheko.desktop";
kclockd = "${inputs.pkgs.plasma5Packages.kdeGear.kclock}/etc/xdg/autostart/org.kde.kclockd-autostart.desktop";
yakuake = "${inputs.pkgs.yakuake}/share/applications/org.kde.yakuake.desktop";
telegram =
let
drv = inputs.pkgs.writeTextDir "org.telegram.desktop.desktop" (builtins.replaceStrings
[ "Exec=telegram-desktop -- %u" ] [ "Exec=bash -c 'sleep 5 && telegram-desktop -autostart'" ]
(builtins.readFile "${inputs.pkgs.telegram-desktop}/share/applications/org.telegram.desktop.desktop"));
in "${drv}/org.telegram.desktop.desktop";
element =
let
drv = inputs.pkgs.writeTextDir "element-desktop.desktop" (builtins.replaceStrings
[ "Exec=element-desktop %u" ] [ "Exec=element-desktop --hidden" ]
(builtins.readFile
"${inputs.pkgs.element-desktop.desktopItem}/share/applications/element-desktop.desktop"));
in "${drv}/element-desktop.desktop";
# kmail =
# let
# drv = inputs.pkgs.writeTextDir "org.kde.kmail2.desktop" (builtins.replaceStrings
# [ "Exec=kmail -qwindowtitle %c %u" ] [ "Exec=bash -c 'sleep 5 && kmail -qwindowtitle'" ]
# (builtins.readFile "${inputs.pkgs.kmail}/share/applications/org.kde.kmail2.desktop"));
# in "${drv}/org.kde.kmail2.desktop";
kmail = "${inputs.pkgs.kmail}/share/applications/org.kde.kmail2.desktop";
discord =
let
drv = inputs.pkgs.writeTextDir "discord.desktop" (builtins.replaceStrings
[ "Exec=Discord" ] [ "Exec=Discord --start-minimized" ]
(builtins.readFile "${inputs.pkgs.discord.desktopItem}/share/applications/discord.desktop"));
in "${drv}/discord.desktop";
};
devices =
{
pc = [ "nheko" "kclockd" "yakuake" "telegram" "element" "kmail" "discord" ];
surface = [ "kclockd" "yakuake" "telegram" "element" ];
};
in builtins.listToAttrs (builtins.map
(file:
{
name = ".config/autostart/${builtins.baseNameOf (builtins.unsafeDiscardStringContext programs.${file})}";
value.source = programs.${file};
})
(devices.${inputs.config.nixos.system.networking.hostname} or []));
environment.persistence =
let impermanence = inputs.config.nixos.system.impermanence;
in inputs.lib.mkIf impermanence.enable
{
"${impermanence.root}".users.chn.directories = [ ".config/autostart" ];
};
};
}

View File

@@ -0,0 +1,17 @@
[Desktop Entry]
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
TryExec=telegram-desktop
Exec=bash -c "sleep 5 && telegram-desktop -autostart"
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Chat;Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;
Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;
Actions=quit;
DBusActivatable=true
SingleMainWindow=true
X-GNOME-UsesNotifications=true
X-GNOME-SingleWindow=true

View File

@@ -0,0 +1,94 @@
inputs:
{
imports = inputs.localLib.mkModules [ ./autostart ./wallpaper ./konsole.nix ./shortcuts.nix ./theme.nix ];
config = inputs.lib.mkIf inputs.config.nixos.system.gui.enable
{
home-manager.users.chn.config.programs.plasma = inputs.lib.mkMerge
[
# TODO: autostart, panel, discard user changed settings
# general
{
enable = true;
configFile.plasma-localerc = { Formats.LANG = "en_US.UTF-8"; Translations.LANGUAGE = "zh_CN"; };
}
# kwin
{
kwin.titlebarButtons.right = [ "help" "keep-below-windows" "keep-above-windows" "minimize" "maximize" "close" ];
windows.allowWindowsToRememberPositions = false;
configFile =
{
plasmanotifyrc.Notifications.PopupPosition = "BottomRight";
kwinrc =
{
Tiling.padding = 4;
Wayland."InputMethod[$e]" = "/run/current-system/sw/share/applications/org.fcitx.Fcitx5.desktop";
Windows.RollOverDesktops = true;
Compositing = { AllowTearing = false; WindowsBlockCompositing = false; };
};
};
}
# baloo
{ configFile.baloofilerc."Basic Settings".Indexing-Enabled = false; }
# dolphin and file chooser
{
configFile =
{
dolphinrc =
{
General = { ShowFullPath = true; FilterBar = true; RememberOpenedTabs = false; };
PreviewSettings.Plugins = builtins.concatStringsSep ","
[
"blenderthumbnail"
"comicbookthumbnail"
"djvuthumbnail"
"ebookthumbnail"
"exrthumbnail"
"marble_thumbnail_geojson"
"marble_thumbnail_gpx"
"jpegthumbnail"
"marble_thumbnail_kmz"
"marble_thumbnail_kml"
"kraorathumbnail"
"windowsimagethumbnail"
"windowsexethumbnail"
"mltpreview"
"mobithumbnail"
"opendocumentthumbnail"
"marble_thumbnail_osm"
"palathumbcreator"
"gsthumbnail"
"rawthumbnail"
"svgthumbnail"
"imagethumbnail"
"fontthumbnail"
"directorythumbnail"
"textthumbnail"
"webarchivethumbnail"
"ffmpegthumbs"
"audiothumbnail"
];
};
kdeglobals."KFileDialog Settings" =
{
"Allow Expansion" = true;
"Automatically select filename extension" = true;
"Show Bookmarks" = true;
"Show Full Path" = true;
"Show Inline Previews" = true;
"Show Preview" = true;
"Show Speedbar" = true;
"Show hidden files" = true;
"Sort by" = "Name";
"Sort directories first" = true;
"Sort hidden files last" = true;
"View Style" = "DetailTree";
};
};
}
# krunner
{ configFile.krunnerrc = { General.FreeFloating = true; Plugins.baloosearchEnabled = false; }; }
# lock screen
{ configFile.kscreenlockerrc.Daemon.Autolock = false; }
];
};
}

View File

@@ -0,0 +1,81 @@
inputs:
{
config = inputs.lib.mkIf inputs.config.nixos.system.gui.enable
{
home-manager.users.chn.config =
{
programs.plasma =
{
overrideConfig = true;
overrideConfigFiles = [ "konsolerc" "yakuakerc" ];
configFile =
{
yakuakerc =
{
Appearance =
{
HideSkinBorders = true;
Skin = "Slate";
Translucency = true;
};
"Desktop Entry".DefaultProfile = "plasma-manager.profile";
Dialogs.FirstRun = false;
Window =
{
KeepOpen = false;
KeepOpenAfterLastSessionCloses = true;
ShowSystrayIcon = false;
};
};
konsolerc =
{
"Desktop Entry".DefaultProfile = "plasma-manager.profile";
"MainWindow.Toolbar sessionToolbar".ToolButtonStyle = "IconOnly";
};
};
dataFile."konsole/plasma-manager.profile" =
{
Appearance =
{
AntiAliasFonts = true;
BoldIntense = true;
ColorScheme = "Breeze";
Font = "FiraCode Nerd Font Mono,10,-1,5,50,0,0,0,0,0";
UseFontLineChararacters = true;
WordModeAttr = false;
};
"Cursor Options".CursorShape = 1;
General =
{
Name = "plasma-manager";
Parent = "FALLBACK/";
TerminalCenter = true;
TerminalMargin = 1;
};
"Interaction Options" =
{
AutoCopySelectedText = true;
TrimLeadingSpacesInSelectedText = true;
TrimTrailingSpacesInSelectedText = true;
UnderlineFilesEnabled = true;
};
Scrolling =
{
HistoryMode = 2;
ReflowLines = false;
};
"Terminal Features".BlinkingCursorEnabled = true;
};
};
home.file.".local/share/konsole/Breeze.colorscheme".text = builtins.replaceStrings
[ "Opacity=1" ] [ "Opacity=0.9\nBlur=true" ]
(builtins.readFile "${inputs.pkgs.konsole}/share/konsole/Breeze.colorscheme");
};
environment.persistence =
let impermanence = inputs.config.nixos.system.impermanence;
in inputs.lib.mkIf impermanence.enable
{
"${impermanence.root}".users.chn.directories = [ ".local/share/konsole" ".local/share/yakuake" ];
};
};
}

View File

@@ -0,0 +1,102 @@
inputs:
{
config = inputs.lib.mkIf inputs.config.nixos.system.gui.enable
{
home-manager.users.chn.config.programs.plasma =
{
spectacle.shortcuts.captureRectangularRegion = "Print";
shortcuts = inputs.lib.mkMerge
[
# firefox
{ "firefox.desktop"._launch = "Meta+B"; }
# crow translate
{ "io.crow_translate.CrowTranslate.desktop".TranslateSelectedText = "Ctrl+Alt+E"; }
# display
{
kded5.display = [ "Display" "Meta+P" ];
kwin = { view_actual_size = "Meta+0"; view_zoom_in = [ "Meta++" "Meta+=" ]; view_zoom_out = "Meta+-"; };
org_kde_powerdevil =
{
"Decrease Screen Brightness" = "Monitor Brightness Down";
"Increase Screen Brightness" = "Monitor Brightness Up";
};
}
# volume
{
kmix =
{
decrease_volume = "Volume Down";
increase_volume = "Volume Up";
mic_mute = [ "Meta+Volume Mute" ];
mute = "Volume Mute";
};
}
# session
{
ksmserver = { "Lock Session" = [ "Meta+L" "Screensaver" ]; "Log Out" = "Ctrl+Alt+Del"; };
org_kde_powerdevil."Turn Off Screen" = "Meta+Ctrl+L";
}
# window
{
kwin =
{
ExposeAll = "Meta+Tab";
"Show Desktop" = "Meta+D";
"Suspend Compositing" = "Alt+Shift+F12";
"Walk Through Windows" = "Alt+Tab";
"Walk Through Windows (Reverse)" = "Alt+Shift+Backtab";
"Window Above Other Windows" = "Meta+Shift+PgUp";
"Window Below Other Windows" = "Meta+Shift+PgDown";
"Window Close" = "Alt+F4";
"Window Maximize" = "Meta+PgUp";
"Window Minimize" = "Meta+PgDown";
"Window Operations Menu" = "Alt+F3";
"Window Quick Tile Bottom" = "Meta+Down";
"Window Quick Tile Left" = "Meta+Left";
"Window Quick Tile Right" = "Meta+Right";
"Window Quick Tile Top" = "Meta+Up";
};
}
# virtual desktop
{
kwin =
{
"Switch One Desktop Down" = "Meta+Ctrl+Down";
"Switch One Desktop Up" = "Meta+Ctrl+Up";
"Switch One Desktop to the Left" = "Meta+Ctrl+Left";
"Switch One Desktop to the Right" = "Meta+Ctrl+Right";
"Window One Desktop Down" = "Meta+Ctrl+Shift+Down";
"Window One Desktop Up" = "Meta+Ctrl+Shift+Up";
"Window One Desktop to the Left" = "Meta+Ctrl+Shift+Left";
"Window One Desktop to the Right" = "Meta+Ctrl+Shift+Right";
};
}
# media
{
mediacontrol =
{
nextmedia = "Media Next";
pausemedia = "Media Pause";
playpausemedia = [ "Pause" "Media Play" ];
previousmedia = "Media Previous";
stopmedia = "Media Stop";
};
}
# dolphin
{ "org.kde.dolphin.desktop"._launch = "Meta+E"; }
# konsole
{ "org.kde.konsole.desktop"._launch = "Ctrl+Alt+T"; }
# krunner
{ "org.kde.krunner.desktop"._launch = "Alt+Space"; }
# settings
{ "systemsettings.desktop"._launch = "Meta+I"; }
# yakuake
{ yakuake.toggle-window-state = "Meta+Space"; }
# virt-manager
{ "virt-manager.desktop"._launch = "Meta+V"; }
# system monitor
{ "org.kde.plasma-systemmonitor.desktop"._launch = "Meta+Esc"; }
];
};
};
}

View File

@@ -0,0 +1,36 @@
inputs:
{
config = inputs.lib.mkIf inputs.config.nixos.system.gui.enable
{
home-manager.users.chn.config.programs.plasma =
{
workspace =
{
theme = "Fluent-round-light";
colorScheme = "FluentLight";
cursorTheme = "Breeze_Snow";
lookAndFeel = "com.github.vinceliuice.Fluent-round-light";
iconTheme = "Tela-circle";
};
configFile =
{
kdeglobals.KDE.widgetStyle = "kvantum";
"Kvantum/kvantum.kvconfig".General.theme = "Fluent-round";
kwinrc =
{
Effect-blur.BlurStrength = 10;
Effect-kwin4_effect_translucency.MoveResize = 75;
Effect-wobblywindows = { AdvancedMode = true; Drag = 85; Stiffness = 10; WobblynessLevel = 1; };
Plugins =
{
blurEnabled = true;
kwin4_effect_dimscreenEnabled = true;
kwin4_effect_translucencyEnabled = true;
padding = 4;
wobblywindowsEnabled = true;
};
};
};
};
};
}

View File

@@ -0,0 +1,13 @@
inputs:
{
config.home-manager.users.chn.config.programs.plasma.configFile =
let wallpaper = "${./pixiv-96734339-x2.png}"; in
{
"plasma-org.kde.plasma.desktop-appletsrc" =
{
"Containments.1".wallpaperplugin = "a2n.blur";
"Containments.1.Wallpaper.a2n\\.blur.General".Image = wallpaper;
};
kscreenlockerrc."Greeter.Wallpaper.org\\.kde\\.image.General" = { Image = wallpaper; PreviewImage = wallpaper; };
};
}

Binary file not shown.

View File

@@ -37,7 +37,7 @@ inputs:
setSocketVariable = true;
daemon.settings = { features.buildkit = true; dns = [ "1.1.1.1" ]; storage-driver = "overlay2"; };
};
enableNvidia = builtins.elem "nvidia" inputs.config.nixos.hardware.gpus;
enableNvidia = inputs.lib.strings.hasInfix "nvidia" inputs.config.nixos.hardware.gpu.type;
storageDriver = "overlay2";
};
nixos.services.firewall.trustedInterfaces = [ "docker0" ];