mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-05-28 18:39:31 +02:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f9368749b5 | |||
| 3c409bd83a | |||
| 01448b6e0e | |||
| e54af73cb2 | |||
| 7da0b208e6 | |||
| 0fe704c32a | |||
| 273bfd2ac8 | |||
| 09a01ff947 | |||
| 1ef015cb16 | |||
| 52dfcea713 | |||
| 863f124b08 | |||
| 7a78b1831c | |||
| 13bb77108c | |||
| d10b30b06b | |||
| 4d218e314c | |||
| 87229f9a31 | |||
| bc163b8157 | |||
| 30fefb0f5f | |||
| 8124b9ffa9 | |||
| 77c9514b88 | |||
| bc2523302d | |||
| 31c1139dbd | |||
| 32fa706f9f | |||
| 18cabc994c | |||
| 4bb92855e7 | |||
| fa7bfabf48 | |||
| 9bd5c5b727 | |||
| 88f85bb5d7 | |||
| 70154b0652 | |||
| e226d4b28f | |||
| 58dc1d49f6 | |||
| 90f36202a9 | |||
| 9548fef641 | |||
| e0fe69b887 | |||
| d3c4fd6aa3 |
@@ -77,7 +77,7 @@ shell:
|
|||||||
[group('nix')]
|
[group('nix')]
|
||||||
fmt:
|
fmt:
|
||||||
# format the nix files in this repo
|
# format the nix files in this repo
|
||||||
nix fmt
|
ls **/*.nix | each { |it| nixfmt $it.name }
|
||||||
|
|
||||||
# Show all the auto gc roots in the nix store
|
# Show all the auto gc roots in the nix store
|
||||||
[group('nix')]
|
[group('nix')]
|
||||||
|
|||||||
@@ -133,10 +133,10 @@ nix-shell -p just nushell
|
|||||||
# 4. comment out the proxy settings in scripts/darwin_set_proxy.py if the proxy is not ready yet.
|
# 4. comment out the proxy settings in scripts/darwin_set_proxy.py if the proxy is not ready yet.
|
||||||
|
|
||||||
# deploy fern's configuration(Apple Silicon)
|
# deploy fern's configuration(Apple Silicon)
|
||||||
just fe
|
just fr
|
||||||
|
|
||||||
# deploy with details
|
# deploy with details
|
||||||
just fe debug
|
just fr debug
|
||||||
```
|
```
|
||||||
|
|
||||||
> [What y'all will need when Nix drives you to drink.](https://www.youtube.com/watch?v=Eni9PPPPBpg)
|
> [What y'all will need when Nix drives you to drink.](https://www.youtube.com/watch?v=Eni9PPPPBpg)
|
||||||
|
|||||||
Generated
+50
-49
@@ -54,11 +54,11 @@
|
|||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "blender",
|
"dir": "blender",
|
||||||
"lastModified": 1746378999,
|
"lastModified": 1752701743,
|
||||||
"narHash": "sha256-aF+uC/aYR4I7VxN9s0gQG1WRDTE0Re3jAMd0qBkWjV4=",
|
"narHash": "sha256-cQeX9PP5F7fgsuv0CrL16GtlU6MS0i9LLnkkITu8jA8=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "nix-warez",
|
"repo": "nix-warez",
|
||||||
"rev": "85d76721132cc6631bbaa8c950d4d0f3aa4003fd",
|
"rev": "69acfebb3740542936f71775bcdf322dc328a655",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -75,11 +75,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752227483,
|
"lastModified": 1753702336,
|
||||||
"narHash": "sha256-eetITGJfURryoHY5gfuE9/4sEV9aSgzhPxgsQgofNa8=",
|
"narHash": "sha256-IVFUQV6egGQHnm+I183OT+4ct/ka1IWA5u/0A9I/YV4=",
|
||||||
"owner": "catppuccin",
|
"owner": "catppuccin",
|
||||||
"repo": "nix",
|
"repo": "nix",
|
||||||
"rev": "5f431aac1a4038c385e6de2d2384d943e4802d61",
|
"rev": "b32de96c3c5384c83b0f4d741ec58a7f97c9ab11",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -256,11 +256,11 @@
|
|||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751413152,
|
"lastModified": 1753121425,
|
||||||
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
|
"narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
|
"rev": "644e0fc48951a860279da645ba77fe4a6e814c5e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -277,11 +277,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751413152,
|
"lastModified": 1753121425,
|
||||||
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
|
"narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
|
"rev": "644e0fc48951a860279da645ba77fe4a6e814c5e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -335,11 +335,11 @@
|
|||||||
"zon2nix": "zon2nix"
|
"zon2nix": "zon2nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752207706,
|
"lastModified": 1753722074,
|
||||||
"narHash": "sha256-6Fiy+icid2rKXL9oKcRd3zuITSwtdnShqCPp0Evt3fM=",
|
"narHash": "sha256-yGQ28k8iz2tGrj5oo/HBkn0ihWA5uUZ1ZErkMtegzTw=",
|
||||||
"owner": "ghostty-org",
|
"owner": "ghostty-org",
|
||||||
"repo": "ghostty",
|
"repo": "ghostty",
|
||||||
"rev": "4aa28988a6ddd9aa8b3402e4bab05ad02a0c12c6",
|
"rev": "92c1f4b0b9c6fde6d8f79109de71bf4e30831e86",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -424,11 +424,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748000383,
|
"lastModified": 1752595130,
|
||||||
"narHash": "sha256-EaAJhwfJGBncgIV/0NlJviid2DP93cTMc9h0q6P6xXk=",
|
"narHash": "sha256-CNBgr4OZSuklGtNOa9CnTNo9+Xceqn/EDAC1Tc43fH8=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "hercules-ci-effects",
|
"repo": "hercules-ci-effects",
|
||||||
"rev": "231726642197817d20310b9d39dd4afb9e899489",
|
"rev": "5f2e09654b2e70ba643e41609d9f9b6640f22113",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -465,11 +465,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752202894,
|
"lastModified": 1753807879,
|
||||||
"narHash": "sha256-knafgng4gCjZIUMyAEWjxxdols6n/swkYnbWr+oF+1w=",
|
"narHash": "sha256-d8nxwjUxnRyLWc5G/CpGVsqcSU3ZolS/QYWm9L+/CG0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "fab659b346c0d4252208434c3c4b3983a4b38fec",
|
"rev": "25deca893974aae98c9be151fb47d6284c053470",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -567,11 +567,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752199489,
|
"lastModified": 1753582293,
|
||||||
"narHash": "sha256-p2zkn8fdLvZ19MgAA5CdiuQWQ/gE3YNg1Nhbm4EAflI=",
|
"narHash": "sha256-CimzlksXOfuPcLr4ye/s4hwZhHk98f0gnXB6Dq9RhZo=",
|
||||||
"owner": "fufexan",
|
"owner": "fufexan",
|
||||||
"repo": "nix-gaming",
|
"repo": "nix-gaming",
|
||||||
"rev": "62f976ed47de88323770646a9a92e4912d33585f",
|
"rev": "ceb9d44f09b0db02332873247a50210a486959ff",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -647,11 +647,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752113924,
|
"lastModified": 1753324041,
|
||||||
"narHash": "sha256-mbAHO0rZDBdSosV4LIk9s/3IH1ZhQY9ELixieo+iEns=",
|
"narHash": "sha256-2JZ82g01Lo3f0SNP2WSDZ0ER1FnAN2WicULZkoEsRx0=",
|
||||||
"owner": "nixpak",
|
"owner": "nixpak",
|
||||||
"repo": "nixpak",
|
"repo": "nixpak",
|
||||||
"rev": "19942ded45bd73c74dbb44642406da0569f639a8",
|
"rev": "fedd4b59b7c8f18be508dee9d89985a8501982d0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -675,11 +675,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-darwin": {
|
"nixpkgs-darwin": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751949589,
|
"lastModified": 1753722563,
|
||||||
"narHash": "sha256-mgFxAPLWw0Kq+C8P3dRrZrOYEQXOtKuYVlo9xvPntt8=",
|
"narHash": "sha256-FK8iq76wlacriq3u0kFCehsRYTAqjA9nfprpiSWRWIc=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9b008d60392981ad674e04016d25619281550a9d",
|
"rev": "648f70160c03151bc2121d179291337ad6bc564b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -706,11 +706,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-ollama": {
|
"nixpkgs-ollama": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751984180,
|
"lastModified": 1753694789,
|
||||||
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
|
"narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
|
"rev": "dc9637876d0dcc8c9e5e22986b857632effeb727",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -738,11 +738,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-stable_2": {
|
"nixpkgs-stable_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751943650,
|
"lastModified": 1753489912,
|
||||||
"narHash": "sha256-7orTnNqkGGru8Je6Un6mq1T8YVVU/O5kyW4+f9C1mZQ=",
|
"narHash": "sha256-uDCFHeXdRIgJpYmtcUxGEsZ+hYlLPBhR83fdU+vbC1s=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "88983d4b665fb491861005137ce2b11a9f89f203",
|
"rev": "13e8d35b7d6028b7198f8186bc0347c6abaa2701",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -754,11 +754,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751984180,
|
"lastModified": 1753694789,
|
||||||
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
|
"narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
|
"rev": "dc9637876d0dcc8c9e5e22986b857632effeb727",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -770,11 +770,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751984180,
|
"lastModified": 1753694789,
|
||||||
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
|
"narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
|
"rev": "dc9637876d0dcc8c9e5e22986b857632effeb727",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -828,11 +828,11 @@
|
|||||||
"polybar-themes": {
|
"polybar-themes": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750950071,
|
"lastModified": 1753542051,
|
||||||
"narHash": "sha256-Hanx8zEueKvI4jBrcUQIo6GnkzcS2TgsixBLS8V9ZKM=",
|
"narHash": "sha256-f/54m7RJnqNW6eC/75IrnFxmSWTY+zd5epm6TQsYeYA=",
|
||||||
"owner": "adi1090x",
|
"owner": "adi1090x",
|
||||||
"repo": "polybar-themes",
|
"repo": "polybar-themes",
|
||||||
"rev": "ccf23ef328f1e988650487c40678c6953038e2b2",
|
"rev": "e6326ff356b296256b7fac9c5bcc42a1ef4a4d5b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -853,13 +853,13 @@
|
|||||||
"lastModified": 1750779888,
|
"lastModified": 1750779888,
|
||||||
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
|
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
|
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1058,7 +1058,8 @@
|
|||||||
"zig": {
|
"zig": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
"ghostty"
|
"ghostty",
|
||||||
|
"flake-compat"
|
||||||
],
|
],
|
||||||
"flake-utils": [
|
"flake-utils": [
|
||||||
"ghostty",
|
"ghostty",
|
||||||
@@ -1104,8 +1105,8 @@
|
|||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "jcollie",
|
"owner": "jcollie",
|
||||||
"ref": "56c159be489cc6c0e73c3930bd908ddc6fe89613",
|
|
||||||
"repo": "zon2nix",
|
"repo": "zon2nix",
|
||||||
|
"rev": "56c159be489cc6c0e73c3930bd908ddc6fe89613",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
|
|
||||||
# add git hooks to format nix code before commit
|
# add git hooks to format nix code before commit
|
||||||
pre-commit-hooks = {
|
pre-commit-hooks = {
|
||||||
url = "github:cachix/pre-commit-hooks.nix";
|
url = "github:cachix/git-hooks.nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
services.dbus.apparmor = "enabled";
|
services.dbus.apparmor = "enabled";
|
||||||
security.apparmor = {
|
security.apparmor = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(_: super: {
|
(_: super: {
|
||||||
bwraps = {
|
bwraps = {
|
||||||
wechat = super.callPackage ./wechat.nix {};
|
wechat = super.callPackage ./wechat.nix { };
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
+50
-49
@@ -10,7 +10,8 @@
|
|||||||
appimageTools,
|
appimageTools,
|
||||||
fetchurl,
|
fetchurl,
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
pname = "wechat";
|
pname = "wechat";
|
||||||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/we/wechat/package.nix
|
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/we/wechat/package.nix
|
||||||
sources = {
|
sources = {
|
||||||
@@ -41,58 +42,58 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
appimageTools.wrapAppImage {
|
appimageTools.wrapAppImage {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
|
|
||||||
src = appimageContents;
|
src = appimageContents;
|
||||||
|
|
||||||
extraInstallCommands = ''
|
extraInstallCommands = ''
|
||||||
mkdir -p $out/share/applications
|
mkdir -p $out/share/applications
|
||||||
cp ${appimageContents}/wechat.desktop $out/share/applications/
|
cp ${appimageContents}/wechat.desktop $out/share/applications/
|
||||||
mkdir -p $out/share/pixmaps
|
mkdir -p $out/share/pixmaps
|
||||||
cp ${appimageContents}/wechat.png $out/share/pixmaps/
|
cp ${appimageContents}/wechat.png $out/share/pixmaps/
|
||||||
|
|
||||||
substituteInPlace $out/share/applications/wechat.desktop --replace-fail AppRun wechat
|
substituteInPlace $out/share/applications/wechat.desktop --replace-fail AppRun wechat
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Add these root paths to FHS sandbox to prevent WeChat from accessing them by default
|
# Add these root paths to FHS sandbox to prevent WeChat from accessing them by default
|
||||||
# Adapted from https://aur.archlinux.org/cgit/aur.git/tree/wechat-universal.sh?h=wechat-universal-bwrap
|
# Adapted from https://aur.archlinux.org/cgit/aur.git/tree/wechat-universal.sh?h=wechat-universal-bwrap
|
||||||
extraPreBwrapCmds = ''
|
extraPreBwrapCmds = ''
|
||||||
XDG_DOCUMENTS_DIR="''${XDG_DOCUMENTS_DIR:-$(xdg-user-dir DOCUMENTS)}"
|
XDG_DOCUMENTS_DIR="''${XDG_DOCUMENTS_DIR:-$(xdg-user-dir DOCUMENTS)}"
|
||||||
if [[ -z "''${XDG_DOCUMENTS_DIR}" ]]; then
|
if [[ -z "''${XDG_DOCUMENTS_DIR}" ]]; then
|
||||||
echo 'Error: Failed to get XDG_DOCUMENTS_DIR, refuse to continue'
|
echo 'Error: Failed to get XDG_DOCUMENTS_DIR, refuse to continue'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WECHAT_DATA_DIR="''${XDG_DOCUMENTS_DIR}/WeChat_Data"
|
WECHAT_DATA_DIR="''${XDG_DOCUMENTS_DIR}/WeChat_Data"
|
||||||
|
|
||||||
# Using ''${WECHAT_DATA_DIR} as Wechat Data folder
|
# Using ''${WECHAT_DATA_DIR} as Wechat Data folder
|
||||||
WECHAT_HOME_DIR="''${WECHAT_DATA_DIR}/home"
|
WECHAT_HOME_DIR="''${WECHAT_DATA_DIR}/home"
|
||||||
WECHAT_FILES_DIR="''${WECHAT_DATA_DIR}/xwechat_files"
|
WECHAT_FILES_DIR="''${WECHAT_DATA_DIR}/xwechat_files"
|
||||||
|
|
||||||
mkdir -p "''${WECHAT_FILES_DIR}"
|
mkdir -p "''${WECHAT_FILES_DIR}"
|
||||||
mkdir -p "''${WECHAT_HOME_DIR}"
|
mkdir -p "''${WECHAT_HOME_DIR}"
|
||||||
ln -snf "''${WECHAT_FILES_DIR}" "''${WECHAT_HOME_DIR}/xwechat_files"
|
ln -snf "''${WECHAT_FILES_DIR}" "''${WECHAT_HOME_DIR}/xwechat_files"
|
||||||
'';
|
'';
|
||||||
extraBwrapArgs = [
|
extraBwrapArgs = [
|
||||||
"--tmpfs /home"
|
"--tmpfs /home"
|
||||||
"--tmpfs /root"
|
"--tmpfs /root"
|
||||||
# format: --bind <host-path> <sandbox-path>
|
# format: --bind <host-path> <sandbox-path>
|
||||||
"--bind \${WECHAT_HOME_DIR} \${HOME}"
|
"--bind \${WECHAT_HOME_DIR} \${HOME}"
|
||||||
"--bind \${WECHAT_FILES_DIR} \${WECHAT_FILES_DIR}"
|
"--bind \${WECHAT_FILES_DIR} \${WECHAT_FILES_DIR}"
|
||||||
"--chdir \${HOME}"
|
"--chdir \${HOME}"
|
||||||
# wechat-universal only supports xcb
|
# wechat-universal only supports xcb
|
||||||
"--setenv QT_QPA_PLATFORM xcb"
|
"--setenv QT_QPA_PLATFORM xcb"
|
||||||
"--setenv QT_AUTO_SCREEN_SCALE_FACTOR 1"
|
"--setenv QT_AUTO_SCREEN_SCALE_FACTOR 1"
|
||||||
# use fcitx as IME
|
# use fcitx as IME
|
||||||
"--setenv QT_IM_MODULE fcitx"
|
"--setenv QT_IM_MODULE fcitx"
|
||||||
"--setenv GTK_IM_MODULE fcitx"
|
"--setenv GTK_IM_MODULE fcitx"
|
||||||
];
|
];
|
||||||
chdirToPwd = false;
|
chdirToPwd = false;
|
||||||
unshareNet = false;
|
unshareNet = false;
|
||||||
unshareIpc = true;
|
unshareIpc = true;
|
||||||
unsharePid = true;
|
unsharePid = true;
|
||||||
unshareUts = true;
|
unshareUts = true;
|
||||||
unshareCgroup = true;
|
unshareCgroup = true;
|
||||||
privateTmp = true;
|
privateTmp = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
nixpak,
|
nixpak,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
callArgs = {
|
callArgs = {
|
||||||
mkNixPak = nixpak.lib.nixpak {
|
mkNixPak = nixpak.lib.nixpak {
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
@@ -14,19 +15,20 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
wrapper = _pkgs: path: (_pkgs.callPackage path callArgs).config.script;
|
wrapper = _pkgs: path: (_pkgs.callPackage path callArgs).config.script;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# Add nixpaked Apps into nixpkgs, and reference them in home-manager or other nixos modules
|
# Add nixpaked Apps into nixpkgs, and reference them in home-manager or other nixos modules
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(_: super: {
|
(_: super: {
|
||||||
nixpaks = {
|
nixpaks = {
|
||||||
qq = wrapper super ./qq.nix;
|
qq = wrapper super ./qq.nix;
|
||||||
qq-desktop-item = super.callPackage ./qq-desktop-item.nix {};
|
qq-desktop-item = super.callPackage ./qq-desktop-item.nix { };
|
||||||
|
|
||||||
wechat = wrapper super ./wechat.nix;
|
wechat = wrapper super ./wechat.nix;
|
||||||
wechat-desktop-item = super.callPackage ./wechat-desktop-item.nix {};
|
wechat-desktop-item = super.callPackage ./wechat-desktop-item.nix { };
|
||||||
|
|
||||||
firefox = wrapper super ./firefox.nix;
|
firefox = wrapper super ./firefox.nix;
|
||||||
firefox-desktop-item = super.callPackage ./firefox-desktop-item.nix {};
|
firefox-desktop-item = super.callPackage ./firefox-desktop-item.nix { };
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{makeDesktopItem}:
|
{ makeDesktopItem }:
|
||||||
makeDesktopItem {
|
makeDesktopItem {
|
||||||
name = "firefox";
|
name = "firefox";
|
||||||
desktopName = "firefox";
|
desktopName = "firefox";
|
||||||
@@ -6,6 +6,6 @@ makeDesktopItem {
|
|||||||
terminal = false;
|
terminal = false;
|
||||||
icon = "firefox";
|
icon = "firefox";
|
||||||
type = "Application";
|
type = "Application";
|
||||||
categories = ["Network"];
|
categories = [ "Network" ];
|
||||||
comment = "firefox boxed";
|
comment = "firefox boxed";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,74 +10,79 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
mkNixPak {
|
mkNixPak {
|
||||||
config = {
|
config =
|
||||||
config,
|
{
|
||||||
sloth,
|
config,
|
||||||
...
|
sloth,
|
||||||
}: {
|
...
|
||||||
app = {
|
}:
|
||||||
package = pkgs.firefox-wayland;
|
{
|
||||||
binPath = "bin/firefox";
|
app = {
|
||||||
};
|
package = pkgs.firefox-wayland;
|
||||||
flatpak.appId = "org.mozilla.firefox";
|
binPath = "bin/firefox";
|
||||||
|
};
|
||||||
|
flatpak.appId = "org.mozilla.firefox";
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./modules/gui-base.nix
|
./modules/gui-base.nix
|
||||||
./modules/network.nix
|
./modules/network.nix
|
||||||
];
|
|
||||||
|
|
||||||
# list all dbus services:
|
|
||||||
# ls -al /run/current-system/sw/share/dbus-1/services/
|
|
||||||
# ls -al /etc/profiles/per-user/ryan/share/dbus-1/services/
|
|
||||||
dbus.policies = {
|
|
||||||
"org.mozilla.firefox.*" = "own"; # firefox
|
|
||||||
"org.mozilla.firefox_beta.*" = "own"; # firefox beta
|
|
||||||
"org.mpris.MediaPlayer2.firefox.*" = "own";
|
|
||||||
"org.freedesktop.NetworkManager" = "talk";
|
|
||||||
|
|
||||||
"org.gnome.Shell.Screencast" = "talk";
|
|
||||||
# System tray icon
|
|
||||||
"org.freedesktop.Notifications" = "talk";
|
|
||||||
"org.kde.StatusNotifierWatcher" = "talk";
|
|
||||||
# File Manager
|
|
||||||
"org.freedesktop.FileManager1" = "talk";
|
|
||||||
# Uses legacy StatusNotifier implementation
|
|
||||||
"org.kde.*" = "own";
|
|
||||||
};
|
|
||||||
|
|
||||||
bubblewrap = {
|
|
||||||
# To trace all the home files QQ accesses, you can use the following nushell command:
|
|
||||||
# just trace-access firefox
|
|
||||||
# See the Justfile in the root of this repository for more information.
|
|
||||||
bind.rw = [
|
|
||||||
# given the read write permission to the following directories.
|
|
||||||
# NOTE: sloth.mkdir is used to create the directory if it does not exist!
|
|
||||||
(sloth.mkdir (sloth.concat' sloth.homeDir "/.mozilla"))
|
|
||||||
|
|
||||||
sloth.xdgDocumentsDir
|
|
||||||
sloth.xdgDownloadDir
|
|
||||||
sloth.xdgMusicDir
|
|
||||||
sloth.xdgVideosDir
|
|
||||||
];
|
|
||||||
bind.ro = [
|
|
||||||
"/sys/bus/pci"
|
|
||||||
["${config.app.package}/lib/firefox" "/app/etc/firefox"]
|
|
||||||
|
|
||||||
# ================ for browserpass extension ===============================
|
|
||||||
"/etc/gnupg"
|
|
||||||
(sloth.concat' sloth.homeDir "/.gnupg") # gpg's config
|
|
||||||
(sloth.concat' sloth.homeDir "/.local/share/password-store") # my secrets
|
|
||||||
(sloth.concat' sloth.runtimeDir "/gnupg") # for access gpg-agent socket
|
|
||||||
|
|
||||||
# Unsure
|
|
||||||
(sloth.concat' sloth.xdgConfigHome "/dconf")
|
|
||||||
];
|
];
|
||||||
|
|
||||||
sockets = {
|
# list all dbus services:
|
||||||
x11 = false;
|
# ls -al /run/current-system/sw/share/dbus-1/services/
|
||||||
wayland = true;
|
# ls -al /etc/profiles/per-user/ryan/share/dbus-1/services/
|
||||||
pipewire = true;
|
dbus.policies = {
|
||||||
|
"org.mozilla.firefox.*" = "own"; # firefox
|
||||||
|
"org.mozilla.firefox_beta.*" = "own"; # firefox beta
|
||||||
|
"org.mpris.MediaPlayer2.firefox.*" = "own";
|
||||||
|
"org.freedesktop.NetworkManager" = "talk";
|
||||||
|
|
||||||
|
"org.gnome.Shell.Screencast" = "talk";
|
||||||
|
# System tray icon
|
||||||
|
"org.freedesktop.Notifications" = "talk";
|
||||||
|
"org.kde.StatusNotifierWatcher" = "talk";
|
||||||
|
# File Manager
|
||||||
|
"org.freedesktop.FileManager1" = "talk";
|
||||||
|
# Uses legacy StatusNotifier implementation
|
||||||
|
"org.kde.*" = "own";
|
||||||
|
};
|
||||||
|
|
||||||
|
bubblewrap = {
|
||||||
|
# To trace all the home files QQ accesses, you can use the following nushell command:
|
||||||
|
# just trace-access firefox
|
||||||
|
# See the Justfile in the root of this repository for more information.
|
||||||
|
bind.rw = [
|
||||||
|
# given the read write permission to the following directories.
|
||||||
|
# NOTE: sloth.mkdir is used to create the directory if it does not exist!
|
||||||
|
(sloth.mkdir (sloth.concat' sloth.homeDir "/.mozilla"))
|
||||||
|
|
||||||
|
sloth.xdgDocumentsDir
|
||||||
|
sloth.xdgDownloadDir
|
||||||
|
sloth.xdgMusicDir
|
||||||
|
sloth.xdgVideosDir
|
||||||
|
];
|
||||||
|
bind.ro = [
|
||||||
|
"/sys/bus/pci"
|
||||||
|
[
|
||||||
|
"${config.app.package}/lib/firefox"
|
||||||
|
"/app/etc/firefox"
|
||||||
|
]
|
||||||
|
|
||||||
|
# ================ for browserpass extension ===============================
|
||||||
|
"/etc/gnupg"
|
||||||
|
(sloth.concat' sloth.homeDir "/.gnupg") # gpg's config
|
||||||
|
(sloth.concat' sloth.homeDir "/.local/share/password-store") # my secrets
|
||||||
|
(sloth.concat' sloth.runtimeDir "/gnupg") # for access gpg-agent socket
|
||||||
|
|
||||||
|
# Unsure
|
||||||
|
(sloth.concat' sloth.xdgConfigHome "/dconf")
|
||||||
|
];
|
||||||
|
|
||||||
|
sockets = {
|
||||||
|
x11 = false;
|
||||||
|
wayland = true;
|
||||||
|
pipewire = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,14 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
sloth,
|
sloth,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
envSuffix = envKey: suffix: sloth.concat' (sloth.env envKey) suffix;
|
envSuffix = envKey: suffix: sloth.concat' (sloth.env envKey) suffix;
|
||||||
# cursor & icon's theme should be the same as the host's one.
|
# cursor & icon's theme should be the same as the host's one.
|
||||||
cursorTheme = pkgs.bibata-cursors;
|
cursorTheme = pkgs.bibata-cursors;
|
||||||
iconTheme = pkgs.papirus-icon-theme;
|
iconTheme = pkgs.papirus-icon-theme;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = {
|
config = {
|
||||||
dbus.policies = {
|
dbus.policies = {
|
||||||
"${config.flatpak.appId}" = "own";
|
"${config.flatpak.appId}" = "own";
|
||||||
@@ -89,15 +91,19 @@ in {
|
|||||||
];
|
];
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
XDG_DATA_DIRS = lib.mkForce (lib.makeSearchPath "share" [
|
XDG_DATA_DIRS = lib.mkForce (
|
||||||
iconTheme
|
lib.makeSearchPath "share" [
|
||||||
cursorTheme
|
iconTheme
|
||||||
pkgs.shared-mime-info
|
cursorTheme
|
||||||
]);
|
pkgs.shared-mime-info
|
||||||
XCURSOR_PATH = lib.mkForce (lib.concatStringsSep ":" [
|
]
|
||||||
"${cursorTheme}/share/icons"
|
);
|
||||||
"${cursorTheme}/share/pixmaps"
|
XCURSOR_PATH = lib.mkForce (
|
||||||
]);
|
lib.concatStringsSep ":" [
|
||||||
|
"${cursorTheme}/share/icons"
|
||||||
|
"${cursorTheme}/share/pixmaps"
|
||||||
|
]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
etc.sslCertificates.enable = true;
|
etc.sslCertificates.enable = true;
|
||||||
bubblewrap = {
|
bubblewrap = {
|
||||||
bind.ro = ["/etc/resolv.conf"];
|
bind.ro = [ "/etc/resolv.conf" ];
|
||||||
network = true;
|
network = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,6 @@ makeDesktopItem {
|
|||||||
# tree $"($p)/share/icons"
|
# tree $"($p)/share/icons"
|
||||||
icon = "${qq}/share/icons/hicolor/512x512/apps/qq.png";
|
icon = "${qq}/share/icons/hicolor/512x512/apps/qq.png";
|
||||||
type = "Application";
|
type = "Application";
|
||||||
categories = ["Network"];
|
categories = [ "Network" ];
|
||||||
comment = "QQ boxed";
|
comment = "QQ boxed";
|
||||||
}
|
}
|
||||||
|
|||||||
+51
-44
@@ -10,53 +10,60 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
mkNixPak {
|
mkNixPak {
|
||||||
config = {sloth, ...}: {
|
config =
|
||||||
app = {
|
{ sloth, ... }:
|
||||||
package = pkgs.qq.override {
|
{
|
||||||
# fix fcitx5 input method
|
app = {
|
||||||
commandLineArgs = lib.concatStringsSep " " ["--enable-wayland-ime"];
|
package = pkgs.qq.override {
|
||||||
|
# fix fcitx5 input method
|
||||||
|
commandLineArgs = lib.concatStringsSep " " [ "--enable-wayland-ime" ];
|
||||||
|
};
|
||||||
|
binPath = "bin/qq";
|
||||||
};
|
};
|
||||||
binPath = "bin/qq";
|
flatpak.appId = "com.tencent.qq";
|
||||||
};
|
|
||||||
flatpak.appId = "com.tencent.qq";
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./modules/gui-base.nix
|
./modules/gui-base.nix
|
||||||
./modules/network.nix
|
./modules/network.nix
|
||||||
];
|
|
||||||
|
|
||||||
# list all dbus services:
|
|
||||||
# ls -al /run/current-system/sw/share/dbus-1/services/
|
|
||||||
# ls -al /etc/profiles/per-user/ryan/share/dbus-1/services/
|
|
||||||
dbus.policies = {
|
|
||||||
"org.gnome.Shell.Screencast" = "talk";
|
|
||||||
# System tray icon
|
|
||||||
"org.freedesktop.Notifications" = "talk";
|
|
||||||
"org.kde.StatusNotifierWatcher" = "talk";
|
|
||||||
# File Manager
|
|
||||||
"org.freedesktop.FileManager1" = "talk";
|
|
||||||
# Uses legacy StatusNotifier implementation
|
|
||||||
"org.kde.*" = "own";
|
|
||||||
};
|
|
||||||
bubblewrap = {
|
|
||||||
# To trace all the home files QQ accesses, you can use the following nushell command:
|
|
||||||
# just trace-access qq
|
|
||||||
# See the Justfile in the root of this repository for more information.
|
|
||||||
bind.rw = [
|
|
||||||
# given the read write permission to the following directories.
|
|
||||||
# NOTE: sloth.mkdir is used to create the directory if it does not exist!
|
|
||||||
(sloth.mkdir (sloth.concat [sloth.xdgConfigHome "/QQ"]))
|
|
||||||
|
|
||||||
sloth.xdgDocumentsDir
|
|
||||||
sloth.xdgDownloadDir
|
|
||||||
sloth.xdgMusicDir
|
|
||||||
sloth.xdgVideosDir
|
|
||||||
];
|
];
|
||||||
sockets = {
|
|
||||||
x11 = false;
|
# list all dbus services:
|
||||||
wayland = true;
|
# ls -al /run/current-system/sw/share/dbus-1/services/
|
||||||
pipewire = true;
|
# ls -al /etc/profiles/per-user/ryan/share/dbus-1/services/
|
||||||
|
dbus.policies = {
|
||||||
|
"org.gnome.Shell.Screencast" = "talk";
|
||||||
|
# System tray icon
|
||||||
|
"org.freedesktop.Notifications" = "talk";
|
||||||
|
"org.kde.StatusNotifierWatcher" = "talk";
|
||||||
|
# File Manager
|
||||||
|
"org.freedesktop.FileManager1" = "talk";
|
||||||
|
# Uses legacy StatusNotifier implementation
|
||||||
|
"org.kde.*" = "own";
|
||||||
|
};
|
||||||
|
bubblewrap = {
|
||||||
|
# To trace all the home files QQ accesses, you can use the following nushell command:
|
||||||
|
# just trace-access qq
|
||||||
|
# See the Justfile in the root of this repository for more information.
|
||||||
|
bind.rw = [
|
||||||
|
# given the read write permission to the following directories.
|
||||||
|
# NOTE: sloth.mkdir is used to create the directory if it does not exist!
|
||||||
|
(sloth.mkdir (
|
||||||
|
sloth.concat [
|
||||||
|
sloth.xdgConfigHome
|
||||||
|
"/QQ"
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
|
sloth.xdgDocumentsDir
|
||||||
|
sloth.xdgDownloadDir
|
||||||
|
sloth.xdgMusicDir
|
||||||
|
sloth.xdgVideosDir
|
||||||
|
];
|
||||||
|
sockets = {
|
||||||
|
x11 = false;
|
||||||
|
wayland = true;
|
||||||
|
pipewire = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{modulesPath, ...}: {
|
{ modulesPath, ... }:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/profiles/hardened.nix")
|
(modulesPath + "/profiles/hardened.nix")
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# Misc
|
# Misc
|
||||||
cowsay
|
cowsay
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
# search for files by name, faster than find
|
# search for files by name, faster than find
|
||||||
fd
|
fd
|
||||||
# search for files by its content, replacement of grep
|
# search for files by its content, replacement of grep
|
||||||
(ripgrep.override {withPCRE2 = true;})
|
(ripgrep.override { withPCRE2 = true; })
|
||||||
|
|
||||||
# A fast and polyglot tool for code searching, linting, rewriting at large scale
|
# A fast and polyglot tool for code searching, linting, rewriting at large scale
|
||||||
# supported languages: only some mainstream languages currently(do not support nix/nginx/yaml/toml/...)
|
# supported languages: only some mainstream languages currently(do not support nix/nginx/yaml/toml/...)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
programs.helix = {
|
programs.helix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
programs = {
|
programs = {
|
||||||
neovim = {
|
neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -4,12 +4,13 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# `programs.git` will generate the config file: ~/.config/git/config
|
# `programs.git` will generate the config file: ~/.config/git/config
|
||||||
# to make git use this config file, `~/.gitconfig` should not exist!
|
# to make git use this config file, `~/.gitconfig` should not exist!
|
||||||
#
|
#
|
||||||
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
|
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
|
||||||
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
|
||||||
rm -f ${config.home.homeDirectory}/.gitconfig
|
rm -f ${config.home.homeDirectory}/.gitconfig
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
# make `npm install -g <pkg>` happey
|
# make `npm install -g <pkg>` happey
|
||||||
#
|
#
|
||||||
# mainly used to install npm packages that updates frequently
|
# mainly used to install npm packages that updates frequently
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{config, ...}: let
|
{ config, ... }:
|
||||||
|
let
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
|
|
||||||
@@ -10,7 +11,8 @@
|
|||||||
goBin = "${config.home.homeDirectory}/go/bin";
|
goBin = "${config.home.homeDirectory}/go/bin";
|
||||||
rustBin = "${config.home.homeDirectory}/.cargo/bin";
|
rustBin = "${config.home.homeDirectory}/.cargo/bin";
|
||||||
npmBin = "${config.home.homeDirectory}/.npm/bin";
|
npmBin = "${config.home.homeDirectory}/.npm/bin";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{catppuccin, ...}: {
|
{ catppuccin, ... }:
|
||||||
|
{
|
||||||
# https://github.com/catppuccin/nix
|
# https://github.com/catppuccin/nix
|
||||||
imports = [
|
imports = [
|
||||||
catppuccin.homeModules.catppuccin
|
catppuccin.homeModules.catppuccin
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
# terminal file manager
|
# terminal file manager
|
||||||
programs.yazi = {
|
programs.yazi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ let
|
|||||||
shellAliases = {
|
shellAliases = {
|
||||||
"zj" = "zellij";
|
"zj" = "zellij";
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.zellij = {
|
programs.zellij = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
home.packages = with pkgs;
|
{
|
||||||
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
[
|
[
|
||||||
mitmproxy # http/https proxy tool
|
mitmproxy # http/https proxy tool
|
||||||
wireshark # network analyzer
|
wireshark # network analyzer
|
||||||
|
|||||||
@@ -52,10 +52,7 @@
|
|||||||
bold_italic = {
|
bold_italic = {
|
||||||
family = "Maple Mono NF CN";
|
family = "Maple Mono NF CN";
|
||||||
};
|
};
|
||||||
size =
|
size = if pkgs.stdenv.isDarwin then 14 else 13;
|
||||||
if pkgs.stdenv.isDarwin
|
|
||||||
then 14
|
|
||||||
else 13;
|
|
||||||
};
|
};
|
||||||
terminal = {
|
terminal = {
|
||||||
# Spawn a nushell in login mode via `bash`
|
# Spawn a nushell in login mode via `bash`
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
programs.foot = {
|
programs.foot = {
|
||||||
# foot is designed only for Linux
|
# foot is designed only for Linux
|
||||||
enable = pkgs.stdenv.isLinux;
|
enable = pkgs.stdenv.isLinux;
|
||||||
|
|||||||
@@ -12,9 +12,10 @@
|
|||||||
programs.ghostty = {
|
programs.ghostty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package =
|
||||||
if pkgs.stdenv.isDarwin
|
if pkgs.stdenv.isDarwin then
|
||||||
then pkgs.hello # pkgs.ghostty is currently broken on darwin
|
pkgs.hello # pkgs.ghostty is currently broken on darwin
|
||||||
else pkgs.ghostty; # the stable version
|
else
|
||||||
|
pkgs.ghostty; # the stable version
|
||||||
# package = ghostty.packages.${pkgs.system}.default; # the latest version
|
# package = ghostty.packages.${pkgs.system}.default; # the latest version
|
||||||
enableBashIntegration = false;
|
enableBashIntegration = false;
|
||||||
installBatSyntax = false;
|
installBatSyntax = false;
|
||||||
|
|||||||
@@ -19,10 +19,7 @@
|
|||||||
font = {
|
font = {
|
||||||
name = "Maple Mono NF CN";
|
name = "Maple Mono NF CN";
|
||||||
# use different font size on macOS
|
# use different font size on macOS
|
||||||
size =
|
size = if pkgs.stdenv.isDarwin then 14 else 13;
|
||||||
if pkgs.stdenv.isDarwin
|
|
||||||
then 14
|
|
||||||
else 13;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# consistent with other terminal emulators
|
# consistent with other terminal emulators
|
||||||
@@ -48,6 +45,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# macOS specific settings
|
# macOS specific settings
|
||||||
darwinLaunchOptions = ["--start-as=maximized"];
|
darwinLaunchOptions = [ "--start-as=maximized" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
{myvars, ...}: {
|
{ myvars, ... }:
|
||||||
|
{
|
||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
# paths it should manage.
|
# paths it should manage.
|
||||||
home = {
|
home = {
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# https://developer.hashicorp.com/terraform/cli/config/config-file
|
# https://developer.hashicorp.com/terraform/cli/config/config-file
|
||||||
home.file.".terraformrc".source = ./terraformrc;
|
home.file.".terraformrc".source = ./terraformrc;
|
||||||
|
|
||||||
@@ -30,9 +31,12 @@
|
|||||||
# digitalocean
|
# digitalocean
|
||||||
doctl
|
doctl
|
||||||
# google cloud
|
# google cloud
|
||||||
(google-cloud-sdk.withExtraComponents (with google-cloud-sdk.components; [
|
(google-cloud-sdk.withExtraComponents (
|
||||||
gke-gcloud-auth-plugin
|
with google-cloud-sdk.components;
|
||||||
]))
|
[
|
||||||
|
gke-gcloud-auth-plugin
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
# cloud tools that nix do not have cache for.
|
# cloud tools that nix do not have cache for.
|
||||||
terraform
|
terraform
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
nur-ryan4yin,
|
nur-ryan4yin,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
podman-compose
|
podman-compose
|
||||||
dive # explore docker layers
|
dive # explore docker layers
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Basic settings for development environment
|
# Basic settings for development environment
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
programs.helix = {
|
programs.helix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.helix;
|
package = pkgs.helix;
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ let
|
|||||||
# the path to nvim directory
|
# the path to nvim directory
|
||||||
# to make this symlink work, we need to git clone this repo to your home directory.
|
# to make this symlink work, we need to git clone this repo to your home directory.
|
||||||
configPath = "${config.home.homeDirectory}/nix-config/home/base/tui/editors/neovim/nvim";
|
configPath = "${config.home.homeDirectory}/nix-config/home/base/tui/editors/neovim/nvim";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink configPath;
|
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink configPath;
|
||||||
# Disable catppuccin to avoid conflict with my non-nix config.
|
# Disable catppuccin to avoid conflict with my non-nix config.
|
||||||
catppuccin.nvim.enable = false;
|
catppuccin.nvim.enable = false;
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ return {
|
|||||||
"terraformls", -- terraform hcl
|
"terraformls", -- terraform hcl
|
||||||
"marksman", -- markdown ls
|
"marksman", -- markdown ls
|
||||||
"nickel_ls", -- nickel language server
|
"nickel_ls", -- nickel language server
|
||||||
"nil_ls", -- nix language server
|
-- "nil_ls", -- nix language server
|
||||||
|
"nixd", -- another nix language server
|
||||||
"buf_ls", -- protocol buffer language server
|
"buf_ls", -- protocol buffer language server
|
||||||
"dockerls", -- dockerfile
|
"dockerls", -- dockerfile
|
||||||
"cmake", -- cmake language server
|
"cmake", -- cmake language server
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ return {
|
|||||||
formatting.shfmt, -- Shell formatter
|
formatting.shfmt, -- Shell formatter
|
||||||
formatting.terraform_fmt, -- Terraform formatter
|
formatting.terraform_fmt, -- Terraform formatter
|
||||||
formatting.stylua, -- Lua formatter
|
formatting.stylua, -- Lua formatter
|
||||||
formatting.alejandra, -- Nix formatter
|
-- formatting.alejandra, -- Nix formatter
|
||||||
formatting.sqlfluff.with { -- SQL formatter
|
formatting.sqlfluff.with { -- SQL formatter
|
||||||
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
||||||
},
|
},
|
||||||
|
|||||||
+135
-134
@@ -2,154 +2,155 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
home.packages = with pkgs; (
|
{
|
||||||
# -*- Data & Configuration Languages -*-#
|
home.packages =
|
||||||
[
|
with pkgs;
|
||||||
#-- nix
|
(
|
||||||
nil
|
# -*- Data & Configuration Languages -*-#
|
||||||
# rnix-lsp
|
[
|
||||||
# nixd
|
#-- nix
|
||||||
statix # Lints and suggestions for the nix programming language
|
nil
|
||||||
deadnix # Find and remove unused code in .nix source files
|
nixd
|
||||||
alejandra # Nix Code Formatter
|
statix # Lints and suggestions for the nix programming language
|
||||||
|
deadnix # Find and remove unused code in .nix source files
|
||||||
|
nixfmt # Nix Code Formatter
|
||||||
|
|
||||||
#-- nickel lang
|
#-- nickel lang
|
||||||
nickel
|
nickel
|
||||||
|
|
||||||
#-- json like
|
#-- json like
|
||||||
# terraform # install via brew on macOS
|
# terraform # install via brew on macOS
|
||||||
terraform-ls
|
terraform-ls
|
||||||
jsonnet
|
jsonnet
|
||||||
jsonnet-language-server
|
jsonnet-language-server
|
||||||
taplo # TOML language server / formatter / validator
|
taplo # TOML language server / formatter / validator
|
||||||
nodePackages.yaml-language-server
|
nodePackages.yaml-language-server
|
||||||
actionlint # GitHub Actions linter
|
actionlint # GitHub Actions linter
|
||||||
|
|
||||||
#-- dockerfile
|
#-- dockerfile
|
||||||
hadolint # Dockerfile linter
|
hadolint # Dockerfile linter
|
||||||
nodePackages.dockerfile-language-server-nodejs
|
nodePackages.dockerfile-language-server-nodejs
|
||||||
|
|
||||||
#-- markdown
|
#-- markdown
|
||||||
marksman # language server for markdown
|
marksman # language server for markdown
|
||||||
glow # markdown previewer
|
glow # markdown previewer
|
||||||
pandoc # document converter
|
pandoc # document converter
|
||||||
pkgs-unstable.hugo # static site generator
|
pkgs-unstable.hugo # static site generator
|
||||||
|
|
||||||
#-- sql
|
#-- sql
|
||||||
sqlfluff
|
sqlfluff
|
||||||
|
|
||||||
#-- protocol buffer
|
#-- protocol buffer
|
||||||
buf # linting and formatting
|
buf # linting and formatting
|
||||||
]
|
]
|
||||||
++
|
++
|
||||||
#-*- General Purpose Languages -*-#
|
#-*- General Purpose Languages -*-#
|
||||||
[
|
[
|
||||||
#-- c/c++
|
#-- c/c++
|
||||||
cmake
|
cmake
|
||||||
cmake-language-server
|
cmake-language-server
|
||||||
gnumake
|
gnumake
|
||||||
checkmake
|
checkmake
|
||||||
# c/c++ compiler, required by nvim-treesitter!
|
# c/c++ compiler, required by nvim-treesitter!
|
||||||
gcc
|
gcc
|
||||||
gdb
|
gdb
|
||||||
# c/c++ tools with clang-tools, the unwrapped version won't
|
# c/c++ tools with clang-tools, the unwrapped version won't
|
||||||
# add alias like `cc` and `c++`, so that it won't conflict with gcc
|
# add alias like `cc` and `c++`, so that it won't conflict with gcc
|
||||||
# llvmPackages.clang-unwrapped
|
# llvmPackages.clang-unwrapped
|
||||||
clang-tools
|
clang-tools
|
||||||
lldb
|
lldb
|
||||||
vscode-extensions.vadimcn.vscode-lldb.adapter # codelldb - debugger
|
vscode-extensions.vadimcn.vscode-lldb.adapter # codelldb - debugger
|
||||||
|
|
||||||
#-- python
|
#-- python
|
||||||
pipx # Install and Run Python Applications in Isolated Environments
|
pipx # Install and Run Python Applications in Isolated Environments
|
||||||
uv # python project package manager
|
uv # python project package manager
|
||||||
pyright # python language server
|
pyright # python language server
|
||||||
(python313.withPackages (
|
(python313.withPackages (
|
||||||
ps:
|
ps: with ps; [
|
||||||
with ps; [
|
ruff
|
||||||
ruff
|
black # python formatter
|
||||||
black # python formatter
|
# debugpy
|
||||||
# debugpy
|
|
||||||
|
|
||||||
# my commonly used python packages
|
# my commonly used python packages
|
||||||
jupyter
|
jupyter
|
||||||
ipython
|
ipython
|
||||||
pandas
|
pandas
|
||||||
requests
|
requests
|
||||||
pyquery
|
pyquery
|
||||||
pyyaml
|
pyyaml
|
||||||
boto3
|
boto3
|
||||||
]
|
]
|
||||||
))
|
))
|
||||||
|
|
||||||
#-- rust
|
#-- rust
|
||||||
# we'd better use the rust-overlays for rust development
|
# we'd better use the rust-overlays for rust development
|
||||||
pkgs-unstable.rustc
|
pkgs-unstable.rustc
|
||||||
pkgs-unstable.rust-analyzer
|
pkgs-unstable.rust-analyzer
|
||||||
pkgs-unstable.cargo # rust package manager
|
pkgs-unstable.cargo # rust package manager
|
||||||
pkgs-unstable.rustfmt
|
pkgs-unstable.rustfmt
|
||||||
pkgs-unstable.clippy # rust linter
|
pkgs-unstable.clippy # rust linter
|
||||||
|
|
||||||
#-- golang
|
#-- golang
|
||||||
go
|
go
|
||||||
gomodifytags
|
gomodifytags
|
||||||
iferr # generate error handling code for go
|
iferr # generate error handling code for go
|
||||||
impl # generate function implementation for go
|
impl # generate function implementation for go
|
||||||
gotools # contains tools like: godoc, goimports, etc.
|
gotools # contains tools like: godoc, goimports, etc.
|
||||||
gopls # go language server
|
gopls # go language server
|
||||||
delve # go debugger
|
delve # go debugger
|
||||||
|
|
||||||
# -- java
|
# -- java
|
||||||
jdk17
|
jdk17
|
||||||
gradle
|
gradle
|
||||||
maven
|
maven
|
||||||
spring-boot-cli
|
spring-boot-cli
|
||||||
jdt-language-server
|
jdt-language-server
|
||||||
|
|
||||||
#-- zig
|
#-- zig
|
||||||
zls
|
zls
|
||||||
|
|
||||||
#-- lua
|
#-- lua
|
||||||
stylua
|
stylua
|
||||||
lua-language-server
|
lua-language-server
|
||||||
|
|
||||||
#-- bash
|
#-- bash
|
||||||
nodePackages.bash-language-server
|
nodePackages.bash-language-server
|
||||||
shellcheck
|
shellcheck
|
||||||
shfmt
|
shfmt
|
||||||
]
|
]
|
||||||
#-*- Web Development -*-#
|
#-*- Web Development -*-#
|
||||||
++ [
|
++ [
|
||||||
nodePackages.nodejs
|
nodePackages.nodejs
|
||||||
nodePackages.typescript
|
nodePackages.typescript
|
||||||
nodePackages.typescript-language-server
|
nodePackages.typescript-language-server
|
||||||
# HTML/CSS/JSON/ESLint language servers extracted from vscode
|
# HTML/CSS/JSON/ESLint language servers extracted from vscode
|
||||||
nodePackages.vscode-langservers-extracted
|
nodePackages.vscode-langservers-extracted
|
||||||
nodePackages."@tailwindcss/language-server"
|
nodePackages."@tailwindcss/language-server"
|
||||||
emmet-ls
|
emmet-ls
|
||||||
]
|
]
|
||||||
# -*- Lisp like Languages -*-#
|
# -*- Lisp like Languages -*-#
|
||||||
# ++ [
|
# ++ [
|
||||||
# guile
|
# guile
|
||||||
# racket-minimal
|
# racket-minimal
|
||||||
# fnlfmt # fennel
|
# fnlfmt # fennel
|
||||||
# (
|
# (
|
||||||
# if pkgs.stdenv.isLinux && pkgs.stdenv.isx86
|
# if pkgs.stdenv.isLinux && pkgs.stdenv.isx86
|
||||||
# then pkgs-unstable.akkuPackages.scheme-langserver
|
# then pkgs-unstable.akkuPackages.scheme-langserver
|
||||||
# else pkgs.emptyDirectory
|
# else pkgs.emptyDirectory
|
||||||
# )
|
# )
|
||||||
# ]
|
# ]
|
||||||
++ [
|
++ [
|
||||||
proselint # English prose linter
|
proselint # English prose linter
|
||||||
|
|
||||||
#-- verilog / systemverilog
|
#-- verilog / systemverilog
|
||||||
verible
|
verible
|
||||||
|
|
||||||
#-- Optional Requirements:
|
#-- Optional Requirements:
|
||||||
nodePackages.prettier # common code formatter
|
nodePackages.prettier # common code formatter
|
||||||
fzf
|
fzf
|
||||||
gdu # disk usage analyzer, required by AstroNvim
|
gdu # disk usage analyzer, required by AstroNvim
|
||||||
(ripgrep.override {withPCRE2 = true;}) # recursively searches directories for a regex pattern
|
(ripgrep.override { withPCRE2 = true; }) # recursively searches directories for a regex pattern
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
age
|
age
|
||||||
sops
|
sops
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
config,
|
config,
|
||||||
mysecrets,
|
mysecrets,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
programs.gpg = {
|
programs.gpg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
homedir = "${config.home.homeDirectory}/.gnupg";
|
homedir = "${config.home.homeDirectory}/.gnupg";
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
passwordStoreDir = "${config.xdg.dataHome}/password-store";
|
passwordStoreDir = "${config.xdg.dataHome}/password-store";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.password-store = {
|
programs.password-store = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.pass.withExtensions (exts: [
|
package = pkgs.pass.withExtensions (exts: [
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
config,
|
config,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
inherit (pkgs-unstable) nu_scripts;
|
inherit (pkgs-unstable) nu_scripts;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.nushell = {
|
programs.nushell = {
|
||||||
# load the alias file for work
|
# load the alias file for work
|
||||||
# the file must exist, otherwise nushell will complain about it!
|
# the file must exist, otherwise nushell will complain about it!
|
||||||
@@ -38,7 +40,7 @@ in {
|
|||||||
# use custom-completions/zoxide/zoxide-completions.nu *
|
# use custom-completions/zoxide/zoxide-completions.nu *
|
||||||
|
|
||||||
# alias
|
# alias
|
||||||
use aliases/git/git-aliases.nu *
|
# use aliases/git/git-aliases.nu *
|
||||||
use aliases/eza/eza-aliases.nu *
|
use aliases/eza/eza-aliases.nu *
|
||||||
use aliases/bat/bat-aliases.nu *
|
use aliases/bat/bat-aliases.nu *
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
config,
|
config,
|
||||||
mysecrets,
|
mysecrets,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.file.".ssh/romantic.pub".source = "${mysecrets}/public/romantic.pub";
|
home.file.".ssh/romantic.pub".source = "${mysecrets}/public/romantic.pub";
|
||||||
|
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
{pkgs, ...}: let
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
"zj" = "zellij";
|
"zj" = "zellij";
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.zellij = {
|
programs.zellij = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.zellij;
|
package = pkgs.zellij;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
home.file.".aerospace.toml".source =
|
home.file.".aerospace.toml".source =
|
||||||
config.lib.file.mkOutOfStoreSymlink
|
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/home/darwin/aerospace/aerospace.toml";
|
||||||
"${config.home.homeDirectory}/nix-config/home/darwin/aerospace/aerospace.toml";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,15 @@
|
|||||||
mylib,
|
mylib,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.homeDirectory = "/Users/${myvars.username}";
|
home.homeDirectory = "/Users/${myvars.username}";
|
||||||
imports =
|
imports = (mylib.scanPaths ./.) ++ [
|
||||||
(mylib.scanPaths ./.)
|
../base/core
|
||||||
++ [
|
../base/tui
|
||||||
../base/core
|
../base/gui
|
||||||
../base/tui
|
../base/home.nix
|
||||||
../base/gui
|
];
|
||||||
../base/home.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# enable management of XDG base directories on macOS.
|
# enable management of XDG base directories on macOS.
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
clash-meta
|
clash-meta
|
||||||
];
|
];
|
||||||
|
|
||||||
home.file.".proxychains/proxychains.conf".source =
|
home.file.".proxychains/proxychains.conf".source =
|
||||||
config.lib.file.mkOutOfStoreSymlink
|
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/home/darwin/proxy/proxychains.conf";
|
||||||
"${config.home.homeDirectory}/nix-config/home/darwin/proxy/proxychains.conf";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
# Squirrel Input Method
|
# Squirrel Input Method
|
||||||
home.file."Library/Rime" = {
|
home.file."Library/Rime" = {
|
||||||
# my custom squirrel data (flypy input method)
|
# my custom squirrel data (flypy input method)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{lib, ...}: let
|
{ lib, ... }:
|
||||||
|
let
|
||||||
envExtra = ''
|
envExtra = ''
|
||||||
export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin"
|
export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin"
|
||||||
'';
|
'';
|
||||||
@@ -20,7 +21,8 @@
|
|||||||
true
|
true
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# Homebrew's default install location:
|
# Homebrew's default install location:
|
||||||
# /opt/homebrew for Apple Silicon
|
# /opt/homebrew for Apple Silicon
|
||||||
# /usr/local for macOS Intel
|
# /usr/local for macOS Intel
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
config,
|
config,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
d = config.xdg.dataHome;
|
d = config.xdg.dataHome;
|
||||||
c = config.xdg.configHome;
|
c = config.xdg.configHome;
|
||||||
cache = config.xdg.cacheHome;
|
cache = config.xdg.cacheHome;
|
||||||
in rec {
|
in
|
||||||
|
rec {
|
||||||
home.homeDirectory = "/home/${myvars.username}";
|
home.homeDirectory = "/home/${myvars.username}";
|
||||||
|
|
||||||
# environment variables that always set at login
|
# environment variables that always set at login
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
# Linux Only Packages, not available on Darwin
|
# Linux Only Packages, not available on Darwin
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# misc
|
# misc
|
||||||
|
|||||||
@@ -6,8 +6,10 @@
|
|||||||
nur-ryan4yin,
|
nur-ryan4yin,
|
||||||
blender-bin,
|
blender-bin,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
home.packages = with pkgs;
|
{
|
||||||
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
[
|
[
|
||||||
# creative
|
# creative
|
||||||
# gimp # image editing, I prefer using figma in browser instead of this one
|
# gimp # image editing, I prefer using figma in browser instead of this one
|
||||||
@@ -41,7 +43,8 @@
|
|||||||
# live streaming
|
# live streaming
|
||||||
obs-studio = {
|
obs-studio = {
|
||||||
enable = pkgs.stdenv.isx86_64;
|
enable = pkgs.stdenv.isx86_64;
|
||||||
plugins = with pkgs.obs-studio-plugins;
|
plugins =
|
||||||
|
with pkgs.obs-studio-plugins;
|
||||||
[
|
[
|
||||||
# screen capture
|
# screen capture
|
||||||
wlrobs
|
wlrobs
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
android-tools
|
android-tools
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# Adjust the color temperature(& brightness) of your screen according to
|
# Adjust the color temperature(& brightness) of your screen according to
|
||||||
# your surroundings. This may help your eyes hurt less if you are
|
# your surroundings. This may help your eyes hurt less if you are
|
||||||
# working in front of the screen at night.
|
# working in front of the screen at night.
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
"fcitx5/profile" = {
|
"fcitx5/profile" = {
|
||||||
source = ./profile;
|
source = ./profile;
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
nix-gaming,
|
nix-gaming,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# nix-gaming.packages.${pkgs.system}.osu-laser-bin
|
# nix-gaming.packages.${pkgs.system}.osu-laser-bin
|
||||||
gamescope # SteamOS session compositing window manager
|
gamescope # SteamOS session compositing window manager
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# If your themes for mouse cursor, icons or windows don’t load correctly,
|
# If your themes for mouse cursor, icons or windows don’t load correctly,
|
||||||
# try setting them with home.pointerCursor and gtk.theme,
|
# try setting them with home.pointerCursor and gtk.theme,
|
||||||
# which enable a bunch of compatibility options that should make the themes load in all situations.
|
# which enable a bunch of compatibility options that should make the themes load in all situations.
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
# TODO not used yet, need to test it.
|
# TODO not used yet, need to test it.
|
||||||
#
|
#
|
||||||
##############################################################################################
|
##############################################################################################
|
||||||
with lib; let
|
with lib;
|
||||||
|
let
|
||||||
cfg = config.home.immutable-file;
|
cfg = config.home.immutable-file;
|
||||||
immutableFileOpts = _: {
|
immutableFileOpts = _: {
|
||||||
options = {
|
options = {
|
||||||
@@ -42,24 +43,25 @@ with lib; let
|
|||||||
sudo cp $2 $1
|
sudo cp $2 $1
|
||||||
sudo chattr +i $1
|
sudo chattr +i $1
|
||||||
'';
|
'';
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.home.immutable-file = mkOption {
|
options.home.immutable-file = mkOption {
|
||||||
type = with types; attrsOf (submodule immutableFileOpts);
|
type = with types; attrsOf (submodule immutableFileOpts);
|
||||||
default = {};
|
default = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg != {}) {
|
config = mkIf (cfg != { }) {
|
||||||
home.activation =
|
home.activation = mapAttrs' (
|
||||||
mapAttrs'
|
name:
|
||||||
(name: {
|
{
|
||||||
src,
|
src,
|
||||||
dst,
|
dst,
|
||||||
}:
|
}:
|
||||||
nameValuePair
|
nameValuePair "make-immutable-${name}" (
|
||||||
"make-immutable-${name}"
|
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
(lib.hm.dag.entryAfter ["writeBoundary"] ''
|
|
||||||
${mkImmutableFile} ${dst} ${src}
|
${mkImmutableFile} ${dst} ${src}
|
||||||
''))
|
''
|
||||||
cfg;
|
)
|
||||||
|
) cfg;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
}:
|
}:
|
||||||
# media - control and enjoy audio/video
|
# media - control and enjoy audio/video
|
||||||
{
|
{
|
||||||
home.packages = with pkgs;
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
[
|
[
|
||||||
# audio control
|
# audio control
|
||||||
pavucontrol
|
pavucontrol
|
||||||
@@ -22,13 +23,13 @@
|
|||||||
nvitop
|
nvitop
|
||||||
]
|
]
|
||||||
++ (lib.optionals pkgs.stdenv.isx86_64 [
|
++ (lib.optionals pkgs.stdenv.isx86_64 [
|
||||||
(zoom-us.override {hyprlandXdgDesktopPortalSupport = true;})
|
(zoom-us.override { hyprlandXdgDesktopPortalSupport = true; })
|
||||||
]);
|
]);
|
||||||
|
|
||||||
programs.mpv = {
|
programs.mpv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultProfiles = ["gpu-hq"];
|
defaultProfiles = [ "gpu-hq" ];
|
||||||
scripts = [pkgs.mpvScripts.mpris];
|
scripts = [ pkgs.mpvScripts.mpris ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# GUI apps
|
# GUI apps
|
||||||
# e-book viewer(.epub/.mobi/...)
|
# e-book viewer(.epub/.mobi/...)
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
home.packages = with pkgs; (lib.optionals pkgs.stdenv.isx86_64 [
|
{
|
||||||
# https://joplinapp.org/help/
|
home.packages =
|
||||||
joplin # joplin-cli
|
with pkgs;
|
||||||
joplin-desktop
|
(lib.optionals pkgs.stdenv.isx86_64 [
|
||||||
]);
|
# https://joplinapp.org/help/
|
||||||
|
joplin # joplin-cli
|
||||||
|
joplin-desktop
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,26 +4,37 @@
|
|||||||
lib,
|
lib,
|
||||||
wallpapers,
|
wallpapers,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
systemd.user.services.wallpaper = {
|
systemd.user.services.wallpaper = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Wallpaper Switcher daemon";
|
Description = "Wallpaper Switcher daemon";
|
||||||
After = ["graphical-session-pre.target" "xdg-desktop-autostart.target"];
|
After = [
|
||||||
Wants = ["graphical-session-pre.target"];
|
"graphical-session-pre.target"
|
||||||
|
"xdg-desktop-autostart.target"
|
||||||
|
];
|
||||||
|
Wants = [ "graphical-session-pre.target" ];
|
||||||
};
|
};
|
||||||
Install.WantedBy = ["graphical-session.target"];
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = lib.getExe (pkgs.writeShellApplication {
|
ExecStart = lib.getExe (
|
||||||
name = "wallpaper";
|
pkgs.writeShellApplication {
|
||||||
runtimeInputs = with pkgs; [procps feh swaybg python3];
|
name = "wallpaper";
|
||||||
text = ''
|
runtimeInputs = with pkgs; [
|
||||||
export WALLPAPERS_DIR="${wallpapers}"
|
procps
|
||||||
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
|
feh
|
||||||
export WALLPAPER_WAIT_MIN=60
|
swaybg
|
||||||
export WALLPAPER_WAIT_MAX=180
|
python3
|
||||||
exec ${./wallpaper-switcher.py}
|
];
|
||||||
'';
|
text = ''
|
||||||
});
|
export WALLPAPERS_DIR="${wallpapers}"
|
||||||
|
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
|
||||||
|
export WALLPAPER_WAIT_MIN=60
|
||||||
|
export WALLPAPER_WAIT_MAX=180
|
||||||
|
exec ${./wallpaper-switcher.py}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
);
|
||||||
RestartSec = 3;
|
RestartSec = 3;
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|||||||
+53
-42
@@ -6,7 +6,8 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
|
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
|
||||||
xdg-user-dirs
|
xdg-user-dirs
|
||||||
@@ -31,53 +32,63 @@
|
|||||||
mimeApps = {
|
mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# let `xdg-open` to open the url with the correct application.
|
# let `xdg-open` to open the url with the correct application.
|
||||||
defaultApplications = let
|
defaultApplications =
|
||||||
browser = ["google-chrome.desktop" "firefox.desktop"];
|
let
|
||||||
editor = ["nvim.desktop" "Helix.desktop" "code.desktop" "code-insiders.desktop"];
|
browser = [
|
||||||
in {
|
"google-chrome.desktop"
|
||||||
"application/json" = browser;
|
"firefox.desktop"
|
||||||
"application/pdf" = browser; # TODO: pdf viewer
|
];
|
||||||
|
editor = [
|
||||||
|
"nvim.desktop"
|
||||||
|
"Helix.desktop"
|
||||||
|
"code.desktop"
|
||||||
|
"code-insiders.desktop"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"application/json" = browser;
|
||||||
|
"application/pdf" = browser; # TODO: pdf viewer
|
||||||
|
|
||||||
"text/html" = browser;
|
"text/html" = browser;
|
||||||
"text/xml" = browser;
|
"text/xml" = browser;
|
||||||
"text/plain" = editor;
|
"text/plain" = editor;
|
||||||
"application/xml" = browser;
|
"application/xml" = browser;
|
||||||
"application/xhtml+xml" = browser;
|
"application/xhtml+xml" = browser;
|
||||||
"application/xhtml_xml" = browser;
|
"application/xhtml_xml" = browser;
|
||||||
"application/rdf+xml" = browser;
|
"application/rdf+xml" = browser;
|
||||||
"application/rss+xml" = browser;
|
"application/rss+xml" = browser;
|
||||||
"application/x-extension-htm" = browser;
|
"application/x-extension-htm" = browser;
|
||||||
"application/x-extension-html" = browser;
|
"application/x-extension-html" = browser;
|
||||||
"application/x-extension-shtml" = browser;
|
"application/x-extension-shtml" = browser;
|
||||||
"application/x-extension-xht" = browser;
|
"application/x-extension-xht" = browser;
|
||||||
"application/x-extension-xhtml" = browser;
|
"application/x-extension-xhtml" = browser;
|
||||||
"application/x-wine-extension-ini" = editor;
|
"application/x-wine-extension-ini" = editor;
|
||||||
|
|
||||||
# define default applications for some url schemes.
|
# define default applications for some url schemes.
|
||||||
"x-scheme-handler/about" = browser; # open `about:` url with `browser`
|
"x-scheme-handler/about" = browser; # open `about:` url with `browser`
|
||||||
"x-scheme-handler/ftp" = browser; # open `ftp:` url with `browser`
|
"x-scheme-handler/ftp" = browser; # open `ftp:` url with `browser`
|
||||||
"x-scheme-handler/http" = browser;
|
"x-scheme-handler/http" = browser;
|
||||||
"x-scheme-handler/https" = browser;
|
"x-scheme-handler/https" = browser;
|
||||||
# https://github.com/microsoft/vscode/issues/146408
|
# https://github.com/microsoft/vscode/issues/146408
|
||||||
"x-scheme-handler/vscode" = ["code-url-handler.desktop"]; # open `vscode://` url with `code-url-handler.desktop`
|
"x-scheme-handler/vscode" = [ "code-url-handler.desktop" ]; # open `vscode://` url with `code-url-handler.desktop`
|
||||||
"x-scheme-handler/vscode-insiders" = ["code-insiders-url-handler.desktop"]; # open `vscode-insiders://` url with `code-insiders-url-handler.desktop`
|
"x-scheme-handler/vscode-insiders" = [ "code-insiders-url-handler.desktop" ]; # open `vscode-insiders://` url with `code-insiders-url-handler.desktop`
|
||||||
"x-scheme-handler/zoommtg" = ["Zoom.desktop"];
|
"x-scheme-handler/zoommtg" = [ "Zoom.desktop" ];
|
||||||
|
|
||||||
# all other unknown schemes will be opened by this default application.
|
# all other unknown schemes will be opened by this default application.
|
||||||
# "x-scheme-handler/unknown" = editor;
|
# "x-scheme-handler/unknown" = editor;
|
||||||
|
|
||||||
"x-scheme-handler/tg" = ["org.telegram.desktop.desktop "];
|
"x-scheme-handler/tg" = [ "org.telegram.desktop.desktop " ];
|
||||||
|
|
||||||
"audio/*" = ["mpv.desktop"];
|
"audio/*" = [ "mpv.desktop" ];
|
||||||
"video/*" = ["mpv.desktop"];
|
"video/*" = [ "mpv.desktop" ];
|
||||||
"image/*" = ["imv-dir.desktop"];
|
"image/*" = [ "imv-dir.desktop" ];
|
||||||
"image/gif" = ["imv-dir.desktop"];
|
"image/gif" = [ "imv-dir.desktop" ];
|
||||||
"image/jpeg" = ["imv-dir.desktop"];
|
"image/jpeg" = [ "imv-dir.desktop" ];
|
||||||
"image/png" = ["imv-dir.desktop"];
|
"image/png" = [ "imv-dir.desktop" ];
|
||||||
"image/webp" = ["imv-dir.desktop"];
|
"image/webp" = [ "imv-dir.desktop" ];
|
||||||
|
|
||||||
"inode/directory" = ["yazi.desktop"];
|
"inode/directory" = [ "yazi.desktop" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
associations.removed = {
|
associations.removed = {
|
||||||
# ......
|
# ......
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
zed-editor
|
zed-editor
|
||||||
code-cursor
|
code-cursor
|
||||||
|
|||||||
@@ -7,11 +7,14 @@ exec-once = ln -s "$XDG_RUNTIME_DIR/hypr" /tmp/hypr
|
|||||||
# Terminals
|
# Terminals
|
||||||
exec-once = foot
|
exec-once = foot
|
||||||
exec-once = alacritty
|
exec-once = alacritty
|
||||||
|
# Network
|
||||||
|
exec-once = clash-verge &
|
||||||
# Browsers
|
# Browsers
|
||||||
exec-once = firefox
|
exec-once = firefox
|
||||||
exec-once = google-chrome-stable
|
exec-once = google-chrome-stable
|
||||||
|
exec-once = chromium-browser
|
||||||
# Chat
|
# Chat
|
||||||
exec-once = telegram-desktop
|
exec-once = Telegram
|
||||||
|
|
||||||
|
|
||||||
# Switch to Terminals & Browsers
|
# Switch to Terminals & Browsers
|
||||||
|
|||||||
@@ -134,6 +134,6 @@ bind = $mod, Print, exec, hyprshot -m window -o ~/Pictures/Screenshot
|
|||||||
bind = CTRL, Print, exec, hyprshot -m region -o ~/Pictures/Screenshots
|
bind = CTRL, Print, exec, hyprshot -m region -o ~/Pictures/Screenshots
|
||||||
|
|
||||||
# -- Others --
|
# -- Others --
|
||||||
bind = CTRL ALT, l, exec, hyprlock
|
bind = CTRL ALT, l, exec, swaylock
|
||||||
bind = $mod SHIFT, x, exec, wlogout
|
bind = $mod SHIFT, x, exec, wlogout
|
||||||
bind = $mod, n, exec, nm-connection-editor # need install network-manager-applet
|
bind = $mod, n, exec, nm-connection-editor # need install network-manager-applet
|
||||||
|
|||||||
@@ -123,11 +123,13 @@ input {
|
|||||||
|
|
||||||
natural_scroll=0
|
natural_scroll=0
|
||||||
touchpad {
|
touchpad {
|
||||||
disable_while_typing = true
|
|
||||||
natural_scroll = 1
|
natural_scroll = 1
|
||||||
clickfinger_behavior = true
|
clickfinger_behavior = true
|
||||||
tap-to-click = true
|
disable_while_typing = true # seems useless...
|
||||||
tap-and-drag = true
|
# tap - 轻触触摸板, click - 点击触摸板
|
||||||
|
# disable tap related features to avoid palm rejection.
|
||||||
|
tap-to-click = false
|
||||||
|
tap-and-drag = false
|
||||||
|
|
||||||
}
|
}
|
||||||
force_no_accel=0
|
force_no_accel=0
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ windowrulev2 = workspace 3, class:^(Zoom Workplace)$
|
|||||||
# Browsers
|
# Browsers
|
||||||
windowrulev2 = workspace 4, class:^(firefox)$
|
windowrulev2 = workspace 4, class:^(firefox)$
|
||||||
windowrulev2 = workspace 5, class:^(google-chrome)$
|
windowrulev2 = workspace 5, class:^(google-chrome)$
|
||||||
|
windowrulev2 = workspace 5, class:^(chromium-browser)$
|
||||||
# Chat
|
# Chat
|
||||||
windowrulev2 = workspace 6, class:^(QQ)$
|
windowrulev2 = workspace 6, class:^(QQ)$
|
||||||
windowrulev2 = workspace 6, class:^(wechat)$
|
windowrulev2 = workspace 6, class:^(wechat)$
|
||||||
@@ -28,6 +29,7 @@ windowrulev2 = workspace 9, class:^(code)$ # VS Code
|
|||||||
windowrulev2 = workspace 9, class:^(cursor)$ # Cursor AI Editor
|
windowrulev2 = workspace 9, class:^(cursor)$ # Cursor AI Editor
|
||||||
# Other
|
# Other
|
||||||
windowrulev2 = workspace 10, class:^(org.wireshark.Wireshark)$
|
windowrulev2 = workspace 10, class:^(org.wireshark.Wireshark)$
|
||||||
|
windowrulev2 = workspace 10, class:^(clash-verge)$
|
||||||
|
|
||||||
|
|
||||||
# Float RULE WINDOW
|
# Float RULE WINDOW
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
general {
|
general {
|
||||||
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple instances
|
lock_cmd = pidof swaylock || swaylock # avoid starting multiple instances
|
||||||
before_sleep_cmd = loginctl lock-session # lock before suspend
|
before_sleep_cmd = loginctl lock-session # lock before suspend
|
||||||
after_sleep_cmd = hyprctl dispatch dpms on # resume dpms after suspend
|
after_sleep_cmd = hyprctl dispatch dpms on # resume dpms after suspend
|
||||||
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests
|
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests
|
||||||
@@ -21,7 +21,7 @@ general {
|
|||||||
|
|
||||||
listener {
|
listener {
|
||||||
timeout = 1200 # 20 minutes
|
timeout = 1200 # 20 minutes
|
||||||
on-timeout = pidof hyprlock || hyprlock # lock screen
|
on-timeout = pidof swaylock || swaylock # lock screen
|
||||||
on-resume = hyprctl dispatch dpms on # monitor wake up
|
on-resume = hyprctl dispatch dpms on # monitor wake up
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
"modules-center": ["custom/playerctl"],
|
"modules-center": ["custom/playerctl"],
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
"battery",
|
|
||||||
"memory",
|
"memory",
|
||||||
"cpu",
|
"cpu",
|
||||||
"network",
|
"network",
|
||||||
|
"battery",
|
||||||
"clock",
|
"clock",
|
||||||
"idle_inhibitor",
|
"idle_inhibitor",
|
||||||
"custom/powermenu",
|
"custom/powermenu",
|
||||||
@@ -91,12 +91,12 @@
|
|||||||
"network": {
|
"network": {
|
||||||
"interval": 5,
|
"interval": 5,
|
||||||
"format": "{ifname}",
|
"format": "{ifname}",
|
||||||
"format-wifi": " {essid} ({signalStrength}%) Up: {bandwidthUpBits} Down: {bandwidthDownBits}",
|
"format-wifi": " {signalStrength}% Down: {bandwidthDownBytes} Up: {bandwidthUpBytes} {essid}",
|
||||||
"format-ethernet": " {ifname} Up: {bandwidthUpBits} Down: {bandwidthDownBits}",
|
"format-ethernet": " {ifname} Down: {bandwidthDownBytes} Up: {bandwidthUpBytes}",
|
||||||
"format-disconnected": "Disconnected ⚠",
|
"format-disconnected": "Disconnected ⚠",
|
||||||
"tooltip-format": " {ifname} via {gwaddri}",
|
"tooltip-format": " {ifname} via {gwaddri}",
|
||||||
"tooltip-format-wifi": " {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\nUp: {bandwidthUpBits} Down: {bandwidthDownBits}",
|
"tooltip-format-wifi": " {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\nDown: {bandwidthDownBytes} Up: {bandwidthUpBytes}",
|
||||||
"tooltip-format-ethernet": " {ifname}\nIP: {ipaddr}\n up: {bandwidthUpBits} down: {bandwidthDownBits}",
|
"tooltip-format-ethernet": " {ifname}\nIP: {ipaddr}\n Down: {bandwidthDownBytes} Up: {bandwidthUpBytes}",
|
||||||
"tooltip-format-disconnected": "Disconnected",
|
"tooltip-format-disconnected": "Disconnected",
|
||||||
"max-length": 50,
|
"max-length": 50,
|
||||||
"on-click-middle": "nm-connection-editor",
|
"on-click-middle": "nm-connection-editor",
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
"scroll-step": 5.0,
|
"scroll-step": 5.0,
|
||||||
// Commands to execute on events
|
// Commands to execute on events
|
||||||
"on-click": "amixer set Master toggle",
|
"on-click": "amixer set Master toggle",
|
||||||
"on-click-right": "pavucontrol",
|
"on-click-right": "GSK_RENDERER=opengl pavucontrol",
|
||||||
"smooth-scrolling-threshold": 1,
|
"smooth-scrolling-threshold": 1,
|
||||||
},
|
},
|
||||||
"temperature": {
|
"temperature": {
|
||||||
@@ -138,8 +138,6 @@
|
|||||||
"spacing": 5,
|
"spacing": 5,
|
||||||
},
|
},
|
||||||
"battery": {
|
"battery": {
|
||||||
"bat": "BAT0",
|
|
||||||
"adapter": "ADP0",
|
|
||||||
"interval": 60,
|
"interval": 60,
|
||||||
"states": {
|
"states": {
|
||||||
"warning": 30,
|
"warning": 30,
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
lib,
|
lib,
|
||||||
anyrun,
|
anyrun,
|
||||||
...
|
...
|
||||||
} @ args:
|
}@args:
|
||||||
with lib; let
|
with lib;
|
||||||
|
let
|
||||||
cfg = config.modules.desktop.hyprland;
|
cfg = config.modules.desktop.hyprland;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# anyrun.homeManagerModules.default # the module is already in hm now.
|
# anyrun.homeManagerModules.default # the module is already in hm now.
|
||||||
./options
|
./options
|
||||||
@@ -16,32 +18,36 @@ in {
|
|||||||
options.modules.desktop.hyprland = {
|
options.modules.desktop.hyprland = {
|
||||||
enable = mkEnableOption "hyprland compositor";
|
enable = mkEnableOption "hyprland compositor";
|
||||||
settings = lib.mkOption {
|
settings = lib.mkOption {
|
||||||
type = with lib.types; let
|
type =
|
||||||
valueType =
|
with lib.types;
|
||||||
nullOr (oneOf [
|
let
|
||||||
bool
|
valueType =
|
||||||
int
|
nullOr (oneOf [
|
||||||
float
|
bool
|
||||||
str
|
int
|
||||||
path
|
float
|
||||||
(attrsOf valueType)
|
str
|
||||||
(listOf valueType)
|
path
|
||||||
])
|
(attrsOf valueType)
|
||||||
// {
|
(listOf valueType)
|
||||||
description = "Hyprland configuration value";
|
])
|
||||||
};
|
// {
|
||||||
in
|
description = "Hyprland configuration value";
|
||||||
|
};
|
||||||
|
in
|
||||||
valueType;
|
valueType;
|
||||||
default = {};
|
default = { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (
|
config = mkIf cfg.enable (
|
||||||
mkMerge ([
|
mkMerge (
|
||||||
|
[
|
||||||
{
|
{
|
||||||
wayland.windowManager.hyprland.settings = cfg.settings;
|
wayland.windowManager.hyprland.settings = cfg.settings;
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
++ (import ./values args))
|
++ (import ./values args)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib;
|
||||||
|
let
|
||||||
cfg = config.modules.desktop.hyprland;
|
cfg = config.modules.desktop.hyprland;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.modules.desktop.hyprland = {
|
options.modules.desktop.hyprland = {
|
||||||
nvidia = mkEnableOption "whether nvidia GPU is used";
|
nvidia = mkEnableOption "whether nvidia GPU is used";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
anyrun,
|
anyrun,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
programs.anyrun = {
|
programs.anyrun = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
|||||||
@@ -1,4 +1 @@
|
|||||||
{mylib, ...} @ args:
|
{ mylib, ... }@args: map (path: import path args) (mylib.scanPaths ./.)
|
||||||
map
|
|
||||||
(path: import path args)
|
|
||||||
(mylib.scanPaths ./.)
|
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
|
pkgs-stable,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
package = pkgs.hyprland;
|
package = pkgs.hyprland;
|
||||||
in {
|
in
|
||||||
xdg.configFile = let
|
{
|
||||||
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
|
xdg.configFile =
|
||||||
hyprPath = "${config.home.homeDirectory}/nix-config/home/linux/gui/hyprland/conf";
|
let
|
||||||
in {
|
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
|
||||||
"mako".source = mkSymlink "${hyprPath}/mako";
|
hyprPath = "${config.home.homeDirectory}/nix-config/home/linux/gui/hyprland/conf";
|
||||||
"waybar".source = mkSymlink "${hyprPath}/waybar";
|
in
|
||||||
"wlogout".source = mkSymlink "${hyprPath}/wlogout";
|
{
|
||||||
"hypr/hypridle.conf".source = mkSymlink "${hyprPath}/hypridle.conf";
|
"mako".source = mkSymlink "${hyprPath}/mako";
|
||||||
"hypr/configs".source = mkSymlink "${hyprPath}/configs";
|
"waybar".source = mkSymlink "${hyprPath}/waybar";
|
||||||
};
|
"wlogout".source = mkSymlink "${hyprPath}/wlogout";
|
||||||
|
"hypr/hypridle.conf".source = mkSymlink "${hyprPath}/hypridle.conf";
|
||||||
|
"hypr/configs".source = mkSymlink "${hyprPath}/configs";
|
||||||
|
};
|
||||||
|
|
||||||
# status bar
|
# status bar
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
@@ -25,7 +30,7 @@ in {
|
|||||||
catppuccin.waybar.enable = false;
|
catppuccin.waybar.enable = false;
|
||||||
|
|
||||||
# screen locker
|
# screen locker
|
||||||
programs.hyprlock.enable = true;
|
programs.swaylock.enable = true;
|
||||||
|
|
||||||
# Logout Menu
|
# Logout Menu
|
||||||
programs.wlogout.enable = true;
|
programs.wlogout.enable = true;
|
||||||
@@ -46,15 +51,17 @@ in {
|
|||||||
inherit package;
|
inherit package;
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
source = let
|
source =
|
||||||
configPath = "${config.home.homeDirectory}/.config/hypr/configs";
|
let
|
||||||
in [
|
configPath = "${config.home.homeDirectory}/.config/hypr/configs";
|
||||||
"${configPath}/exec.conf"
|
in
|
||||||
"${configPath}/fcitx5.conf"
|
[
|
||||||
"${configPath}/keybindings.conf"
|
"${configPath}/exec.conf"
|
||||||
"${configPath}/settings.conf"
|
"${configPath}/fcitx5.conf"
|
||||||
"${configPath}/windowrules.conf"
|
"${configPath}/keybindings.conf"
|
||||||
];
|
"${configPath}/settings.conf"
|
||||||
|
"${configPath}/windowrules.conf"
|
||||||
|
];
|
||||||
env = [
|
env = [
|
||||||
"NIXOS_OZONE_WL,1" # for any ozone-based browser & electron apps to run on wayland
|
"NIXOS_OZONE_WL,1" # for any ozone-based browser & electron apps to run on wayland
|
||||||
"MOZ_ENABLE_WAYLAND,1" # for firefox to run on wayland
|
"MOZ_ENABLE_WAYLAND,1" # for firefox to run on wayland
|
||||||
@@ -71,7 +78,7 @@ in {
|
|||||||
# gammastep/wallpaper-switcher need this to be enabled.
|
# gammastep/wallpaper-switcher need this to be enabled.
|
||||||
systemd = {
|
systemd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
variables = ["--all"];
|
variables = [ "--all" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
swaybg # the wallpaper
|
swaybg # the wallpaper
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
pkgs-stable,
|
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# firefox-wayland
|
# firefox-wayland
|
||||||
nixpaks.firefox
|
nixpaks.firefox
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
programs = {
|
programs = {
|
||||||
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
||||||
google-chrome = {
|
google-chrome = {
|
||||||
enable = pkgs.stdenv.isx86_64;
|
enable = true;
|
||||||
package = pkgs-stable.google-chrome;
|
package = if pkgs.stdenv.isAarch64 then pkgs.chromium else pkgs.google-chrome;
|
||||||
|
|
||||||
# https://wiki.archlinux.org/title/Chromium#Native_Wayland_support
|
# https://wiki.archlinux.org/title/Chromium#Native_Wayland_support
|
||||||
commandLineArgs = [
|
commandLineArgs = [
|
||||||
@@ -32,25 +32,23 @@
|
|||||||
|
|
||||||
vscode = {
|
vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package = pkgs.vscode.override {
|
||||||
pkgs.vscode.override
|
isInsiders = false;
|
||||||
{
|
# https://wiki.archlinux.org/title/Wayland#Electron
|
||||||
isInsiders = false;
|
commandLineArgs = [
|
||||||
# https://wiki.archlinux.org/title/Wayland#Electron
|
"--ozone-platform-hint=auto"
|
||||||
commandLineArgs = [
|
"--ozone-platform=wayland"
|
||||||
"--ozone-platform-hint=auto"
|
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
|
||||||
"--ozone-platform=wayland"
|
# (only supported by chromium/chrome at this time, not electron)
|
||||||
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
|
"--gtk-version=4"
|
||||||
# (only supported by chromium/chrome at this time, not electron)
|
# make it use text-input-v1, which works for kwin 5.27 and weston
|
||||||
"--gtk-version=4"
|
"--enable-wayland-ime"
|
||||||
# make it use text-input-v1, which works for kwin 5.27 and weston
|
|
||||||
"--enable-wayland-ime"
|
|
||||||
|
|
||||||
# TODO: fix https://github.com/microsoft/vscode/issues/187436
|
# TODO: fix https://github.com/microsoft/vscode/issues/187436
|
||||||
# still not works...
|
# still not works...
|
||||||
"--password-store=gnome" # use gnome-keyring as password store
|
"--password-store=gnome" # use gnome-keyring as password store
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,216 @@
|
|||||||
|
{
|
||||||
|
pkgs-unstable,
|
||||||
|
nixos-apple-silicon,
|
||||||
|
my-asahi-firmware,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
nixos-apple-silicon.nixosModules.default
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.wireless.iwd = {
|
||||||
|
enable = true;
|
||||||
|
settings.General.EnableNetworkConfiguration = true;
|
||||||
|
};
|
||||||
|
# configures the network interface(include wireless) via `nmcli` & `nmtui`
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Specify path to peripheral firmware files.
|
||||||
|
hardware.asahi = {
|
||||||
|
enable = true;
|
||||||
|
peripheralFirmwareDirectory = "${my-asahi-firmware}/macbook-pro-m2-a2338";
|
||||||
|
|
||||||
|
# build the Asahi Linux Kernel with Rust support
|
||||||
|
withRust = true;
|
||||||
|
# use apple-silicon's GPU instead of CPU
|
||||||
|
useExperimentalGPUDriver = true;
|
||||||
|
# How to install the Asahi Mesa driver
|
||||||
|
experimentalGPUInstallMode = "driver"; # driver / replace(for non-flakes) / overlay
|
||||||
|
};
|
||||||
|
|
||||||
|
# After adding this snippet, you need to restart the system for the touchbar to work.
|
||||||
|
hardware.apple.touchBar = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs-unstable.tiny-dfr;
|
||||||
|
# https://github.com/WhatAmISupposedToPutHere/tiny-dfr/blob/master/share/tiny-dfr/config.toml
|
||||||
|
settings = {
|
||||||
|
# F{number} keys are shown when Fn is not pressed by default.
|
||||||
|
# Set this to true if you want the media keys to be shown without Fn pressed
|
||||||
|
MediaLayerDefault = true;
|
||||||
|
|
||||||
|
# Set this to false if you want to hide the button outline,
|
||||||
|
# leaving only the text/logo
|
||||||
|
ShowButtonOutlines = true;
|
||||||
|
|
||||||
|
# Set this to true to slowly shift the entire screen contents.
|
||||||
|
# In theory this helps with screen longevity, but macos does not bother doing it
|
||||||
|
# Disabling ShowButtonOutlines will make this effect less noticeable to the eye
|
||||||
|
EnablePixelShift = true;
|
||||||
|
|
||||||
|
# This key defines the contents of the primary layer
|
||||||
|
# (the one with F{number} keys)
|
||||||
|
# You can change the individual buttons, add, or remove them
|
||||||
|
# Any number of keys that is greater than 0 is allowed
|
||||||
|
# however rendering will start to break around 24 keys
|
||||||
|
# Buttons can be made larger by setting the optional Stretch field
|
||||||
|
# to a number greater than 1 (which means the button will take up
|
||||||
|
# that many button spaces).
|
||||||
|
PrimaryLayerKeys = [
|
||||||
|
# Action defines the key code to send when the button is pressed
|
||||||
|
# Text defines the button label
|
||||||
|
# Icon specifies the icon to be used for the button.
|
||||||
|
# Theme specifies the XDG icons theme.
|
||||||
|
# Stretch specifies how many button spaces the button should take up
|
||||||
|
# and defaults to 1
|
||||||
|
# Icons can either be svgs or pngs, with svgs being preferred
|
||||||
|
# For best results with pngs, they should be 48x48
|
||||||
|
# Do not include the extension in the file name.
|
||||||
|
# If a Theme is set, icons are looked up in XDG_DATA_DIRS.
|
||||||
|
# Otherwise, they are first looked up in /etc/tiny-dfr, and then in /usr/share/tiny-dfr.
|
||||||
|
# Time can be either 24hr, or 12hr. Locale is optional and will default to POSIX.
|
||||||
|
# Only one of Text, Icon or Time is allowed,
|
||||||
|
# if both are present, the behavior is undefined.
|
||||||
|
# For the list of supported key codes see
|
||||||
|
# https://docs.rs/input-linux/latest/input_linux/enum.Key.html
|
||||||
|
# Note that the escape key is not specified here, as it is added
|
||||||
|
# automatically on Macs without a physical one
|
||||||
|
{
|
||||||
|
Text = "F1";
|
||||||
|
Action = "F1";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F2";
|
||||||
|
Action = "F2";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F3";
|
||||||
|
Action = "F3";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F4";
|
||||||
|
Action = "F4";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F5";
|
||||||
|
Action = "F5";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F6";
|
||||||
|
Action = "F6";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F7";
|
||||||
|
Action = "F7";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F8";
|
||||||
|
Action = "F8";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F9";
|
||||||
|
Action = "F9";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F10";
|
||||||
|
Action = "F10";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F11";
|
||||||
|
Action = "F11";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "F12";
|
||||||
|
Action = "F12";
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Text = "Home";
|
||||||
|
Action = "Home";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "End";
|
||||||
|
Action = "End";
|
||||||
|
}
|
||||||
|
|
||||||
|
# for screenshot shortcut
|
||||||
|
{
|
||||||
|
Text = "Print";
|
||||||
|
Action = "Print";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
# This key defines the contents of the media key layer
|
||||||
|
MediaLayerKeys = [
|
||||||
|
{
|
||||||
|
Icon = "brightness_low";
|
||||||
|
Action = "BrightnessDown";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "brightness_high";
|
||||||
|
Action = "BrightnessUp";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "mic_off";
|
||||||
|
Action = "MicMute";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "search";
|
||||||
|
Action = "Search";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "backlight_low";
|
||||||
|
Action = "IllumDown";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "backlight_high";
|
||||||
|
Action = "IllumUp";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "fast_rewind";
|
||||||
|
Action = "PreviousSong";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "play_pause";
|
||||||
|
Action = "PlayPause";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "fast_forward";
|
||||||
|
Action = "NextSong";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "volume_off";
|
||||||
|
Action = "Mute";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "volume_down";
|
||||||
|
Action = "VolumeDown";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Icon = "volume_up";
|
||||||
|
Action = "VolumeUp";
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Text = "Home";
|
||||||
|
Action = "Home";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Text = "End";
|
||||||
|
Action = "End";
|
||||||
|
}
|
||||||
|
|
||||||
|
# for screenshot shortcut
|
||||||
|
{
|
||||||
|
Text = "Print";
|
||||||
|
Action = "Print";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# For ` to < and ~ to > (for those with US keyboards)
|
||||||
|
# boot.extraModprobeConfig = ''
|
||||||
|
# options hid_apple iso_layout=0
|
||||||
|
# '';
|
||||||
|
}
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
{myvars, ...}:
|
{
|
||||||
|
lib,
|
||||||
|
myvars,
|
||||||
|
...
|
||||||
|
}:
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Shoukei - NixOS running on Macbook Pro 2022 M2 16G
|
# Shoukei - NixOS running on Macbook Pro 2022 M2 16G
|
||||||
@@ -12,12 +16,11 @@ in {
|
|||||||
../idols-ai/preservation.nix
|
../idols-ai/preservation.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.sunshine.enable = lib.mkForce false;
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
inherit hostName;
|
inherit hostName;
|
||||||
inherit (myvars.networking) nameservers;
|
inherit (myvars.networking) nameservers;
|
||||||
|
|
||||||
# configures the network interface(include wireless) via `nmcli` & `nmtui`
|
|
||||||
networkmanager.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
|
|||||||
@@ -6,46 +6,28 @@
|
|||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
modulesPath,
|
modulesPath,
|
||||||
nixos-apple-silicon,
|
|
||||||
my-asahi-firmware,
|
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
device = "/dev/disk/by-uuid/c2e8b249-240e-4eef-bf4e-81e7dbbf4887";
|
device = "/dev/disk/by-uuid/c2e8b249-240e-4eef-bf4e-81e7dbbf4887";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
nixos-apple-silicon.nixosModules.default
|
./apple-silicon.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Specify path to peripheral firmware files.
|
|
||||||
hardware.asahi = {
|
|
||||||
enable = true;
|
|
||||||
peripheralFirmwareDirectory = "${my-asahi-firmware}/macbook-pro-m2-a2338";
|
|
||||||
|
|
||||||
# build the Asahi Linux Kernel with Rust support
|
|
||||||
withRust = true;
|
|
||||||
# use apple-silicon's GPU instead of CPU
|
|
||||||
useExperimentalGPUDriver = true;
|
|
||||||
# How to install the Asahi Mesa driver
|
|
||||||
experimentalGPUInstallMode = "driver"; # driver / replace(for non-flakes) / overlay
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.wireless.iwd = {
|
|
||||||
enable = true;
|
|
||||||
settings.General.EnableNetworkConfiguration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = false;
|
boot.loader.efi.canTouchEfiVariables = false;
|
||||||
# depending on how you configured your disk mounts, change this to /boot or /boot/efi.
|
# depending on how you configured your disk mounts, change this to /boot or /boot/efi.
|
||||||
boot.loader.efi.efiSysMountPoint = "/boot";
|
boot.loader.efi.efiSysMountPoint = "/boot";
|
||||||
|
|
||||||
# For ` to < and ~ to > (for those with US keyboards)
|
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||||
# boot.extraModprobeConfig = ''
|
boot.binfmt.emulatedSystems = [
|
||||||
# options hid_apple iso_layout=0
|
"x86_64-linux"
|
||||||
# '';
|
"riscv64-linux"
|
||||||
|
];
|
||||||
# supported file systems, so we can mount any removable disks with these filesystems
|
# supported file systems, so we can mount any removable disks with these filesystems
|
||||||
boot.supportedFilesystems = lib.mkForce [
|
boot.supportedFilesystems = lib.mkForce [
|
||||||
"ext4"
|
"ext4"
|
||||||
@@ -153,7 +135,7 @@ in {
|
|||||||
# remount swapfile in read-write mode
|
# remount swapfile in read-write mode
|
||||||
fileSystems."/swap/swapfile" = {
|
fileSystems."/swap/swapfile" = {
|
||||||
# the swapfile is located in /swap subvolume, so we need to mount /swap first.
|
# the swapfile is located in /swap subvolume, so we need to mount /swap first.
|
||||||
depends = ["/swap"];
|
depends = [ "/swap" ];
|
||||||
|
|
||||||
device = "/swap/swapfile";
|
device = "/swap/swapfile";
|
||||||
fsType = "none";
|
fsType = "none";
|
||||||
@@ -164,7 +146,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices = [
|
||||||
{device = "/swap/swapfile";}
|
{ device = "/swap/swapfile"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info.
|
# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info.
|
||||||
# highres: get the best possible resolution
|
# highres: get the best possible resolution
|
||||||
# auto: position automatically
|
# auto: position automatically
|
||||||
# 1.25: scale to 1.25 times
|
# 1.33: scale to 1.33 times
|
||||||
# bitdepth,10: enable 10 bit support
|
# bitdepth,10: enable 10 bit support
|
||||||
monitor=eDP-1, highres@highrr, 0x0, 1.25, bitdepth,10
|
monitor=eDP-1, highres@highrr, 0x0, 1.33, bitdepth,10
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ _:
|
|||||||
#############################################################
|
#############################################################
|
||||||
let
|
let
|
||||||
hostname = "fern";
|
hostname = "fern";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
networking.computerName = hostname;
|
networking.computerName = hostname;
|
||||||
system.defaults.smb.NetBIOSName = hostname;
|
system.defaults.smb.NetBIOSName = hostname;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{config, ...}: let
|
{ config, ... }:
|
||||||
|
let
|
||||||
hostName = "fern";
|
hostName = "fern";
|
||||||
in {
|
in
|
||||||
programs.ssh.matchBlocks."github.com".identityFile = "${config.home.homeDirectory}/.ssh/${hostName}";
|
{
|
||||||
|
programs.ssh.matchBlocks."github.com".identityFile =
|
||||||
|
"${config.home.homeDirectory}/.ssh/${hostName}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ _:
|
|||||||
#############################################################
|
#############################################################
|
||||||
let
|
let
|
||||||
hostname = "frieren";
|
hostname = "frieren";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
networking.computerName = hostname;
|
networking.computerName = hostname;
|
||||||
system.defaults.smb.NetBIOSName = hostname;
|
system.defaults.smb.NetBIOSName = hostname;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{config, ...}: let
|
{ config, ... }:
|
||||||
|
let
|
||||||
hostName = "frieren";
|
hostName = "frieren";
|
||||||
in {
|
in
|
||||||
programs.ssh.matchBlocks."github.com".identityFile = "${config.home.homeDirectory}/.ssh/${hostName}";
|
{
|
||||||
|
programs.ssh.matchBlocks."github.com".identityFile =
|
||||||
|
"${config.home.homeDirectory}/.ssh/${hostName}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
@@ -2,13 +2,15 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
nixpkgs-ollama,
|
nixpkgs-ollama,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
pkgs-ollama = import nixpkgs-ollama {
|
pkgs-ollama = import nixpkgs-ollama {
|
||||||
inherit (pkgs) system;
|
inherit (pkgs) system;
|
||||||
# To use cuda, we need to allow the installation of non-free software
|
# To use cuda, we need to allow the installation of non-free software
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
services.ollama = rec {
|
services.ollama = rec {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs-ollama.ollama;
|
package = pkgs-ollama.ollama;
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
let
|
let
|
||||||
hostName = "ai"; # Define your hostname.
|
hostName = "ai"; # Define your hostname.
|
||||||
|
|
||||||
inherit (myvars.networking) defaultGateway defaultGateway6 nameservers;
|
inherit (myvars.networking) mainGateway mainGateway6 nameservers;
|
||||||
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4 ipv6;
|
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4 ipv6;
|
||||||
ipv4WithMask = "${ipv4}/24";
|
ipv4WithMask = "${ipv4}/24";
|
||||||
ipv6WithMask = "${ipv6}/64";
|
ipv6WithMask = "${ipv6}/64";
|
||||||
@@ -17,6 +17,7 @@ in {
|
|||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./nvidia.nix
|
./nvidia.nix
|
||||||
|
./ai
|
||||||
|
|
||||||
./preservation.nix
|
./preservation.nix
|
||||||
./secureboot.nix
|
./secureboot.nix
|
||||||
@@ -36,7 +37,10 @@ in {
|
|||||||
systemd.network.networks."10-${iface}" = {
|
systemd.network.networks."10-${iface}" = {
|
||||||
matchConfig.Name = [iface];
|
matchConfig.Name = [iface];
|
||||||
networkConfig = {
|
networkConfig = {
|
||||||
Address = [ipv4WithMask ipv6WithMask];
|
Address = [
|
||||||
|
ipv4WithMask
|
||||||
|
ipv6WithMask
|
||||||
|
];
|
||||||
DNS = nameservers;
|
DNS = nameservers;
|
||||||
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
|
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
|
||||||
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
|
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
|
||||||
@@ -45,11 +49,11 @@ in {
|
|||||||
routes = [
|
routes = [
|
||||||
{
|
{
|
||||||
Destination = "0.0.0.0/0";
|
Destination = "0.0.0.0/0";
|
||||||
Gateway = defaultGateway;
|
Gateway = mainGateway;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Destination = "::/0";
|
Destination = "::/0";
|
||||||
Gateway = defaultGateway6;
|
Gateway = mainGateway6;
|
||||||
GatewayOnLink = true; # it's a gateway on local link.
|
GatewayOnLink = true; # it's a gateway on local link.
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user