Compare commits
1
Commits
master
..
832733f931
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
832733f931
|
@@ -49,11 +49,3 @@ alias offline := switch-offline
|
||||
@fmt:
|
||||
echo "Formatting files..."
|
||||
nix fmt
|
||||
|
||||
@sync-noctalia:
|
||||
echo "Folding noctalia GUI overrides back into the repo..."
|
||||
python3 scripts/sync-noctalia.py --apply
|
||||
|
||||
@sync-noctalia-preview:
|
||||
echo "Previewing noctalia config sync (no changes)..."
|
||||
python3 scripts/sync-noctalia.py
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
This repository is home to the nix code that builds my systems:
|
||||
Currently, this repository contains the nix code that builds:
|
||||
|
||||
1. NixOS Desktop (`imxyy-nix`): NixOS with home-manager, niri, neovim, etc.
|
||||
2. NixOS Laptop (`imxyy-nix-x16`): the desktop profile on a laptop
|
||||
3. NixOS home server (`imxyy-nix-server`)
|
||||
4. NixOS WSL (`imxyy-nix-wsl`)
|
||||
1. NixOS Desktop: NixOS with home-manager, niri, neovim, etc.
|
||||
2. NixOS home server
|
||||
3. NixOS WSL
|
||||
|
||||
See [./hosts](./hosts) for details of each host.
|
||||
|
||||
@@ -28,15 +27,12 @@ enabling declarative host definitions and cleaner separation of concerns.
|
||||
|
||||
## Folder Structure
|
||||
|
||||
- `modules/` - custom NixOS modules, auto-imported via `lib.umport`
|
||||
- `modules/` - custom NixOS modules
|
||||
- `modules/core/` - core system modules (nix, persistence, time, user, xdg)
|
||||
- `modules/cli/` - command-line tools and utilities
|
||||
- `modules/coding/` - development environments and editors
|
||||
- `modules/desktop/` - desktop applications and window managers
|
||||
- `modules/virt/` - virtualization configurations
|
||||
- `modules/i18n/` - locale and input method (fcitx5)
|
||||
- `modules/programs/` - misc system programs (e.g. ollama)
|
||||
- `modules/*.nix` - standalone modules (audio, bluetooth, fonts, gpg, sops, etc.)
|
||||
- `profiles/` - system configuration profiles
|
||||
- `profiles/base.nix` - base configuration for all hosts
|
||||
- `profiles/desktop.nix` - desktop environment configuration
|
||||
@@ -45,10 +41,9 @@ enabling declarative host definitions and cleaner separation of concerns.
|
||||
- `hosts/<name>/` - host-specific configs
|
||||
- `flake/` - flake-parts modules
|
||||
- `flake/hosts.nix` - declarative host definitions
|
||||
- `flake/pkgs.nix` - custom packages exported from the flake
|
||||
- `flake/overlays/` - nixpkgs overlays and patches
|
||||
- `lib/` - custom nix library
|
||||
- `pkgs/` - custom packages
|
||||
- `overlays/` - nixpkgs overlays
|
||||
- `vars.nix` - my variables
|
||||
- `secrets/` - secrets managed by sops-nix. see [./secrets](./secrets) for details
|
||||
- `flake.nix` - flake entry
|
||||
|
||||
Generated
+723
-243
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,12 @@
|
||||
|
||||
inputs = {
|
||||
# Nixpkgs
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
multiverse.url = "github:fzakaria/nixpkgs-multiverse";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/release-25.11";
|
||||
nixpkgs-master.url = "github:nixos/nixpkgs/master";
|
||||
# nixpkgs.follows = "nixpkgs-stable";
|
||||
nixpkgs.follows = "nixpkgs-unstable";
|
||||
# nixpkgs.follows = "nixpkgs-master";
|
||||
|
||||
# Home manager
|
||||
home-manager = {
|
||||
@@ -16,7 +20,6 @@
|
||||
nixos-wsl = {
|
||||
url = "github:nix-community/NixOS-WSL";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-compat.follows = "flake-compat";
|
||||
};
|
||||
|
||||
# Flake organization tools
|
||||
@@ -37,20 +40,20 @@
|
||||
|
||||
# Useful modules
|
||||
# keep-sorted start block=yes
|
||||
impermanence = {
|
||||
url = "github:nix-community/impermanence";
|
||||
catppuccin = {
|
||||
url = "github:catppuccin/nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
};
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
# TODO: sops-nix: remove pr patch once merged
|
||||
# https://github.com/Mic92/sops-nix/pull/779
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
url = "github:Mic92/sops-nix/pull/779/merge";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
stylix = {
|
||||
url = "github:danth/stylix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-parts.follows = "flake-parts";
|
||||
inputs.systems.follows = "systems";
|
||||
};
|
||||
system76-scheduler-niri = {
|
||||
url = "github:Kirottu/system76-scheduler-niri";
|
||||
@@ -68,47 +71,21 @@
|
||||
url = "github:Bali10050/Darkly";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
fast-nix-gc = {
|
||||
url = "github:Mic92/fast-nix-gc";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.treefmt-nix.follows = "treefmt";
|
||||
};
|
||||
fenix = {
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
llm-agents = {
|
||||
url = "github:numtide/llm-agents.nix";
|
||||
# Not followed intentionally (binary cache)
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-parts.follows = "flake-parts";
|
||||
inputs.systems.follows = "systems";
|
||||
inputs.treefmt-nix.follows = "treefmt";
|
||||
};
|
||||
niri-nix = {
|
||||
url = "git+https://codeberg.org/bananad3v/niri-nix";
|
||||
go-musicfox = {
|
||||
url = "github:imxyy1soope1/go-musicfox";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nix-tree-rs = {
|
||||
url = "github:Mic92/nix-tree-rs";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-parts.follows = "flake-parts";
|
||||
inputs.treefmt-nix.follows = "treefmt";
|
||||
};
|
||||
niri.url = "github:sodiboo/niri-flake";
|
||||
noctalia = {
|
||||
url = "github:noctalia-dev/noctalia-shell/v5.0.0-beta.10";
|
||||
url = "github:noctalia-dev/noctalia-shell/v4.3.3";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
selector4nix = {
|
||||
url = "github:StarryReverie/selector4nix";
|
||||
inputs.flake-parts.follows = "flake-parts";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
zen = {
|
||||
url = "github:0xc000022070/zen-browser-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.home-manager.follows = "home-manager";
|
||||
};
|
||||
zen.inputs.nixpkgs.follows = "nixpkgs";
|
||||
zen.url = "github:0xc000022070/zen-browser-flake";
|
||||
# keep-sorted end
|
||||
|
||||
# Misc
|
||||
@@ -116,15 +93,11 @@
|
||||
url = "github:numtide/treefmt-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
my-templates.url = "git+https://git.imxyy.top/imxyy1soope1/flake-templates";
|
||||
|
||||
# Flattened indirect dependencies
|
||||
flake-compat.url = "github:edolstra/flake-compat";
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
inputs.systems.follows = "systems";
|
||||
plant = {
|
||||
url = "git+ssh://git@git.imxyy.top:2222/imxyy1soope1/HF-plant.git?rev=08dc0b3889797eb3618c7475c3c367ec0e5fdf40";
|
||||
flake = false;
|
||||
};
|
||||
systems.url = "github:nix-systems/default";
|
||||
my-templates.url = "git+https://git.imxyy.top/imxyy1soope1/flake-templates";
|
||||
};
|
||||
|
||||
outputs =
|
||||
@@ -147,6 +120,7 @@
|
||||
./flake/hosts.nix
|
||||
./flake/pkgs.nix
|
||||
./treefmt.nix
|
||||
./overlays
|
||||
];
|
||||
|
||||
nixosHosts = {
|
||||
|
||||
+24
-21
@@ -2,25 +2,20 @@
|
||||
self,
|
||||
lib,
|
||||
inputs,
|
||||
withSystem,
|
||||
config,
|
||||
pkgsParams,
|
||||
...
|
||||
}:
|
||||
let
|
||||
vars = import ../vars.nix;
|
||||
pkgsModule = args: {
|
||||
nixpkgs = lib.mkMerge [
|
||||
pkgsParams
|
||||
{
|
||||
overlays = import ./overlays args;
|
||||
}
|
||||
];
|
||||
pkgsModule = {
|
||||
nixpkgs = pkgsParams;
|
||||
};
|
||||
hmModule = {
|
||||
home-manager = {
|
||||
sharedModules = [
|
||||
# keep-sorted start
|
||||
inputs.niri-nix.homeModules.default
|
||||
inputs.noctalia.homeModules.default
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
inputs.stylix.homeModules.stylix
|
||||
@@ -34,16 +29,6 @@ let
|
||||
useGlobalPkgs = true;
|
||||
};
|
||||
};
|
||||
upstreamModules = [
|
||||
# keep-sorted start
|
||||
inputs.angrr.nixosModules.angrr
|
||||
inputs.home-manager.nixosModules.default
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
inputs.niri-nix.nixosModules.default
|
||||
inputs.selector4nix.nixosModules.selector4nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
# keep-sorted end
|
||||
];
|
||||
in
|
||||
{
|
||||
options.nixosHosts = lib.mkOption {
|
||||
@@ -66,11 +51,13 @@ in
|
||||
|
||||
modules = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.deferredModule;
|
||||
default = lib.umport {
|
||||
default = (
|
||||
lib.umport {
|
||||
paths = [ ../hosts/${name} ];
|
||||
extraExcludePredicate = path: lib.hasInfix "/_" (toString path);
|
||||
recursive = true;
|
||||
};
|
||||
}
|
||||
);
|
||||
description = "Additional NixOS modules specific to this host";
|
||||
};
|
||||
|
||||
@@ -91,6 +78,8 @@ in
|
||||
# Generate nixosConfigurations from declarative host definitions
|
||||
flake.nixosConfigurations = lib.mapAttrs (
|
||||
hostname: hostConfig:
|
||||
withSystem hostConfig.system (
|
||||
{ ... }:
|
||||
lib.nixosSystem {
|
||||
inherit (hostConfig) system;
|
||||
|
||||
@@ -117,25 +106,39 @@ in
|
||||
// hostConfig.extraSpecialArgs;
|
||||
|
||||
modules =
|
||||
# Automatically import all feature modules
|
||||
(lib.umport {
|
||||
paths = [ ../modules ];
|
||||
extraExcludePredicate = path: lib.hasInfix "/_" (toString path);
|
||||
recursive = true;
|
||||
})
|
||||
++ [
|
||||
# Base profile (always included)
|
||||
../profiles/base.nix
|
||||
]
|
||||
# Add requested profiles
|
||||
++ (map (profile: ../profiles/${profile}.nix) hostConfig.profiles)
|
||||
# Add host-specific modules
|
||||
++ hostConfig.modules
|
||||
++ upstreamModules
|
||||
++ [
|
||||
(lib.mkAliasOptionModule [ "my" "hm" ] [ "home-manager" "users" vars.username ])
|
||||
|
||||
# Upstream modules
|
||||
# keep-sorted start
|
||||
inputs.angrr.nixosModules.angrr
|
||||
inputs.catppuccin.nixosModules.catppuccin
|
||||
inputs.home-manager.nixosModules.default
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
inputs.niri.nixosModules.niri
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
# keep-sorted end
|
||||
|
||||
# pkgs and home-manager configuration
|
||||
pkgsModule
|
||||
hmModule
|
||||
];
|
||||
}
|
||||
)
|
||||
) config.nixosHosts;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
[
|
||||
(final: _prev: {
|
||||
mv = inputs.multiverse.lib.mkMultiverse {
|
||||
inherit (final.stdenv.hostPlatform) system;
|
||||
inherit (config.nixpkgs) config;
|
||||
};
|
||||
})
|
||||
(
|
||||
final: prev:
|
||||
lib.infuse prev {
|
||||
cage.__output.patches.__append = [ ./cage-specify-output-name.patch ];
|
||||
bottles.__input.removeWarningPopup.__assign = true;
|
||||
}
|
||||
)
|
||||
]
|
||||
+7
-17
@@ -9,26 +9,16 @@
|
||||
_module.args = {
|
||||
pkgsParams = {
|
||||
overlays = builtins.attrValues config.flake.overlays ++ [
|
||||
inputs.niri-nix.overlays.niri-nix
|
||||
inputs.go-musicfox.overlays.default
|
||||
inputs.niri.overlays.niri
|
||||
inputs.fenix.overlays.default
|
||||
inputs.angrr.overlays.default
|
||||
inputs.llm-agents.overlays.shared-nixpkgs
|
||||
(
|
||||
final: prev:
|
||||
let
|
||||
system = final.stdenv.hostPlatform.system;
|
||||
in
|
||||
{
|
||||
darkly-qt6 = inputs.darkly.packages.${system}.darkly-qt6;
|
||||
(final: prev: {
|
||||
darkly-qt5 = inputs.darkly.packages.${final.stdenv.hostPlatform.system}.darkly-qt5;
|
||||
darkly-qt6 = inputs.darkly.packages.${final.stdenv.hostPlatform.system}.darkly-qt6;
|
||||
|
||||
noctalia-shell = inputs.noctalia.packages.${system}.default;
|
||||
|
||||
nix-tree-rs = inputs.nix-tree-rs.packages.${system}.default;
|
||||
fast-nix-gc = inputs.fast-nix-gc.packages.${system}.default.overrideAttrs {
|
||||
doCheck = false;
|
||||
};
|
||||
}
|
||||
)
|
||||
noctalia-shell = inputs.noctalia.packages.${final.stdenv.hostPlatform.system}.default;
|
||||
})
|
||||
];
|
||||
config.allowUnfree = true;
|
||||
flake.setNixPath = false;
|
||||
|
||||
@@ -2,18 +2,6 @@
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
email = "acme@imxyy.top";
|
||||
globalConfig = ''
|
||||
servers {
|
||||
listener_wrappers {
|
||||
proxy_protocol {
|
||||
timeout 5s
|
||||
allow 127.0.0.1/32
|
||||
}
|
||||
tls
|
||||
}
|
||||
trusted_proxies static 127.0.0.1
|
||||
}
|
||||
'';
|
||||
};
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
users.users.coder.extraGroups = [ "podman" ];
|
||||
services.caddy.virtualHosts."coder.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :8086
|
||||
reverse_proxy :8086 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "coder.imxyy.top" ];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
virtualisation.oci-containers.backend = lib.mkForce "podman";
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
dockerSocket.enable = true;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
# avoid collision with dnsmasq
|
||||
virtualisation.containers = {
|
||||
containersConf.settings.network.dns_bind_port = 5353;
|
||||
};
|
||||
}
|
||||
@@ -7,13 +7,12 @@
|
||||
};
|
||||
virtualisation.oci-containers.containers = {
|
||||
tuwunel = {
|
||||
image = "ghcr.io/matrix-construct/tuwunel:latest";
|
||||
image = "jevolk/tuwunel:latest";
|
||||
volumes = [
|
||||
"tuwunel_db:/var/lib/tuwunel"
|
||||
];
|
||||
ports = [ "6167:6167" ];
|
||||
networks = [ "podman" ];
|
||||
extraOptions = [ "--pids-limit=-1" ];
|
||||
environment = {
|
||||
TUWUNEL_SERVER_NAME = "mtx.eflx.top";
|
||||
TUWUNEL_PORT = "6167";
|
||||
@@ -25,6 +24,13 @@
|
||||
config.sops.secrets.efl-tuwunel-env.path
|
||||
];
|
||||
};
|
||||
mautrix-telegram = {
|
||||
image = "dock.mau.dev/mautrix/telegram:latest";
|
||||
ports = [ "8099:8099" ];
|
||||
networks = [ "podman" ];
|
||||
extraOptions = [ "--ip=10.88.0.254" ];
|
||||
volumes = [ "/var/lib/efl-mautrix-telegram:/data" ];
|
||||
};
|
||||
|
||||
send = {
|
||||
image = "lanol/filecodebox:latest";
|
||||
@@ -34,16 +40,16 @@
|
||||
};
|
||||
services.caddy.virtualHosts."mtx.eflx.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :6167
|
||||
reverse_proxy :6167 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
};
|
||||
services.caddy.virtualHosts."send.eflx.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :12345
|
||||
reverse_proxy :12345 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [
|
||||
"mtx.eflx.top"
|
||||
"send.eflx.top"
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.frp;
|
||||
mkServer = domain: [
|
||||
{
|
||||
name = "${domain}-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ domain ];
|
||||
}
|
||||
{
|
||||
name = "${domain}-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ domain ];
|
||||
transport.proxyProtocolVersion = "v2";
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
options = {
|
||||
my.services.frp.webServers = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
services.frp.instances."".settings.proxies = builtins.concatLists (map mkServer cfg.webServers);
|
||||
};
|
||||
}
|
||||
@@ -1,19 +1,11 @@
|
||||
{
|
||||
services.caddy.virtualHosts."git.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :8082
|
||||
reverse_proxy :8082 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "git.imxyy.top" ];
|
||||
services.frp.instances."".settings.proxies = [
|
||||
{
|
||||
name = "gitea-ssh";
|
||||
type = "tcp";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 2222;
|
||||
remotePort = 2222;
|
||||
}
|
||||
];
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
appName = "imxyy_soope_'s Gitea";
|
||||
@@ -33,10 +25,7 @@
|
||||
SSH_PORT = 2222;
|
||||
};
|
||||
service = {
|
||||
DISABLE_REGISTRATION = true;
|
||||
};
|
||||
security = {
|
||||
REVERSE_PROXY_TRUSTED_PROXIES = "127.0.0.0/8,::1/128";
|
||||
REGISTER_MANUAL_CONFIRM = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
http_addr = "0.0.0.0";
|
||||
http_port = 8090;
|
||||
domain = "grafana.imxyy.top";
|
||||
};
|
||||
};
|
||||
};
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 8091;
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
port = 8092;
|
||||
enabledCollectors = [
|
||||
"systemd"
|
||||
"zfs"
|
||||
];
|
||||
};
|
||||
};
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "node";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "127.0.0.1:8092" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
services.caddy.virtualHosts."grafana.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :8090 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
btrfs = "/dev/disk/by-uuid/1e1b403d-4a04-46ee-a6eb-cb4dd5f793a2";
|
||||
btrfs = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0";
|
||||
in
|
||||
{
|
||||
boot.initrd.availableKernelModules = [
|
||||
@@ -18,11 +18,12 @@ in
|
||||
];
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_xanmod; # LTS
|
||||
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_xanmod_stable;
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.tmp.useTmpfs = true;
|
||||
boot.supportedFilesystems = [ "zfs" ];
|
||||
boot.zfs = {
|
||||
package = pkgs.zfs_unstable;
|
||||
extraPools = [ "data" ];
|
||||
forceImportRoot = false;
|
||||
};
|
||||
@@ -30,12 +31,13 @@ in
|
||||
services.btrfs.autoScrub.enable = true;
|
||||
networking.hostId = "10ca95b4";
|
||||
|
||||
my.persist.btrfs = {
|
||||
fileSystems."/" = {
|
||||
device = btrfs;
|
||||
mountPoint = "/nix/persist";
|
||||
persistSubvol = "persist";
|
||||
rootSubvol = "root";
|
||||
zstdCompress = true;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd"
|
||||
"subvol=root"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
@@ -47,25 +49,44 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/swap" = {
|
||||
my.persist.location = "/nix/persist";
|
||||
fileSystems."/nix/persist" = {
|
||||
device = btrfs;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"noatime"
|
||||
"subvol=swap"
|
||||
"compress=zstd"
|
||||
"subvol=persist"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/swap/swapfile";
|
||||
size = 24 * 1024;
|
||||
|
||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||
mkdir /btrfs_tmp
|
||||
mount ${btrfs} /btrfs_tmp
|
||||
mkdir -p /btrfs_tmp/old_roots
|
||||
if [[ -e /btrfs_tmp/root ]]; then
|
||||
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
||||
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
||||
fi
|
||||
|
||||
delete_subvolume_recursively() {
|
||||
IFS=$'\n'
|
||||
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||
delete_subvolume_recursively "/btrfs_tmp/$i"
|
||||
done
|
||||
btrfs subvolume delete "$1"
|
||||
}
|
||||
];
|
||||
boot.zswap.enable = true;
|
||||
|
||||
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +14); do
|
||||
delete_subvolume_recursively "$i"
|
||||
done
|
||||
|
||||
btrfs subvolume create /btrfs_tmp/root
|
||||
umount /btrfs_tmp
|
||||
'';
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/58F4-135A";
|
||||
device = "/dev/disk/by-uuid/32AA-2998";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"uid=0"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
coding.langs.lua.enable = true;
|
||||
coding.langs.rust.enable = true;
|
||||
coding.langs.js.enable = true;
|
||||
coding.agents.enable = true;
|
||||
fonts.enable = lib.mkForce false;
|
||||
persist = {
|
||||
enable = true;
|
||||
|
||||
@@ -11,5 +11,4 @@
|
||||
reverse_proxy :8085
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "home.imxyy.top" ];
|
||||
}
|
||||
|
||||
@@ -13,8 +13,9 @@
|
||||
};
|
||||
services.caddy.virtualHosts."immich.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :8096
|
||||
reverse_proxy :8096 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "immich.imxyy.top" ];
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
services.caddy.virtualHosts."linspirer.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :8800
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "linspirer.imxyy.top" ];
|
||||
}
|
||||
@@ -46,8 +46,9 @@
|
||||
};
|
||||
services.caddy.virtualHosts."mail.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :8087
|
||||
reverse_proxy :8087 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "mail.imxyy.top" ];
|
||||
}
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
secrets,
|
||||
...
|
||||
}:
|
||||
{
|
||||
nixpkgs.config.permittedInsecurePackages =
|
||||
lib.warn
|
||||
''
|
||||
mautrix-telegram still using olm-3.2.16
|
||||
''
|
||||
[
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"olm-3.2.16"
|
||||
];
|
||||
sops.secrets.tuwunel-reg-token = {
|
||||
@@ -74,10 +67,6 @@
|
||||
reverse_proxy :8094
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [
|
||||
"imxyy.top"
|
||||
"matrix.imxyy.top"
|
||||
];
|
||||
|
||||
sops.secrets.mautrix-telegram = {
|
||||
sopsFile = secrets.mautrix-telegram;
|
||||
@@ -106,12 +95,7 @@
|
||||
displayname_template = "{displayname} (Telegram)";
|
||||
permissions = {
|
||||
"@imxyy_soope_:imxyy.top" = "admin";
|
||||
"*" = "relaybot";
|
||||
};
|
||||
relaybot = {
|
||||
whitelist = [ ];
|
||||
};
|
||||
relay_user_distinguishers = [ ];
|
||||
};
|
||||
telegram = {
|
||||
# borrowed from https://github.com/telegramdesktop/tdesktop/blob/9bdc19e2fd4d497c8f403891848383a88faadc25/snap/snapcraft.yaml#L134-L135
|
||||
@@ -120,35 +104,4 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
sops.secrets.mautrix-signal = {
|
||||
sopsFile = secrets.mautrix-signal;
|
||||
restartUnits = [ "mautrix-signal.service" ];
|
||||
format = "dotenv";
|
||||
owner = "mautrix-signal";
|
||||
group = "mautrix-signal";
|
||||
};
|
||||
services.mautrix-signal = {
|
||||
enable = true;
|
||||
environmentFile = config.sops.secrets.mautrix-signal.path;
|
||||
settings = {
|
||||
homeserver = {
|
||||
address = "http://127.0.0.1:8094";
|
||||
domain = "imxyy.top";
|
||||
};
|
||||
appservice = {
|
||||
address = "http://127.0.0.1:8102";
|
||||
hostname = "127.0.0.1";
|
||||
port = 8102;
|
||||
bot_username = "signalbot";
|
||||
};
|
||||
bridge = {
|
||||
username_template = "signal_{userid}";
|
||||
alias_template = "signal_{groupname}";
|
||||
displayname_template = "{displayname} (Signal)";
|
||||
permissions = {
|
||||
"@imxyy_soope_:imxyy.top" = "admin";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{ config, secrets, ... }:
|
||||
{
|
||||
sops.secrets.minio-env = {
|
||||
sopsFile = secrets.minio;
|
||||
restartUnits = [ "minio.service" ];
|
||||
format = "dotenv";
|
||||
};
|
||||
services.minio = {
|
||||
enable = true;
|
||||
listenAddress = ":9000";
|
||||
consoleAddress = ":9001";
|
||||
region = "cn-south-gz";
|
||||
|
||||
configDir = "/mnt/nas/minio/config";
|
||||
dataDir = [
|
||||
"/mnt/nas/minio/data"
|
||||
];
|
||||
rootCredentialsFile = config.sops.secrets.minio-env.path;
|
||||
};
|
||||
}
|
||||
+346
-30
@@ -47,31 +47,81 @@
|
||||
"192.168.3.2"
|
||||
];
|
||||
|
||||
firewall = {
|
||||
firewall.enable = false;
|
||||
nftables = {
|
||||
enable = true;
|
||||
checkReversePath = false;
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
2222
|
||||
];
|
||||
extraInputRules = ''
|
||||
ip saddr { 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept
|
||||
ip6 saddr { fd00::/8, fe80::/10 } accept
|
||||
flushRuleset = true;
|
||||
ruleset = ''
|
||||
table inet firewall {
|
||||
set LANv4 {
|
||||
type ipv4_addr
|
||||
flags interval
|
||||
|
||||
elements = { 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 }
|
||||
}
|
||||
set LANv6 {
|
||||
type ipv6_addr
|
||||
flags interval
|
||||
|
||||
elements = { fd00::/8, fe80::/10 }
|
||||
}
|
||||
set tcp_ports {
|
||||
type inet_service
|
||||
flags interval
|
||||
|
||||
elements = {
|
||||
http,
|
||||
https,
|
||||
2222,
|
||||
25565
|
||||
}
|
||||
}
|
||||
|
||||
chain prerouting {
|
||||
type filter hook prerouting priority mangle; policy accept;
|
||||
|
||||
ip daddr @LANv4 accept
|
||||
ip6 daddr @LANv6 accept
|
||||
}
|
||||
|
||||
chain output {
|
||||
type filter hook output priority 100; policy accept;
|
||||
|
||||
ip daddr @LANv4 accept
|
||||
ip6 daddr @LANv6 accept
|
||||
}
|
||||
|
||||
chain input {
|
||||
type filter hook input priority 0; policy drop;
|
||||
iif lo accept
|
||||
ct state invalid drop
|
||||
ct state established,related accept
|
||||
|
||||
ip protocol { icmp, igmp } accept
|
||||
|
||||
ip saddr @LANv4 accept
|
||||
ip6 saddr @LANv6 accept
|
||||
|
||||
tcp dport 2222 ct state new limit rate 15/minute counter accept
|
||||
|
||||
tcp dport @tcp_ports counter accept
|
||||
}
|
||||
|
||||
chain forward {
|
||||
type filter hook forward priority 0; policy accept;
|
||||
}
|
||||
|
||||
chain nat {
|
||||
type nat hook postrouting priority 0; policy accept;
|
||||
ip saddr 192.168.3.0/24 masquerade
|
||||
}
|
||||
}
|
||||
'';
|
||||
filterForward = false;
|
||||
};
|
||||
nftables.enable = true;
|
||||
nat = {
|
||||
enable = true;
|
||||
externalInterface = "mac0";
|
||||
internalIPs = [ "192.168.3.0/24" ];
|
||||
};
|
||||
};
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = false;
|
||||
settings = {
|
||||
# PermitRootLogin = "yes";
|
||||
PermitRootLogin = "prohibit-password";
|
||||
@@ -93,7 +143,6 @@
|
||||
services.dae = {
|
||||
enable = true;
|
||||
configFile = config.sops.secrets.dae-imxyy-nix-server.path;
|
||||
openFirewall.enable = false;
|
||||
};
|
||||
systemd.services.dae = {
|
||||
after = [ "sops-nix.service" ];
|
||||
@@ -128,6 +177,237 @@
|
||||
serverAddr = "{{ .Envs.FRP_SERVER_ADDR }}";
|
||||
serverPort = 7000;
|
||||
auth.token = "{{ .Envs.FRP_AUTH_TOKEN }}";
|
||||
proxies = [
|
||||
{
|
||||
name = "nextcloud-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "nextcloud.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "nextcloud-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "nextcloud.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "oidc-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "oidc.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "oidc-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "oidc.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "mail-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "mail.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "mail-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "mail.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "gitea-ssh";
|
||||
type = "tcp";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 2222;
|
||||
remotePort = 2222;
|
||||
}
|
||||
{
|
||||
name = "gitea-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "git.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "gitea-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "git.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "vault-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "vault.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "vault-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "vault.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "home-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "home.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "home-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "home.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "coder-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "coder.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "coder-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "coder.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "grafana-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "grafana.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "grafana-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "grafana.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "siyuan-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "sy.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "siyuan-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "sy.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "matrix-root-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "matrix-root-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "matrix-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "matrix.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "matrix-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "matrix.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "immich-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "immich.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "immich-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "immich.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "memo-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "memo.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "memo-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "memo.imxyy.top" ];
|
||||
}
|
||||
|
||||
{
|
||||
name = "efl-matrix-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "mtx.eflx.top" ];
|
||||
}
|
||||
{
|
||||
name = "efl-matrix-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "mtx.eflx.top" ];
|
||||
}
|
||||
{
|
||||
name = "efl-send-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "send.eflx.top" ];
|
||||
}
|
||||
{
|
||||
name = "efl-send-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "send.eflx.top" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -173,17 +453,35 @@
|
||||
};
|
||||
services.caddy.virtualHosts."oidc.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :8081
|
||||
reverse_proxy :8081 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "oidc.imxyy.top" ];
|
||||
|
||||
systemd.services.ddns-go = {
|
||||
systemd.services.ddns-go =
|
||||
let
|
||||
version = "6.6.7";
|
||||
ddns-go = pkgs.buildGoModule {
|
||||
inherit version;
|
||||
pname = "ddns-go";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jeessy2";
|
||||
repo = "ddns-go";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-Ejoe6e9GFhHxQ9oIBDgDRQW9Xx1XZK+qSAXiRXLdn+c=";
|
||||
};
|
||||
meta.mainProgram = "ddns-go";
|
||||
vendorHash = "sha256-XZii7gV3DmTunYyGYzt5xXhv/VpTPIoYKbW4LnmlAgs=";
|
||||
doCheck = false;
|
||||
};
|
||||
in
|
||||
{
|
||||
description = "Go Dynamic DNS";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${lib.getExe pkgs.ddns-go} -l :9876 -f 10 -cacheTimes 180 -c /var/lib/ddns-go/config.yaml";
|
||||
ExecStart = "${lib.getExe ddns-go} -l :9876 -f 10 -cacheTimes 180 -c /var/lib/ddns-go/config.yaml";
|
||||
Restart = "always";
|
||||
RestartSec = 120;
|
||||
};
|
||||
@@ -192,18 +490,36 @@
|
||||
];
|
||||
};
|
||||
|
||||
services.dnsmasq = {
|
||||
services.dnsmasq =
|
||||
let
|
||||
subDomains = [
|
||||
"home"
|
||||
"nextcloud"
|
||||
"mail"
|
||||
"git"
|
||||
"vault"
|
||||
"coder"
|
||||
"grafana"
|
||||
"matrix"
|
||||
"note"
|
||||
"oidc"
|
||||
"mc"
|
||||
"music"
|
||||
"sy"
|
||||
"immich"
|
||||
];
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
resolveLocalQueries = false;
|
||||
settings = {
|
||||
no-resolv = true;
|
||||
server = [ "192.168.3.1" ];
|
||||
host-record = [
|
||||
"imxyy-nix-server,192.168.3.2"
|
||||
"imxyy-cloudwin,192.168.3.4"
|
||||
"printer.home,192.168.3.53"
|
||||
]
|
||||
++ (map (domain: "${domain},192.168.3.2") config.my.services.frp.webServers);
|
||||
address = map (sub: "/${sub}.imxyy.top/192.168.3.2") subDomains ++ [
|
||||
"/imxyy-nix-server/192.168.3.2"
|
||||
"/imxyy-cloudwin/192.168.3.4"
|
||||
"/printer.home/192.168.3.53"
|
||||
];
|
||||
cache-size = 0;
|
||||
log-queries = "extra";
|
||||
};
|
||||
|
||||
@@ -17,13 +17,14 @@ in
|
||||
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud34;
|
||||
package = pkgs.nextcloud32;
|
||||
extraApps = {
|
||||
inherit (pkgs.nextcloud34.packages.apps)
|
||||
inherit (pkgs.nextcloud32.packages.apps)
|
||||
bookmarks
|
||||
previewgenerator
|
||||
spreed
|
||||
notes
|
||||
registration
|
||||
;
|
||||
};
|
||||
extraAppsEnable = true;
|
||||
@@ -72,12 +73,6 @@ in
|
||||
"pm.max_spare_servers" = "12";
|
||||
};
|
||||
};
|
||||
# Fixes `The following x-forwarded-for header was received by Nextcloud: "10.88.0.1"`
|
||||
systemd.services.nextcloud-notify_push = {
|
||||
environment = {
|
||||
NEXTCLOUD_URL = lib.mkForce "http://127.0.0.1:8084";
|
||||
};
|
||||
};
|
||||
services.nginx.virtualHosts."nextcloud.imxyy.top" = {
|
||||
listen = [
|
||||
{
|
||||
@@ -113,7 +108,6 @@ in
|
||||
redir /.well-known/caldav /remote.php/dav/ 301
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "nextcloud.imxyy.top" ];
|
||||
|
||||
/*
|
||||
systemd.timers."kopia" = {
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
];
|
||||
ports = [ "8095:6806" ];
|
||||
};
|
||||
memos = {
|
||||
image = "neosmemo/memos:stable";
|
||||
volumes = [
|
||||
"/mnt/nas/memos:/var/opt/memos"
|
||||
];
|
||||
ports = [ "8097:5230" ];
|
||||
};
|
||||
};
|
||||
services.caddy.virtualHosts = {
|
||||
"sy.imxyy.top" = {
|
||||
@@ -35,6 +42,10 @@
|
||||
reverse_proxy :8095
|
||||
'';
|
||||
};
|
||||
"memo.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :8097
|
||||
'';
|
||||
};
|
||||
};
|
||||
my.services.frp.webServers = [ "sy.imxyy.top" ];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
app = pkgs.buildNpmPackage (finalAttrs: {
|
||||
pname = "HF-plant";
|
||||
version = "unstable-2025-09-21";
|
||||
|
||||
src = inputs.plant;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
npm run build
|
||||
npm run build:proxy
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir $out
|
||||
mv dist $out
|
||||
cp .env proxy-server-bundled.js $out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
npmDepsHash = "sha256-ret4BtjrEt8L1nlvJmFiejAKmbz89Z7NSiKs+qlB51w=";
|
||||
});
|
||||
in
|
||||
{
|
||||
systemd.services.HF-plant-proxy = {
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${lib.getExe pkgs.bash} -c 'source ${app}/.env; export FEISHU_APP_ID FEISHU_APP_SECRET AMAP_JSCODE; ${lib.getExe pkgs.nodejs} ${app}/proxy-server-bundled.js'";
|
||||
Restart = "always";
|
||||
RestartSec = 120;
|
||||
};
|
||||
};
|
||||
services.caddy.virtualHosts."plant.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
handle /api/* {
|
||||
reverse_proxy localhost:3001
|
||||
}
|
||||
|
||||
handle /* {
|
||||
root * ${app}/dist
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
'';
|
||||
};
|
||||
services.frp.instances."".settings.proxies = [
|
||||
{
|
||||
name = "plant-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "plant.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "plant-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "plant.imxyy.top" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
virtualisation.oci-containers.backend = lib.mkForce "podman";
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
dockerSocket.enable = true;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
virtualisation.containers = {
|
||||
containersConf.settings.network = {
|
||||
# avoid collision with dnsmasq
|
||||
dns_bind_port = 5353;
|
||||
# keep netavark rules in an isolated `table inet netavark` instead of the
|
||||
# `table ip nat` that networking.nat recreates on each nixos-rebuild switch,
|
||||
# which would otherwise evict podman's published-port DNAT rules.
|
||||
firewall_driver = "nftables";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -36,5 +36,20 @@ in
|
||||
reverse_proxy :8100
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "rss.imxyy.top" ];
|
||||
services.frp.instances."".settings.proxies = [
|
||||
{
|
||||
name = "rsshub-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "rss.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "rsshub-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "rss.imxyy.top" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -30,5 +30,20 @@
|
||||
reverse_proxy :8101
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "ssh.imxyy.top" ];
|
||||
services.frp.instances."".settings.proxies = [
|
||||
{
|
||||
name = "sshwifty-http";
|
||||
type = "http";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 80;
|
||||
customDomains = [ "ssh.imxyy.top" ];
|
||||
}
|
||||
{
|
||||
name = "sshwifty-https";
|
||||
type = "https";
|
||||
localIP = "127.0.0.1";
|
||||
localPort = 443;
|
||||
customDomains = [ "ssh.imxyy.top" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -24,8 +24,9 @@
|
||||
};
|
||||
services.caddy.virtualHosts."vault.imxyy.top" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy :8083
|
||||
reverse_proxy :8083 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
};
|
||||
my.services.frp.webServers = [ "vault.imxyy.top" ];
|
||||
}
|
||||
|
||||
@@ -30,12 +30,13 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
my.persist.btrfs = {
|
||||
fileSystems."/" = {
|
||||
device = btrfs;
|
||||
mountPoint = "/nix/persist";
|
||||
persistSubvol = "persist";
|
||||
rootSubvol = "root";
|
||||
zstdCompress = true;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd"
|
||||
"subvol=root"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
@@ -47,6 +48,42 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
my.persist.location = "/nix/persist";
|
||||
fileSystems."/nix/persist" = {
|
||||
device = btrfs;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd"
|
||||
"subvol=persist"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||
mkdir /btrfs_tmp
|
||||
mount ${btrfs} /btrfs_tmp
|
||||
mkdir -p /btrfs_tmp/old_roots
|
||||
if [[ -e /btrfs_tmp/root ]]; then
|
||||
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
||||
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
||||
fi
|
||||
|
||||
delete_subvolume_recursively() {
|
||||
IFS=$'\n'
|
||||
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||
delete_subvolume_recursively "/btrfs_tmp/$i"
|
||||
done
|
||||
btrfs subvolume delete "$1"
|
||||
}
|
||||
|
||||
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +14); do
|
||||
delete_subvolume_recursively "$i"
|
||||
done
|
||||
|
||||
btrfs subvolume create /btrfs_tmp/root
|
||||
umount /btrfs_tmp
|
||||
'';
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/96D3-93B0";
|
||||
fsType = "vfat";
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
{
|
||||
my.programs = {
|
||||
ollama.enable = true;
|
||||
|
||||
localsend.enable = true;
|
||||
|
||||
wpsoffice.enable = true;
|
||||
papers.enable = true;
|
||||
|
||||
nautilus.enable = true;
|
||||
|
||||
ayugram.enable = true;
|
||||
signal.enable = true;
|
||||
element.enable = true;
|
||||
fractal.enable = true;
|
||||
qq.enable = true;
|
||||
wechat.enable = true;
|
||||
};
|
||||
my.hm = {
|
||||
home.packages = with pkgs; [
|
||||
localsend
|
||||
|
||||
wpsoffice-cn
|
||||
wps-office-fonts
|
||||
ttf-wps-fonts
|
||||
papers
|
||||
|
||||
anki
|
||||
|
||||
ayugram-desktop
|
||||
signal-desktop
|
||||
element-desktop
|
||||
fractal
|
||||
qq
|
||||
wechat
|
||||
|
||||
gnome-clocks
|
||||
];
|
||||
programs.zsh = {
|
||||
@@ -34,15 +34,19 @@
|
||||
set -gp PATH $HOME/bin
|
||||
'';
|
||||
|
||||
wayland.windowManager.niri.settings = {
|
||||
programs.niri.settings = {
|
||||
environment.STEAM_FORCE_DESKTOPUI_SCALING = "1.25";
|
||||
output = [
|
||||
{
|
||||
_args = [ "eDP-1" ];
|
||||
mode = "1920x1200@60.002";
|
||||
outputs = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
mode = {
|
||||
width = 1920;
|
||||
height = 1200;
|
||||
refresh = 60.002;
|
||||
};
|
||||
scale = 1.25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -52,9 +56,52 @@
|
||||
coding.all.enable = true;
|
||||
desktop.all.enable = true;
|
||||
virt.moonlight.enable = true;
|
||||
i18n.fcitx5.enable = true;
|
||||
xdg.enable = true;
|
||||
|
||||
i18n.fcitx5.enable = true;
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
defaultApplications =
|
||||
let
|
||||
browser = [ config.my.desktop.browser.default.desktop ];
|
||||
editor = [ "nvim.desktop" ];
|
||||
imageviewer = [ "org.gnome.Loupe.desktop" ];
|
||||
in
|
||||
{
|
||||
"inode/directory" = [ "org.gnome.Nautilus.desktop" ];
|
||||
|
||||
"application/pdf" = [ "org.gnome.Papers.desktop" ];
|
||||
|
||||
"text/*" = editor;
|
||||
"application/json" = editor;
|
||||
"text/xml" = editor;
|
||||
"application/xml" = editor;
|
||||
"application/xhtml+xml" = editor;
|
||||
"application/xhtml_xml" = editor;
|
||||
"application/rdf+xml" = editor;
|
||||
"application/rss+xml" = editor;
|
||||
"application/x-extension-htm" = editor;
|
||||
"application/x-extension-html" = editor;
|
||||
"application/x-extension-shtml" = editor;
|
||||
"application/x-extension-xht" = editor;
|
||||
"application/x-extension-xhtml" = editor;
|
||||
|
||||
"text/html" = browser;
|
||||
"x-scheme-handler/about" = browser;
|
||||
"x-scheme-handler/ftp" = browser;
|
||||
"x-scheme-handler/http" = browser;
|
||||
"x-scheme-handler/https" = browser;
|
||||
"x-scheme-handler/unknown" = browser;
|
||||
|
||||
"audio/*" = imageviewer;
|
||||
"video/*" = imageviewer;
|
||||
"image/*" = imageviewer;
|
||||
"image/gif" = imageviewer;
|
||||
"image/jpeg" = imageviewer;
|
||||
"image/png" = imageviewer;
|
||||
"image/webp" = imageviewer;
|
||||
};
|
||||
};
|
||||
persist = {
|
||||
enable = true;
|
||||
homeDirs = [
|
||||
@@ -69,6 +116,28 @@
|
||||
|
||||
".cache"
|
||||
".local/state"
|
||||
".local/share/Anki2"
|
||||
".local/share/shotwell"
|
||||
".local/share/Kingsoft"
|
||||
|
||||
".local/share/AyuGramDesktop"
|
||||
".local/share/fractal"
|
||||
".config/Signal"
|
||||
".config/Element"
|
||||
".config/QQ"
|
||||
".xwechat"
|
||||
|
||||
".config/Kingsoft"
|
||||
".config/dconf"
|
||||
".config/pip"
|
||||
".config/sunshine"
|
||||
|
||||
".gemini"
|
||||
".claude"
|
||||
".claude-code-router"
|
||||
];
|
||||
homeFiles = [
|
||||
".claude.json"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -12,17 +12,45 @@
|
||||
my.persist.nixosDirs = [ "/etc/NetworkManager/system-connections" ];
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
firewall = {
|
||||
firewall.enable = false;
|
||||
nftables = {
|
||||
enable = true;
|
||||
checkReversePath = false;
|
||||
allowPing = false;
|
||||
extraInputRules = ''
|
||||
ip saddr { 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept
|
||||
ip6 saddr { fd00::/8, fe80::/10 } accept
|
||||
flushRuleset = true;
|
||||
ruleset = ''
|
||||
table inet firewall {
|
||||
set LANv4 {
|
||||
type ipv4_addr
|
||||
flags interval
|
||||
|
||||
elements = { 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 }
|
||||
}
|
||||
set LANv6 {
|
||||
type ipv6_addr
|
||||
flags interval
|
||||
|
||||
elements = { fd00::/8, fe80::/10 }
|
||||
}
|
||||
|
||||
chain output {
|
||||
type filter hook output priority 100; policy accept;
|
||||
}
|
||||
|
||||
chain input {
|
||||
type filter hook input priority 0; policy drop;
|
||||
iif lo accept
|
||||
ct state invalid drop
|
||||
ct state established,related accept
|
||||
|
||||
ip saddr @LANv4 accept
|
||||
ip6 saddr @LANv6 accept
|
||||
}
|
||||
|
||||
chain forward {
|
||||
type filter hook forward priority 0; policy drop;
|
||||
}
|
||||
}
|
||||
'';
|
||||
filterForward = true;
|
||||
};
|
||||
nftables.enable = true;
|
||||
};
|
||||
|
||||
sops.secrets.dae-imxyy-nix-x16 = {
|
||||
@@ -33,7 +61,6 @@
|
||||
services.dae = {
|
||||
enable = true;
|
||||
configFile = config.sops.secrets.dae-imxyy-nix-x16.path;
|
||||
openFirewall.enable = false;
|
||||
};
|
||||
systemd.services.dae.after = [ "sops-nix.service" ];
|
||||
sops.secrets.mihomo = {
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = false;
|
||||
settings = {
|
||||
# Forbid root login through SSH.
|
||||
PermitRootLogin = null;
|
||||
|
||||
@@ -34,20 +34,16 @@ in
|
||||
resumeDevice = btrfs;
|
||||
kernelParams = [
|
||||
"resume_offset=6444127"
|
||||
|
||||
# Fix connector hotplug at ly display manager
|
||||
"amdgpu.runpm=0"
|
||||
];
|
||||
|
||||
zswap.enable = true;
|
||||
};
|
||||
|
||||
my.persist.btrfs = {
|
||||
fileSystems."/" = {
|
||||
device = btrfs;
|
||||
mountPoint = "/nix/persist";
|
||||
persistSubvol = "persistent";
|
||||
rootSubvol = "root";
|
||||
zstdCompress = true;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd"
|
||||
"subvol=root"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
@@ -56,6 +52,17 @@ in
|
||||
options = [ "compress=zstd" ];
|
||||
};
|
||||
|
||||
my.persist.location = "/nix/persist";
|
||||
fileSystems."/nix/persist" = {
|
||||
device = btrfs;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd"
|
||||
"subvol=persistent"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
fileSystems."/swap" = {
|
||||
device = btrfs;
|
||||
fsType = "btrfs";
|
||||
@@ -66,6 +73,31 @@ in
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||
mkdir /btrfs_tmp
|
||||
mount ${btrfs} /btrfs_tmp
|
||||
mkdir -p /btrfs_tmp/old_roots
|
||||
if [[ -e /btrfs_tmp/root ]]; then
|
||||
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
||||
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
||||
fi
|
||||
|
||||
delete_subvolume_recursively() {
|
||||
IFS=$'\n'
|
||||
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||
delete_subvolume_recursively "/btrfs_tmp/$i"
|
||||
done
|
||||
btrfs subvolume delete "$1"
|
||||
}
|
||||
|
||||
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +14); do
|
||||
delete_subvolume_recursively "$i"
|
||||
done
|
||||
|
||||
btrfs subvolume create /btrfs_tmp/root
|
||||
umount /btrfs_tmp
|
||||
'';
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/B7DC-E9AC";
|
||||
fsType = "vfat";
|
||||
|
||||
+108
-31
@@ -1,28 +1,28 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
{
|
||||
my.programs = {
|
||||
ollama.enable = true;
|
||||
|
||||
localsend.enable = true;
|
||||
|
||||
wpsoffice.enable = true;
|
||||
papers.enable = true;
|
||||
|
||||
nautilus.enable = true;
|
||||
|
||||
ayugram.enable = true;
|
||||
signal.enable = true;
|
||||
element.enable = true;
|
||||
fractal.enable = true;
|
||||
qq.enable = true;
|
||||
wechat.enable = true;
|
||||
};
|
||||
my.hm = {
|
||||
home.packages = with pkgs; [
|
||||
localsend
|
||||
|
||||
wpsoffice-cn
|
||||
wps-office-fonts
|
||||
ttf-wps-fonts
|
||||
papers
|
||||
|
||||
anki
|
||||
|
||||
ayugram-desktop
|
||||
signal-desktop
|
||||
element-desktop
|
||||
fractal
|
||||
qq
|
||||
wechat
|
||||
|
||||
gnome-clocks
|
||||
];
|
||||
programs.zsh = {
|
||||
@@ -48,35 +48,92 @@
|
||||
'';
|
||||
};
|
||||
|
||||
wayland.windowManager.niri.settings = {
|
||||
programs.niri.settings = {
|
||||
environment.STEAM_FORCE_DESKTOPUI_SCALING = "1.25";
|
||||
output = [
|
||||
{
|
||||
_args = [ "DP-1" ];
|
||||
mode = "2560x1440@75.033";
|
||||
outputs = {
|
||||
DP-1 = {
|
||||
enable = true;
|
||||
mode = {
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
refresh = 75.033;
|
||||
};
|
||||
scale = 1.25;
|
||||
position._props = {
|
||||
position = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
};
|
||||
}
|
||||
{
|
||||
_args = [ "DP-2" ];
|
||||
mode = "2560x1440@75.033";
|
||||
};
|
||||
DP-2 = {
|
||||
enable = true;
|
||||
mode = {
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
refresh = 75.033;
|
||||
};
|
||||
scale = 1.25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
my = {
|
||||
autologin = {
|
||||
enable = true;
|
||||
user = username;
|
||||
ttys = [ 6 ];
|
||||
};
|
||||
|
||||
gpg.enable = true;
|
||||
cli.all.enable = true;
|
||||
coding.all.enable = true;
|
||||
desktop.all.enable = true;
|
||||
i18n.fcitx5.enable = true;
|
||||
xdg.enable = true;
|
||||
|
||||
i18n.fcitx5.enable = true;
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
defaultApplications =
|
||||
let
|
||||
browser = [ config.my.desktop.browser.default.desktop ];
|
||||
editor = [ "nvim.desktop" ];
|
||||
imageviewer = [ "org.gnome.Loupe.desktop" ];
|
||||
in
|
||||
{
|
||||
"inode/directory" = [ "org.gnome.Nautilus.desktop" ];
|
||||
|
||||
"application/pdf" = [ "org.gnome.Papers.desktop" ];
|
||||
|
||||
"text/*" = editor;
|
||||
"application/json" = editor;
|
||||
"text/xml" = editor;
|
||||
"application/xml" = editor;
|
||||
"application/xhtml+xml" = editor;
|
||||
"application/xhtml_xml" = editor;
|
||||
"application/rdf+xml" = editor;
|
||||
"application/rss+xml" = editor;
|
||||
"application/x-extension-htm" = editor;
|
||||
"application/x-extension-html" = editor;
|
||||
"application/x-extension-shtml" = editor;
|
||||
"application/x-extension-xht" = editor;
|
||||
"application/x-extension-xhtml" = editor;
|
||||
|
||||
"text/html" = browser;
|
||||
"x-scheme-handler/about" = browser;
|
||||
"x-scheme-handler/ftp" = browser;
|
||||
"x-scheme-handler/http" = browser;
|
||||
"x-scheme-handler/https" = browser;
|
||||
"x-scheme-handler/unknown" = browser;
|
||||
|
||||
"audio/*" = imageviewer;
|
||||
"video/*" = imageviewer;
|
||||
"image/*" = imageviewer;
|
||||
"image/gif" = imageviewer;
|
||||
"image/jpeg" = imageviewer;
|
||||
"image/png" = imageviewer;
|
||||
"image/webp" = imageviewer;
|
||||
};
|
||||
};
|
||||
persist = {
|
||||
enable = true;
|
||||
homeDirs = [
|
||||
@@ -89,8 +146,28 @@
|
||||
|
||||
".cache"
|
||||
".local/state"
|
||||
".local/share/Anki2"
|
||||
".local/share/shotwell"
|
||||
".local/share/Kingsoft"
|
||||
|
||||
".local/share/AyuGramDesktop"
|
||||
".local/share/fractal"
|
||||
".config/Signal"
|
||||
".config/Element"
|
||||
".config/QQ"
|
||||
".xwechat"
|
||||
|
||||
".config/Kingsoft"
|
||||
".config/dconf"
|
||||
".config/pip"
|
||||
".config/sunshine"
|
||||
|
||||
".gemini"
|
||||
".claude"
|
||||
".claude-code-router"
|
||||
];
|
||||
homeFiles = [
|
||||
".claude.json"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
+39
-12
@@ -24,6 +24,7 @@
|
||||
eth0 = {
|
||||
useDHCP = lib.mkForce true;
|
||||
wakeOnLan.enable = true;
|
||||
macAddress = "3C:7C:3F:7C:D3:9D";
|
||||
ipv4 = {
|
||||
addresses = [
|
||||
{
|
||||
@@ -42,22 +43,49 @@
|
||||
"192.168.3.2"
|
||||
];
|
||||
|
||||
firewall = {
|
||||
firewall.enable = false;
|
||||
nftables = {
|
||||
enable = true;
|
||||
checkReversePath = false;
|
||||
allowPing = false;
|
||||
trustedInterfaces = [ "waydroid0" ];
|
||||
extraInputRules = ''
|
||||
ip saddr { 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 } accept
|
||||
ip6 saddr { fd00::/8, fe80::/10 } accept
|
||||
'';
|
||||
filterForward = true;
|
||||
extraForwardRules = ''
|
||||
flushRuleset = true;
|
||||
ruleset = ''
|
||||
table inet firewall {
|
||||
set LANv4 {
|
||||
type ipv4_addr
|
||||
flags interval
|
||||
|
||||
elements = { 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 }
|
||||
}
|
||||
set LANv6 {
|
||||
type ipv6_addr
|
||||
flags interval
|
||||
|
||||
elements = { fd00::/8, fe80::/10 }
|
||||
}
|
||||
|
||||
chain output {
|
||||
type filter hook output priority 100; policy accept;
|
||||
}
|
||||
|
||||
chain input {
|
||||
type filter hook input priority 0; policy drop;
|
||||
iif lo accept
|
||||
iifname waydroid0 accept
|
||||
ct state invalid drop
|
||||
ct state established,related accept
|
||||
|
||||
ip saddr @LANv4 accept
|
||||
ip6 saddr @LANv6 accept
|
||||
}
|
||||
|
||||
chain forward {
|
||||
type filter hook forward priority 0; policy drop;
|
||||
|
||||
iifname waydroid0 accept
|
||||
oifname waydroid0 accept
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
nftables.enable = true;
|
||||
};
|
||||
|
||||
sops.secrets.dae-imxyy-nix = {
|
||||
@@ -68,7 +96,6 @@
|
||||
services.dae = {
|
||||
enable = true;
|
||||
configFile = config.sops.secrets.dae-imxyy-nix.path;
|
||||
openFirewall.enable = false;
|
||||
};
|
||||
systemd.services.dae.after = [ "sops-nix.service" ];
|
||||
sops.secrets.mihomo = {
|
||||
|
||||
@@ -78,7 +78,6 @@ in
|
||||
};
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = false;
|
||||
settings = {
|
||||
# Forbid root login through SSH.
|
||||
PermitRootLogin = null;
|
||||
|
||||
+3
-3
@@ -19,8 +19,8 @@ let
|
||||
with lib;
|
||||
with fileset;
|
||||
let
|
||||
excludedFiles = filter pathIsRegularFile exclude;
|
||||
excludedDirs = filter pathIsDirectory exclude;
|
||||
excludedFiles = filter (path: pathIsRegularFile path) exclude;
|
||||
excludedDirs = filter (path: pathIsDirectory path) exclude;
|
||||
isExcluded =
|
||||
path:
|
||||
(elem path excludedFiles)
|
||||
@@ -39,7 +39,7 @@ let
|
||||
) (builtins.readDir path)
|
||||
) (unique (if path == null then paths else [ path ] ++ paths))
|
||||
))
|
||||
++ (if recursive then concatMap toList (unique include) else unique include)
|
||||
++ (if recursive then concatMap (path: toList path) (unique include) else unique include)
|
||||
);
|
||||
in
|
||||
umport
|
||||
|
||||
@@ -16,17 +16,8 @@ in
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
Disable = "HeadSet";
|
||||
MultiProfile = "multiple";
|
||||
|
||||
# Avoid bluetooth headset connection failure
|
||||
Experimental = true;
|
||||
FastConnectable = true;
|
||||
ControllerMode = "dual";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
options btusb enable_autosuspend=n
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.cli.media = {
|
||||
go-musicfox.enable = true;
|
||||
ffmpeg.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
secrets,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.cli.media.go-musicfox;
|
||||
in
|
||||
{
|
||||
options.my.cli.media.go-musicfox = {
|
||||
enable = lib.mkEnableOption "go-musicfox";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my = {
|
||||
hm = {
|
||||
home.packages = [
|
||||
pkgs.go-musicfox
|
||||
];
|
||||
sops.secrets.go-musicfox = {
|
||||
sopsFile = secrets.go-musicfox;
|
||||
format = "binary";
|
||||
path = "${config.my.hm.xdg.configHome}/go-musicfox/config.toml";
|
||||
};
|
||||
};
|
||||
|
||||
desktop.media.mpv.enable = lib.mkForce true;
|
||||
|
||||
persist.homeDirs = [
|
||||
".local/share/go-musicfox/db"
|
||||
];
|
||||
persist.homeFiles = [
|
||||
".local/share/go-musicfox/cookie"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -35,9 +35,6 @@ in
|
||||
pciutils
|
||||
usbutils
|
||||
|
||||
dust
|
||||
dysk
|
||||
|
||||
lsof
|
||||
|
||||
nmap
|
||||
@@ -53,7 +50,6 @@ in
|
||||
my.persist.homeDirs = [
|
||||
".local/share/zoxide"
|
||||
".config/television/cable"
|
||||
".config/dconf"
|
||||
];
|
||||
my.hm = {
|
||||
programs.fish.shellAliases = {
|
||||
@@ -68,12 +64,12 @@ in
|
||||
aria2
|
||||
bat
|
||||
comma
|
||||
fastfetch-unwrapped
|
||||
fastfetch
|
||||
fd
|
||||
fzf
|
||||
jq
|
||||
keep-sorted
|
||||
lsd
|
||||
neofetch
|
||||
ripgrep
|
||||
socat
|
||||
typos
|
||||
|
||||
@@ -12,7 +12,6 @@ in
|
||||
zsh.enable = true;
|
||||
fish.enable = true;
|
||||
starship.enable = true;
|
||||
carapace.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.cli.shell.carapace;
|
||||
in
|
||||
{
|
||||
options.my.cli.shell.carapace = {
|
||||
enable = lib.mkEnableOption "carapace completer";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm = {
|
||||
programs.carapace = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -32,7 +32,7 @@ in
|
||||
shellAliases = {
|
||||
la = "lsd -lah";
|
||||
ls = "lsd";
|
||||
svim = "sudoedit";
|
||||
svim = "doasedit";
|
||||
nf = "fastfetch";
|
||||
};
|
||||
interactiveShellInit = lib.mkBefore ''
|
||||
|
||||
@@ -53,7 +53,7 @@ symbol = " "
|
||||
symbol = " "
|
||||
|
||||
[git_commit]
|
||||
tag_symbol = " "
|
||||
tag_symbol = ' '
|
||||
|
||||
[golang]
|
||||
symbol = " "
|
||||
|
||||
@@ -11,43 +11,17 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
my.cli.shell.starship.format = lib.mkOrder 0 [ "$all" ];
|
||||
}
|
||||
(lib.mkIf cfg.enable {
|
||||
my.hm = {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = lib.recursiveUpdate (with builtins; fromTOML (readFile ./starship-preset.toml)) {
|
||||
add_newline = false;
|
||||
scan_timeout = 1500;
|
||||
format =
|
||||
let
|
||||
dedupDollar =
|
||||
list:
|
||||
let
|
||||
result =
|
||||
builtins.foldl'
|
||||
(
|
||||
acc: elem:
|
||||
if lib.hasPrefix "$" elem then
|
||||
if builtins.elem elem acc.seen then
|
||||
acc
|
||||
else
|
||||
acc
|
||||
// {
|
||||
result = acc.result ++ [ elem ];
|
||||
seen = acc.seen ++ [ elem ];
|
||||
}
|
||||
else
|
||||
acc // { result = acc.result ++ [ elem ]; }
|
||||
)
|
||||
{
|
||||
result = [ ];
|
||||
seen = [ ];
|
||||
}
|
||||
(lib.reverseList list);
|
||||
in
|
||||
lib.reverseList result.result;
|
||||
in
|
||||
"$all" + lib.concatStrings (dedupDollar cfg.format);
|
||||
nix_shell.disabled = true;
|
||||
format = lib.concatStringsSep "" cfg.format;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ in
|
||||
};
|
||||
shellAliases = {
|
||||
ls = "lsd";
|
||||
svim = "sudoedit";
|
||||
svim = "doasedit";
|
||||
nf = "fastfetch";
|
||||
};
|
||||
};
|
||||
|
||||
+14
-16
@@ -22,22 +22,20 @@ in
|
||||
forward_env = [ "PATH" ];
|
||||
};
|
||||
};
|
||||
programs.starship = {
|
||||
settings = {
|
||||
custom.shpool = {
|
||||
description = "Display current shpool session name";
|
||||
when = ''test -n "$SHPOOL_SESSION_NAME"'';
|
||||
command = "echo $SHPOOL_SESSION_NAME";
|
||||
symbol = " ";
|
||||
style = "fg:#dea584";
|
||||
format = "[$symbol \\[$output\\] ]($style)";
|
||||
# https://github.com/starship/starship/discussions/7260
|
||||
# programs.starship = {
|
||||
# settings = {
|
||||
# custom.shpool = {
|
||||
# description = "Display current shpool session name";
|
||||
# when = ''test -n "$SHPOOL_SESSION_NAME"'';
|
||||
# command = "echo $SHPOOL_SESSION_NAME";
|
||||
# symbol = " ";
|
||||
# style = "fg:#dea584";
|
||||
# format = "[$symbol $output]($style)";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
my.cli.shell.starship.format = [
|
||||
"\${custom.shpool}"
|
||||
"$character"
|
||||
];
|
||||
# my.cli.shell.starship.format = [ "$starship$character" ];
|
||||
};
|
||||
}
|
||||
|
||||
+14
-16
@@ -34,22 +34,20 @@ in
|
||||
})
|
||||
];
|
||||
};
|
||||
programs.starship = {
|
||||
settings = {
|
||||
custom.tmux = {
|
||||
description = "Display current tmux session name";
|
||||
when = ''test -n "$TMUX"'';
|
||||
command = "tmux display-message -p '#S'";
|
||||
symbol = " ";
|
||||
style = "bold green";
|
||||
format = "[$symbol \\[$output\\] ]($style)";
|
||||
# https://github.com/starship/starship/discussions/7260
|
||||
# programs.starship = {
|
||||
# settings = {
|
||||
# custom.tmux = {
|
||||
# description = "Display current tmux session name";
|
||||
# when = ''test -n "$TMUX"'';
|
||||
# command = "tmux display-message -p '#S'";
|
||||
# symbol = " ";
|
||||
# style = "bold green";
|
||||
# format = "[$symbol $output]($style)";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
my.cli.shell.starship.format = [
|
||||
"\${custom.tmux}"
|
||||
"$character"
|
||||
];
|
||||
# my.cli.shell.starship.format = [ "$tmux$character" ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,9 +17,6 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.persist.homeDirs = [
|
||||
".config/jj"
|
||||
];
|
||||
my.hm = {
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.coding.agents;
|
||||
in
|
||||
{
|
||||
options.my.coding.agents = {
|
||||
enable = lib.mkEnableOption "LLM coding agents";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm = {
|
||||
home.packages =
|
||||
(with pkgs.llm-agents; [
|
||||
# codex
|
||||
claude-code
|
||||
# opencode
|
||||
# pi
|
||||
# omp
|
||||
])
|
||||
++ (with pkgs; [
|
||||
codex
|
||||
]);
|
||||
};
|
||||
my.persist = {
|
||||
homeDirs = [
|
||||
".agents"
|
||||
|
||||
".claude"
|
||||
|
||||
# ".config/opencode"
|
||||
# ".local/share/opencode"
|
||||
|
||||
".codex"
|
||||
|
||||
".pi"
|
||||
".omp"
|
||||
|
||||
".config/ZCode"
|
||||
".zcode"
|
||||
];
|
||||
homeFiles = [
|
||||
".claude.json"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -11,7 +11,6 @@ in
|
||||
my.coding = {
|
||||
editor.all.enable = true;
|
||||
langs.all.enable = true;
|
||||
agents.enable = true;
|
||||
misc.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -10,8 +10,8 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.coding.editor = {
|
||||
neovim.enable = true;
|
||||
vscode.enable = false;
|
||||
zed.enable = false;
|
||||
vscode.enable = true;
|
||||
zed.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
}:
|
||||
let
|
||||
cfg = config.my.coding.editor.neovim;
|
||||
desktop = [ "nvim.desktop" ];
|
||||
in
|
||||
{
|
||||
options.my.coding.editor.neovim = {
|
||||
@@ -15,8 +14,6 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# workaround
|
||||
environment.sessionVariables.EDITOR = "nvim";
|
||||
my.hm = {
|
||||
xdg.configFile."nvim".source = impure.mkImpureLink ./nvim;
|
||||
programs.neovim = {
|
||||
@@ -25,45 +22,17 @@ in
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
withPython3 = false;
|
||||
withRuby = false;
|
||||
sideloadInitLua = true;
|
||||
extraPackages = with pkgs; [
|
||||
# treesitter
|
||||
tree-sitter
|
||||
gnutar
|
||||
curl
|
||||
gcc
|
||||
gcc # treesitter
|
||||
|
||||
ripgrep # telescope
|
||||
|
||||
# language servers
|
||||
vscode-json-languageserver
|
||||
vscode-langservers-extracted
|
||||
typos-lsp
|
||||
|
||||
# render-markdown.nvim
|
||||
python3Packages.pylatexenc
|
||||
];
|
||||
};
|
||||
};
|
||||
my.persist.homeDirs = [
|
||||
".local/share/nvim"
|
||||
];
|
||||
my.xdg.defaultApplications = {
|
||||
"text/*" = desktop;
|
||||
"application/json" = desktop;
|
||||
"text/xml" = desktop;
|
||||
"application/xml" = desktop;
|
||||
"application/xhtml+xml" = desktop;
|
||||
"application/xhtml_xml" = desktop;
|
||||
"application/rdf+xml" = desktop;
|
||||
"application/rss+xml" = desktop;
|
||||
"application/x-extension-htm" = desktop;
|
||||
"application/x-extension-html" = desktop;
|
||||
"application/x-extension-shtml" = desktop;
|
||||
"application/x-extension-xht" = desktop;
|
||||
"application/x-extension-xhtml" = desktop;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,45 +1,43 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
|
||||
"blink.cmp": { "branch": "main", "commit": "3db7326f54b73df4789e0fd6274bedda33975fea" },
|
||||
"blink.lib": { "branch": "main", "commit": "b127d48bf8e9ac9cf41f6e0fbead317503f76558" },
|
||||
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
||||
"blink.cmp": { "branch": "main", "commit": "f9e855c4d96e1264f7c818844f5a0166ad48c212" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "25050e4ed39e628282831d4cbecb1850454ce915" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "1ce96a464fdbc24208e24c117e2021794259005d" },
|
||||
"glance.nvim": { "branch": "master", "commit": "bf86d8b79dce808e65fdb6e9269d0b4ed6d2eefc" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
||||
"hunk.nvim": { "branch": "master", "commit": "c8a8e7b6973576f63e5bf39aa8338d7f37f4dc53" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
|
||||
"inlay-hints.nvim": { "branch": "master", "commit": "297a65ab9543eb0850c1a55df4bb89e22cfec504" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"inlay-hints.nvim": { "branch": "master", "commit": "11be32be3761c6263df2311afb6baa0de0863967" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
|
||||
"leap.nvim": { "branch": "main", "commit": "d3641f9aa86e7460b14d9f4479e7454f88cc6b2d" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
||||
"leap.nvim": { "branch": "main", "commit": "d7316deae68dc93d6957020cdda6d7bb399218fb" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
||||
"mini.nvim": { "branch": "main", "commit": "b2ac6522f7a54b475d9fad711b938eefc6d3d0a6" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "83e7a2982fd12b9c3d35bc39dd5877cd91a02a61" },
|
||||
"mini.nvim": { "branch": "main", "commit": "8c40d95931cbe6138391af9180e59439ed2e69df" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
|
||||
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "229b79051b380377664edc4cbd534930154921a1" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "66fd02ad1c7ea31616d3ca678fa04e6d0b360824" },
|
||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||
"nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" },
|
||||
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" },
|
||||
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
||||
"outline.nvim": { "branch": "main", "commit": "2a132953b944561d45b52e4541ebfff71934a742" },
|
||||
"pest.vim": { "branch": "master", "commit": "60cae7ea1beb644ed40081a3ec213ea9061aba09" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "a798325b7f36acc62741d1029930a7b96d4dd4bf" },
|
||||
"registers": { "branch": "main", "commit": "c217f8f369e0886776cda6c94eab839b30a8940d" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "5adf0895310c1904e5abfaad40a2baad7fe44a07" },
|
||||
"ripgrep": { "branch": "master", "commit": "82313cf95849bfe425109ad9506a52154879b1b1" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "7d324792b7943e4aa16ad007212e6acc6f9fe335" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "037d89e60fb01a6c11a48a19540253b8c72a3c32" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
|
||||
"outline.nvim": { "branch": "main", "commit": "ead1820d49c8e79ce89cab1c2c318981b695c9d2" },
|
||||
"pest.vim": { "branch": "master", "commit": "7cfcb43f824e74d13dfe631359fff2ec23836a77" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "d6b802552cbe7d643a3b6b31f419c248d1f1e220" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "48b4175dbca8439d30c1f52231cbe5a712c8f9d9" },
|
||||
"ripgrep": { "branch": "master", "commit": "0a88cccd5188074de96f54a4b6b44a63971ac157" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" },
|
||||
"tree-sitter-nu": { "branch": "main", "commit": "bb3f533e5792260291945e1f329e1f0a779def6e" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"vim-floaterm": { "branch": "master", "commit": "bb4ba7952e906408e1f83b215f55ffe57efcade6" },
|
||||
"vim-floaterm": { "branch": "master", "commit": "a11b930f55324e9b05e2ef16511fe713f1b456a7" },
|
||||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ keymap.set("i", "<pageup>", string.rep("<up>", 9), opt)
|
||||
keymap.set("i", "<pagedown>", string.rep("<down>", 9), opt)
|
||||
|
||||
keymap.set("n", "<leader>ww", ":w<CR>", opt)
|
||||
keymap.set("n", "<leader>so", ":so<CR>", opt)
|
||||
keymap.set("n", "<leader>qq", ":q<CR>", opt)
|
||||
keymap.set("n", "<leader>qa", ":qa<CR>", opt)
|
||||
keymap.set("n", "<leader>c", function()
|
||||
|
||||
@@ -6,7 +6,6 @@ opt.shiftwidth = 4
|
||||
opt.softtabstop = 4
|
||||
opt.expandtab = true
|
||||
opt.autoindent = true
|
||||
opt.smartindent = true
|
||||
|
||||
-- Linenumber setting
|
||||
opt.number = true
|
||||
@@ -23,7 +22,6 @@ opt.smartcase = true
|
||||
opt.termguicolors = true
|
||||
opt.signcolumn = "yes"
|
||||
opt.colorcolumn = "110"
|
||||
opt.textwidth = 110
|
||||
opt.scrolloff = 8
|
||||
opt.sidescrolloff = 8
|
||||
|
||||
@@ -34,8 +32,6 @@ opt.completeopt = ""
|
||||
|
||||
opt.exrc = true
|
||||
|
||||
opt.conceallevel = 2
|
||||
|
||||
opt.autoread = true
|
||||
vim.g.autoread = true
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
-- rainbow-delimiters integration
|
||||
local hooks = require("ibl.hooks")
|
||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
||||
|
||||
--- @type ibl.config
|
||||
M = {
|
||||
enabled = true,
|
||||
@@ -11,7 +7,6 @@ M = {
|
||||
scope = {
|
||||
enabled = true,
|
||||
show_start = false,
|
||||
highlight = vim.g.rainbow_delimiters.highlight,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -75,15 +75,11 @@ local servers = {
|
||||
biome = {},
|
||||
clangd = {},
|
||||
cssls = {},
|
||||
eslint = {},
|
||||
gopls = {},
|
||||
html = {},
|
||||
java_language_server = {},
|
||||
jsonls = {},
|
||||
pyrefly = {},
|
||||
ruff = {},
|
||||
-- taplo = {},
|
||||
tombi = {},
|
||||
pyright = {},
|
||||
ts_ls = {},
|
||||
typos_lsp = {},
|
||||
-- keep-sorted end
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
M = {
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
handler_opts = {
|
||||
border = "rounded",
|
||||
},
|
||||
hint_prefix = "^ ",
|
||||
toggle_key = "<C-k>",
|
||||
}
|
||||
|
||||
vim.keymap.set(
|
||||
{ "n" },
|
||||
"<leader>k",
|
||||
require("lsp_signature").toggle_float_win,
|
||||
{ silent = true, noremap = true, desc = "toggle signature" }
|
||||
)
|
||||
|
||||
vim.keymap.set({ "n" }, "K", vim.lsp.buf.signature_help, { silent = true, noremap = true, desc = "toggle signature" })
|
||||
|
||||
return M
|
||||
@@ -1,30 +0,0 @@
|
||||
M = {
|
||||
options = {
|
||||
theme = "tokyonight",
|
||||
},
|
||||
sections = {
|
||||
lualine_y = {
|
||||
"encoding",
|
||||
"fileformat",
|
||||
"filetype",
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
require("noice").api.status.message.get_hl,
|
||||
cond = require("noice").api.status.message.has,
|
||||
},
|
||||
{
|
||||
require("noice").api.status.command.get,
|
||||
cond = require("noice").api.status.command.has,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{
|
||||
require("noice").api.status.search.get,
|
||||
cond = require("noice").api.status.search.has,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
@@ -14,52 +14,61 @@ package.path = package.path .. ";" .. vim.fn.stdpath("config") .. "/lua/"
|
||||
local plugins = {
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme("tokyonight-storm")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { { "nvim-tree/nvim-web-devicons" } },
|
||||
config = function()
|
||||
require("lualine").setup(require("plugins.lualine"))
|
||||
end,
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.nvim",
|
||||
'echasnovski/mini.nvim',
|
||||
config = function()
|
||||
-- Simple and easy statusline.
|
||||
-- You could remove this setup call if you don't like it,
|
||||
-- and try some other statusline plugin
|
||||
local statusline = require 'mini.statusline'
|
||||
-- set use_icons to true if you have a Nerd Font
|
||||
statusline.setup { use_icons = vim.g.have_nerd_font }
|
||||
|
||||
-- You can configure sections in the statusline by overriding their
|
||||
-- default behavior. For example, here we set the section for
|
||||
-- cursor location to LINE:COLUMN
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
statusline.section_location = function()
|
||||
return '%2l:%-2v'
|
||||
end
|
||||
|
||||
-- Better Around/Inside textobjects
|
||||
--
|
||||
-- Examples:
|
||||
-- - va) - [V]isually select [A]round [)]paren
|
||||
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
|
||||
-- - ci' - [C]hange [I]nside [']quote
|
||||
require("mini.ai").setup({ n_lines = 500 })
|
||||
require('mini.ai').setup { n_lines = 500 }
|
||||
|
||||
-- Add/delete/replace surroundings (brackets, quotes, etc.)
|
||||
--
|
||||
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
|
||||
-- - sd' - [S]urround [D]elete [']quotes
|
||||
-- - sr)' - [S]urround [R]eplace [)] [']
|
||||
require("mini.surround").setup()
|
||||
require('mini.surround').setup()
|
||||
|
||||
-- ... and there is more!
|
||||
-- Check out: https://github.com/echasnovski/mini.nvim
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
version = "*",
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
cmd = "Neotree",
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ "\\", ":Neotree reveal toggle<CR>", desc = "Toggle NeoTree", silent = true },
|
||||
{ "<leader>e", ":Neotree reveal toggle<CR>", desc = "Toggle NeoTree", silent = true },
|
||||
{ '\\', ':Neotree reveal toggle<CR>', desc = 'Toggle NeoTree', silent = true },
|
||||
{ '<leader>e', ':Neotree reveal toggle<CR>', desc = 'Toggle NeoTree', silent = true },
|
||||
},
|
||||
--- @type neotree.Config
|
||||
opts = {
|
||||
@@ -71,7 +80,7 @@ local plugins = {
|
||||
window = {
|
||||
width = 30,
|
||||
mappings = {
|
||||
["\\"] = "close_window",
|
||||
['\\'] = 'close_window',
|
||||
["<leader>e"] = "close_window",
|
||||
["<c-]>"] = "set_root",
|
||||
},
|
||||
@@ -81,38 +90,39 @@ local plugins = {
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
{
|
||||
branch = "main",
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
"nushell/tree-sitter-nu",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-treesitter").setup(require("plugins.treesitter"))
|
||||
require("nvim-treesitter.configs").setup(require("plugins.treesitter"))
|
||||
end,
|
||||
build = ":TSUpdate",
|
||||
},
|
||||
{
|
||||
url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.rainbow-delimiters")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
dependencies = { "https://gitlab.com/HiPhish/rainbow-delimiters.nvim" },
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("ibl").setup(require("plugins.indent-blankline"))
|
||||
end,
|
||||
},
|
||||
{
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
event = "VeryLazy",
|
||||
opt = {},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = { "saghen/blink.cmp" },
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.lsp.lspconfig")
|
||||
require("plugins.lsp.others")
|
||||
@@ -174,11 +184,13 @@ local plugins = {
|
||||
},
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
event = "VeryLazy",
|
||||
build = "cargo build --release",
|
||||
dependencies = {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
event = "InsertEnter",
|
||||
dependencies = { { "rafamadriz/friendly-snippets" } },
|
||||
dependencies = { { "rafamadriz/friendly-snippets", lazy = true } },
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
require("luasnip").setup(require("plugins.cmp.luasnip"))
|
||||
@@ -193,7 +205,6 @@ local plugins = {
|
||||
},
|
||||
},
|
||||
},
|
||||
"saghen/blink.lib",
|
||||
},
|
||||
config = function()
|
||||
require("blink.cmp").setup(require("plugins.cmp.cmp"))
|
||||
@@ -201,6 +212,7 @@ local plugins = {
|
||||
},
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
@@ -216,6 +228,7 @@ local plugins = {
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("gitsigns").setup(require("plugins.gitsigns"))
|
||||
end,
|
||||
@@ -254,7 +267,6 @@ local plugins = {
|
||||
dependencies = { "tpope/vim-repeat" },
|
||||
config = function()
|
||||
vim.keymap.set({ "n", "x", "o" }, "s", "<Plug>(leap)")
|
||||
vim.keymap.set({ "n", "x", "o" }, "<leader>s", "<Plug>(leap)")
|
||||
vim.keymap.set("n", "S", "<Plug>(leap-from-window)")
|
||||
-- Exclude whitespace and the middle of alphabetic words from preview:
|
||||
-- foobar[baaz] = quux
|
||||
@@ -267,31 +279,20 @@ local plugins = {
|
||||
},
|
||||
{
|
||||
"alexghergh/nvim-tmux-navigation",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-tmux-navigation").setup(require("plugins.tmuxnav"))
|
||||
end,
|
||||
},
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
|
||||
event = "BufEnter *.md",
|
||||
--- @type render.md.UserConfig
|
||||
opts = {
|
||||
completions = {
|
||||
blink = {
|
||||
enabled = true,
|
||||
},
|
||||
lsp = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"rcarriga/nvim-notify",
|
||||
@@ -306,14 +307,31 @@ local plugins = {
|
||||
},
|
||||
{
|
||||
"voldikss/vim-floaterm",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.floaterm")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"ojroques/nvim-osc52",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("osc52").setup({
|
||||
tmux_passthrough = true,
|
||||
})
|
||||
local function copy()
|
||||
if vim.v.event.operator == "y" and vim.v.event.regname == "+" then
|
||||
require("osc52").copy_register("+")
|
||||
end
|
||||
end
|
||||
vim.api.nvim_create_autocmd("TextYankPost", { callback = copy })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pest-parser/pest.vim",
|
||||
ft = "pest",
|
||||
@@ -322,56 +340,9 @@ local plugins = {
|
||||
|
||||
{
|
||||
"nmac427/guess-indent.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
{
|
||||
"https://codeberg.org/fosk/registers.nvim",
|
||||
cmd = "Registers",
|
||||
config = true,
|
||||
keys = {
|
||||
{ '"', mode = { "n", "v" } },
|
||||
{ "<C-R>", mode = "i" },
|
||||
},
|
||||
name = "registers",
|
||||
},
|
||||
|
||||
{
|
||||
"epwalsh/obsidian.nvim",
|
||||
version = "*",
|
||||
enabled = false,
|
||||
lazy = true,
|
||||
ft = "markdown",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
workspaces = {
|
||||
{
|
||||
name = "dynamic",
|
||||
path = function()
|
||||
return assert(vim.fs.dirname(vim.api.nvim_buf_get_name(0)))
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"julienvincent/hunk.nvim",
|
||||
cmd = { "DiffEditor" },
|
||||
dependencies = { { "nvim-tree/nvim-web-devicons" } },
|
||||
opts = {
|
||||
keys = {
|
||||
global = {
|
||||
quit = { "<leader>q" },
|
||||
},
|
||||
diff = {
|
||||
prev_hunk = { "<S-Tab>" },
|
||||
next_hunk = { "<Tab>" },
|
||||
toggle_focus = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("lazy").setup(plugins, {})
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
--- @type TSConfig
|
||||
M = {
|
||||
install_dir = vim.fn.stdpath("data") .. "/site",
|
||||
auto_install = true,
|
||||
parser_install_dir = "$HOME/.local/share/nvim/lazy/nvim-treesitter",
|
||||
sync_install = true,
|
||||
modules = {},
|
||||
ignore_install = {},
|
||||
ensure_installed = {},
|
||||
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
-- Enable treesitter highlighting and disable regex syntax
|
||||
pcall(vim.treesitter.start)
|
||||
-- Enable treesitter-based indentation
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*/hypr/.*%.conf"] = "hyprlang",
|
||||
[".*%.hl"] = "hyprlang",
|
||||
},
|
||||
})
|
||||
|
||||
return M
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -12,13 +13,15 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.programs.vscode.enable = true;
|
||||
my.hm = {
|
||||
programs.vscodium.enable = true;
|
||||
programs.vscode = {
|
||||
package = pkgs.vscodium;
|
||||
};
|
||||
};
|
||||
my.persist.homeDirs = [
|
||||
".config/VSCodium"
|
||||
".vscode-oss"
|
||||
".vscode-oss-shared"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ in
|
||||
python.enable = true;
|
||||
rust.enable = true;
|
||||
lua.enable = true;
|
||||
java.enable = false;
|
||||
java.enable = true;
|
||||
qml.enable = true;
|
||||
typst.enable = true;
|
||||
toml.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ in
|
||||
(lib.hiPrio clang)
|
||||
clang-tools
|
||||
cmake
|
||||
ninja
|
||||
meson
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ in
|
||||
my.hm.home.packages = with pkgs; [
|
||||
go
|
||||
gotools
|
||||
(lib.hiPrio gopls)
|
||||
gopls
|
||||
];
|
||||
my.persist.homeDirs = [
|
||||
"go"
|
||||
|
||||
@@ -19,7 +19,8 @@ in
|
||||
pnpm
|
||||
typescript
|
||||
|
||||
typescript-language-server
|
||||
nodePackages.typescript-language-server
|
||||
vue-language-server
|
||||
|
||||
biome
|
||||
];
|
||||
|
||||
@@ -14,15 +14,9 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.home.packages = with pkgs; [
|
||||
(python3.withPackages (
|
||||
ps: with ps; [
|
||||
tomli
|
||||
tomli-w
|
||||
]
|
||||
))
|
||||
python3
|
||||
uv
|
||||
pyrefly
|
||||
ruff
|
||||
pyright
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.coding.langs.qml;
|
||||
in
|
||||
{
|
||||
options.my.coding.langs.qml = {
|
||||
enable = lib.mkEnableOption "QML";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.home.packages = with pkgs; [
|
||||
kdePackages.qtdeclarative
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -23,7 +23,7 @@ in
|
||||
"rustfmt"
|
||||
"rust-analyzer"
|
||||
])
|
||||
stdenv.cc # linker
|
||||
evcxr # rust repl
|
||||
|
||||
pest-ide-tools
|
||||
];
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.coding.langs.toml;
|
||||
in
|
||||
{
|
||||
options.my.coding.langs.toml = {
|
||||
enable = lib.mkEnableOption "TOML";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.home.packages = with pkgs; [
|
||||
tombi
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -19,52 +19,17 @@ in
|
||||
gnumake
|
||||
github-cli # gh
|
||||
];
|
||||
programs.starship.settings = {
|
||||
nix_shell.disabled = true;
|
||||
# direnv =
|
||||
# let
|
||||
# esc = builtins.fromJSON ''"\u001b"'';
|
||||
# in
|
||||
# {
|
||||
# disabled = false;
|
||||
# format = "$loaded$allowed ";
|
||||
# loaded_msg = "${esc}[1;92m ${esc}[0m"; # green
|
||||
# unloaded_msg = "";
|
||||
# allowed_msg = "";
|
||||
# not_allowed_msg = "${esc}[1;93m ${esc}[0m"; # yellow
|
||||
# denied_msg = "${esc}[1;91m ${esc}[0m"; # red
|
||||
# };
|
||||
};
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
config = {
|
||||
global = {
|
||||
warn_timeout = 0;
|
||||
hide_env_diff = false;
|
||||
};
|
||||
};
|
||||
stdlib = lib.mkAfter ''
|
||||
if [[ -f .envrc.local && -z "$DIRENV_LOCAL_LOADED" ]]; then
|
||||
export DIRENV_LOCAL_LOADED=1
|
||||
log_status ".envrc.local detected, loading..."
|
||||
|
||||
skip_default_envrc() {
|
||||
log_status "skip_default_envrc triggered, skipping .envrc"
|
||||
exit 0
|
||||
}
|
||||
|
||||
source_env .envrc.local
|
||||
|
||||
use() {
|
||||
log_status "intercepted 'use $@' in .envrc"
|
||||
}
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
my.persist.homeDirs = [
|
||||
".config/gh"
|
||||
".local/share/direnv"
|
||||
];
|
||||
};
|
||||
|
||||
+11
-64
@@ -30,52 +30,25 @@ in
|
||||
environment.systemPackages = with pkgs; [
|
||||
nix-output-monitor
|
||||
nh
|
||||
nix-tree-rs
|
||||
fast-nix-gc
|
||||
];
|
||||
|
||||
environment.etc = (
|
||||
lib.mapAttrs' (name: value: {
|
||||
environment.etc = lib.mapAttrs' (name: value: {
|
||||
name = "nix/path/${name}";
|
||||
value.source = value.flake;
|
||||
}) config.nix.registry
|
||||
);
|
||||
|
||||
services.selector4nix = {
|
||||
enable = true;
|
||||
configureSubstituter = "keep";
|
||||
settings = {
|
||||
server = {
|
||||
ip = "0.0.0.0";
|
||||
port = 5496;
|
||||
};
|
||||
substituters = map (subst: if builtins.isString subst then { url = subst; } else subst) [
|
||||
"https://mirror.sjtu.edu.cn/nix-channels/store"
|
||||
"https://mirrors.sjtug.sjtu.edu.cn/nix-channels/store"
|
||||
"https://mirrors.ustc.edu.cn/nix-channels/store"
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://selector4nix.cachix.org/"
|
||||
"https://cache.numtide.com"
|
||||
"https://cache.nixos.org"
|
||||
];
|
||||
};
|
||||
};
|
||||
}) config.nix.registry;
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
"pipe-operators"
|
||||
];
|
||||
substituters = lib.mkForce [
|
||||
"http://127.0.0.1:${toString (config.services.selector4nix.settings.server.port or 5496)}"
|
||||
"https://cache.nixos.org"
|
||||
experimental-features = "nix-command flakes pipe-operators";
|
||||
substituters = [
|
||||
"https://mirrors.sjtug.sjtu.edu.cn/nix-channels/store"
|
||||
"https://mirror.sjtu.edu.cn/nix-channels/store"
|
||||
"https://mirrors.ustc.edu.cn/nix-channels/store"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cache.garnix.io"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"selector4nix.cachix.org-1:wovVlT07In5JCVz2tFgxPQTLpnN8hZT6P/RwfFcz3KE="
|
||||
"niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="
|
||||
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
||||
];
|
||||
download-buffer-size = 536870912; # 512 MiB
|
||||
warn-dirty = false;
|
||||
@@ -119,33 +92,7 @@ in
|
||||
services.angrr = {
|
||||
enable = true;
|
||||
settings = {
|
||||
temporary-root-policies = {
|
||||
direnv = {
|
||||
path-regex = "/\\.direnv/";
|
||||
period = "14d";
|
||||
};
|
||||
result = {
|
||||
path-regex = "/result[^/]*$";
|
||||
period = "3d";
|
||||
};
|
||||
};
|
||||
profile-policies = {
|
||||
system = {
|
||||
profile-paths = [ "/nix/var/nix/profiles/system" ];
|
||||
keep-since = "14d";
|
||||
keep-latest-n = 5;
|
||||
keep-booted-system = true;
|
||||
keep-current-system = true;
|
||||
};
|
||||
user = {
|
||||
profile-paths = [
|
||||
"~/.local/state/nix/profiles/profile"
|
||||
"/nix/var/nix/profiles/per-user/root/profile"
|
||||
];
|
||||
keep-since = "14d";
|
||||
keep-latest-n = 5;
|
||||
};
|
||||
};
|
||||
period = "1month";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -10,35 +10,15 @@ in
|
||||
{
|
||||
options.my.persist = {
|
||||
enable = lib.mkEnableOption "persist";
|
||||
btrfs = lib.mkOption {
|
||||
type = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
device = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
zstdCompress = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
persistSubvol = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
rootSubvol = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "root";
|
||||
};
|
||||
mountPoint = lib.mkOption {
|
||||
location = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/nix/persist";
|
||||
example = lib.literalExpression ''
|
||||
"/persistent"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
description = lib.mdDoc ''
|
||||
Persistent location
|
||||
'';
|
||||
};
|
||||
homeDirs = lib.mkOption {
|
||||
default = [ ];
|
||||
@@ -89,65 +69,8 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
fileSystems.${cfg.btrfs.mountPoint} = {
|
||||
device = cfg.btrfs.device;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=${cfg.btrfs.persistSubvol}"
|
||||
]
|
||||
++ lib.optionals cfg.btrfs.zstdCompress [
|
||||
"compress=zstd"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
fileSystems."/" = {
|
||||
device = cfg.btrfs.device;
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=${cfg.btrfs.rootSubvol}"
|
||||
]
|
||||
++ lib.optionals cfg.btrfs.zstdCompress [
|
||||
"compress=zstd"
|
||||
];
|
||||
};
|
||||
|
||||
boot.initrd.systemd.services.wipe-root = {
|
||||
description = "Rollback BTRFS rootfs";
|
||||
wantedBy = [ "initrd.target" ];
|
||||
before = [ "sysroot.mount" ];
|
||||
after = [ "initrd-root-device.target" ];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
script = ''
|
||||
mkdir -p /btrfs_tmp
|
||||
mount ${cfg.btrfs.device} /btrfs_tmp
|
||||
mkdir -p /btrfs_tmp/old_roots
|
||||
|
||||
if [ -e /btrfs_tmp/root ]; then
|
||||
timestamp=$(date -d "@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%d_%H:%M:%S" 2>/dev/null || date "+%Y-%m-%d_%H:%M:%S")
|
||||
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
||||
fi
|
||||
|
||||
delete_subvolume_recursively() {
|
||||
IFS=$(printf '\n')
|
||||
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||
delete_subvolume_recursively "/btrfs_tmp/$i"
|
||||
done
|
||||
btrfs subvolume delete "$1"
|
||||
}
|
||||
|
||||
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +14); do
|
||||
delete_subvolume_recursively "$i"
|
||||
done
|
||||
|
||||
btrfs subvolume create /btrfs_tmp/${cfg.btrfs.rootSubvol}
|
||||
umount /btrfs_tmp
|
||||
'';
|
||||
};
|
||||
|
||||
programs.fuse.userAllowOther = true;
|
||||
environment.persistence.${cfg.btrfs.mountPoint} = {
|
||||
environment.persistence.${cfg.location} = {
|
||||
hideMounts = true;
|
||||
directories = cfg.nixosDirs;
|
||||
files = cfg.nixosFiles;
|
||||
|
||||
+55
-9
@@ -2,7 +2,6 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
hostname,
|
||||
username,
|
||||
userdesc,
|
||||
secrets,
|
||||
@@ -28,12 +27,10 @@ in
|
||||
mutableUsers = false;
|
||||
users.${username} = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
description = userdesc;
|
||||
extraGroups = [
|
||||
username
|
||||
"wheel"
|
||||
"input"
|
||||
];
|
||||
hashedPasswordFile = lib.mkDefault config.sops.secrets.imxyy-nix-hashed-password.path;
|
||||
};
|
||||
@@ -41,18 +38,67 @@ in
|
||||
};
|
||||
users.users.root.hashedPasswordFile = lib.mkDefault config.sops.secrets.imxyy-nix-hashed-password.path;
|
||||
|
||||
security.sudo = {
|
||||
security.sudo.enable = false;
|
||||
security.doas = {
|
||||
enable = true;
|
||||
extraRules = [
|
||||
{
|
||||
users = [ "imxyy" ];
|
||||
commands = lib.singleton {
|
||||
command = "ALL";
|
||||
options = lib.optionals (hostname == "imxyy-nix") [ "NOPASSWD" ];
|
||||
};
|
||||
users = [ username ];
|
||||
noPass = true;
|
||||
keepEnv = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
environment.shellAliases = {
|
||||
sudoedit = "doasedit";
|
||||
};
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "sudo" ''exec doas "$@"'')
|
||||
(pkgs.writeShellScriptBin "doasedit" ''
|
||||
if [ -n "''${2}" ]; then
|
||||
printf 'Expected only one argument\n'
|
||||
exit 1
|
||||
elif [ -z "''${1}" ]; then
|
||||
printf 'No file path provided\n'
|
||||
exit 1
|
||||
elif [ "$(id -u)" -eq 0 ]; then
|
||||
printf 'Cannot be run as root\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -eu
|
||||
|
||||
tempdir="$(mktemp -d)"
|
||||
|
||||
trap 'rm -rf $tempdir' EXIT
|
||||
srcfile="$(doas realpath "$1")"
|
||||
|
||||
if doas [ -f "$srcfile" ]; then
|
||||
doas cp -a "$srcfile" "$tempdir"/file
|
||||
doas cp -a "$tempdir"/file "$tempdir"/edit
|
||||
|
||||
# make sure that the file is editable by user
|
||||
doas chown "$USER":"$USER" "$tempdir"/edit
|
||||
chmod 600 "$tempdir"/edit
|
||||
else
|
||||
# create file with "regular" system permissions (root:root 644)
|
||||
touch "$tempdir"/file
|
||||
doas chown root:root "$tempdir"/file
|
||||
fi
|
||||
|
||||
$EDITOR "$tempdir"/edit
|
||||
|
||||
doas tee "$tempdir"/file 1>/dev/null < "$tempdir"/edit
|
||||
|
||||
if doas cmp -s "$tempdir/file" "$srcfile"; then
|
||||
printf 'Skipping write; no changes.\n'
|
||||
exit 0
|
||||
else
|
||||
doas mv -f "$tempdir"/file "$srcfile"
|
||||
exit 0
|
||||
fi
|
||||
'')
|
||||
];
|
||||
|
||||
nix.settings.trusted-users = [
|
||||
"root"
|
||||
|
||||
+8
-10
@@ -2,6 +2,7 @@
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -37,10 +38,7 @@ in
|
||||
dataHome = "${homedir}/.local/share";
|
||||
stateHome = "${homedir}/.local/state";
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
setSessionVariables = true;
|
||||
};
|
||||
userDirs.enable = true;
|
||||
|
||||
configFile."mimeapps.list".force = true;
|
||||
|
||||
@@ -50,12 +48,12 @@ in
|
||||
};
|
||||
};
|
||||
gtk.gtk3.bookmarks = [
|
||||
"file://${homedir}/Documents Documents"
|
||||
"file://${homedir}/Downloads Downloads"
|
||||
"file://${homedir}/Pictures Pictures"
|
||||
"file://${homedir}/Videos Videos"
|
||||
"file://${homedir}/Music Music"
|
||||
"file://${homedir}/workspace Workspace"
|
||||
"file://${homedir}/Documents 文档"
|
||||
"file://${homedir}/Downloads 下载"
|
||||
"file://${homedir}/Pictures 图片"
|
||||
"file://${homedir}/Videos 视频"
|
||||
"file://${homedir}/Music 音乐"
|
||||
"file://${homedir}/workspace 工作空间"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -17,7 +17,6 @@ in
|
||||
wm.all.enable = true;
|
||||
style.enable = true;
|
||||
wine.enable = true;
|
||||
obsidian.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.desktop.browser = {
|
||||
firefox.enable = false;
|
||||
chromium.enable = false;
|
||||
firefox.enable = true;
|
||||
chromium.enable = true;
|
||||
zen.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,28 +1,13 @@
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.my.desktop.browser.default;
|
||||
desktop = [ cfg.desktop ];
|
||||
in
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.my.desktop.browser.default = {
|
||||
command = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "zen-beta";
|
||||
default = "chromium";
|
||||
};
|
||||
desktop = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "zen-beta.desktop";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
my.xdg.defaultApplications = {
|
||||
"text/html" = desktop;
|
||||
"x-scheme-handler/about" = desktop;
|
||||
"x-scheme-handler/ftp" = desktop;
|
||||
"x-scheme-handler/http" = desktop;
|
||||
"x-scheme-handler/https" = desktop;
|
||||
"x-scheme-handler/unknown" = desktop;
|
||||
default = "chromium-browser.desktop";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,12 +8,9 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.programs.firefox = {
|
||||
enable = true;
|
||||
configPath = "${config.my.hm.xdg.configHome}/mozilla/firefox";
|
||||
};
|
||||
my.hm.programs.firefox.enable = true;
|
||||
my.persist.homeDirs = [
|
||||
".config/mozilla"
|
||||
".mozilla"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ in
|
||||
};
|
||||
};
|
||||
my.persist.homeDirs = [
|
||||
".config/zen"
|
||||
".zen"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,13 +14,16 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.home.packages = [
|
||||
pkgs.hmcl
|
||||
(pkgs.hmcl.overrideAttrs {
|
||||
postFixup = ''
|
||||
substituteInPlace $out/share/applications/HMCL.desktop --replace-fail 'Exec=hmcl' 'Exec=sh -c "cd ~/.local/share/hmcl; hmcl"'
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
my.persist.homeDirs = [
|
||||
".minecraft"
|
||||
".local/share/hmcl"
|
||||
".hmcl"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,12 +15,10 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
package = pkgs.steam;
|
||||
extraPackages = with pkgs; [
|
||||
gamescope
|
||||
];
|
||||
extraCompatPackages = with pkgs; [
|
||||
proton-ge-bin
|
||||
];
|
||||
};
|
||||
my.persist.homeDirs = [
|
||||
".local/share/Steam"
|
||||
|
||||
@@ -9,14 +9,13 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.desktop.media = {
|
||||
cine.enable = true;
|
||||
mpv.enable = true;
|
||||
loupe.enable = true;
|
||||
thunderbird.enable = true;
|
||||
vlc.enable = false;
|
||||
vlc.enable = true;
|
||||
splayer.enable = true;
|
||||
spotify.enable = false;
|
||||
spotube.enable = false;
|
||||
spotify.enable = true;
|
||||
spotube.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.desktop.media.cine;
|
||||
desktop = [ "io.github.diegopvlk.Cine.desktop" ];
|
||||
in
|
||||
{
|
||||
options.my.desktop.media.cine = {
|
||||
enable = lib.mkEnableOption "cine";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.home.packages = [ pkgs.cine ];
|
||||
my.xdg.defaultApplications = {
|
||||
"audio/*" = desktop;
|
||||
"video/*" = desktop;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -6,7 +6,6 @@
|
||||
}:
|
||||
let
|
||||
cfg = config.my.desktop.media.loupe;
|
||||
desktop = [ "org.gnome.Loupe.desktop" ];
|
||||
in
|
||||
{
|
||||
options.my.desktop.media.loupe = {
|
||||
@@ -15,12 +14,5 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.home.packages = [ pkgs.loupe ];
|
||||
my.xdg.defaultApplications = {
|
||||
"image/*" = desktop;
|
||||
"image/gif" = desktop;
|
||||
"image/jpeg" = desktop;
|
||||
"image/png" = desktop;
|
||||
"image/webp" = desktop;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,11 +13,9 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.home.packages = [
|
||||
pkgs.splayer-next
|
||||
];
|
||||
my.hm.home.packages = [ pkgs.splayer ];
|
||||
my.persist.homeDirs = [
|
||||
".config/SPlayer-Next"
|
||||
".config/SPlayer"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.desktop.obsidian;
|
||||
in
|
||||
{
|
||||
options.my.desktop.obsidian = {
|
||||
enable = lib.mkEnableOption "obsidian";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.hm.home.packages = with pkgs; [
|
||||
obsidian
|
||||
];
|
||||
my.persist.homeDirs = [
|
||||
".config/obsidian"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -9,7 +9,7 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.desktop.screencast = {
|
||||
obs-studio.enable = false;
|
||||
obs-studio.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
impure,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -14,12 +13,30 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
catppuccin.sddm = {
|
||||
enable = true;
|
||||
font = "Jetbrains Mono";
|
||||
fontSize = "18";
|
||||
};
|
||||
services.displayManager.sddm = {
|
||||
package = pkgs.kdePackages.sddm;
|
||||
settings.Theme = {
|
||||
CursorTheme = "breeze-dark";
|
||||
CursorSize = 24;
|
||||
};
|
||||
};
|
||||
|
||||
my.hm = {
|
||||
stylix = {
|
||||
enable = true;
|
||||
autoEnable = false;
|
||||
base16Scheme = ./tokyonight-storm.yaml;
|
||||
polarity = "dark";
|
||||
cursor = {
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Classic";
|
||||
size = 24;
|
||||
};
|
||||
icons = {
|
||||
enable = true;
|
||||
package = pkgs.papirus-icon-theme;
|
||||
@@ -27,14 +44,6 @@ in
|
||||
light = "Papirus-Light";
|
||||
};
|
||||
};
|
||||
home.pointerCursor = {
|
||||
enable = true;
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Classic";
|
||||
size = 24;
|
||||
x11.enable = true;
|
||||
gtk.enable = true;
|
||||
};
|
||||
|
||||
# GTK
|
||||
gtk = {
|
||||
@@ -61,7 +70,6 @@ in
|
||||
};
|
||||
};
|
||||
gtk4 = {
|
||||
theme = null;
|
||||
extraConfig = {
|
||||
gtk-decoration-layout = ":none";
|
||||
gtk-application-prefer-dark-theme = 1;
|
||||
@@ -72,21 +80,20 @@ in
|
||||
#QT
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme.name = "kde";
|
||||
style = {
|
||||
package = with pkgs; [
|
||||
style.package = with pkgs; [
|
||||
darkly-qt5
|
||||
darkly-qt6
|
||||
];
|
||||
name = "Darkly";
|
||||
};
|
||||
platformTheme.name = "qtct";
|
||||
};
|
||||
|
||||
xdg.configFile = {
|
||||
kdeglobals.source = impure.mkImpureLink ./kdeglobals;
|
||||
plasmarc.text = ''
|
||||
[Theme]
|
||||
name=darkly
|
||||
'';
|
||||
"qt5ct/qt5ct.conf".source = pkgs.replaceVars ./qtct/qt5ct.conf {
|
||||
darker = pkgs.libsForQt5.qt5ct + /share/qt5ct/colors/darker.conf;
|
||||
};
|
||||
"qt6ct/qt6ct.conf".source = pkgs.replaceVars ./qtct/qt6ct.conf {
|
||||
darker = pkgs.qt6Packages.qt6ct + /share/qt6ct/colors/darker.conf;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
[ColorEffects:Disabled]
|
||||
ChangeSelectionColor=
|
||||
Color=36,36,36
|
||||
ColorAmount=0.5
|
||||
ColorEffect=3
|
||||
ContrastAmount=0.5
|
||||
ContrastEffect=0
|
||||
Enable=
|
||||
IntensityAmount=0
|
||||
IntensityEffect=0
|
||||
|
||||
[ColorEffects:Inactive]
|
||||
ChangeSelectionColor=true
|
||||
Color=51,51,51
|
||||
ColorAmount=0.4
|
||||
ColorEffect=3
|
||||
ContrastAmount=0.4
|
||||
ContrastEffect=0
|
||||
Enable=true
|
||||
IntensityAmount=-0.2
|
||||
IntensityEffect=0
|
||||
|
||||
[Colors:Button]
|
||||
BackgroundAlternate=77,77,77
|
||||
BackgroundNormal=50,50,50
|
||||
DecorationFocus=52,120,218
|
||||
DecorationHover=0,161,236
|
||||
ForegroundActive=61,174,233
|
||||
ForegroundInactive=199,199,199
|
||||
ForegroundLink=0,100,255
|
||||
ForegroundNegative=218,68,83
|
||||
ForegroundNeutral=246,116,0
|
||||
ForegroundNormal=241,241,241
|
||||
ForegroundPositive=36,173,89
|
||||
ForegroundVisited=115,115,158
|
||||
|
||||
[Colors:Complementary]
|
||||
BackgroundAlternate=59,64,69
|
||||
BackgroundNormal=49,54,59
|
||||
DecorationFocus=30,146,255
|
||||
DecorationHover=61,174,230
|
||||
ForegroundActive=246,116,0
|
||||
ForegroundInactive=175,176,179
|
||||
ForegroundLink=61,174,230
|
||||
ForegroundNegative=237,21,21
|
||||
ForegroundNeutral=201,206,59
|
||||
ForegroundNormal=239,240,241
|
||||
ForegroundPositive=17,209,22
|
||||
ForegroundVisited=61,174,230
|
||||
|
||||
[Colors:Selection]
|
||||
BackgroundAlternate=29,153,243
|
||||
BackgroundNormal=27,145,213
|
||||
DecorationFocus=52,120,218
|
||||
DecorationHover=0,161,236
|
||||
ForegroundActive=252,252,252
|
||||
ForegroundInactive=241,241,241
|
||||
ForegroundLink=0,100,255
|
||||
ForegroundNegative=218,68,83
|
||||
ForegroundNeutral=246,116,0
|
||||
ForegroundNormal=241,241,241
|
||||
ForegroundPositive=36,173,89
|
||||
ForegroundVisited=115,115,158
|
||||
|
||||
[Colors:Tooltip]
|
||||
BackgroundAlternate=77,77,77
|
||||
BackgroundNormal=59,59,59
|
||||
DecorationFocus=52,120,218
|
||||
DecorationHover=0,161,236
|
||||
ForegroundActive=61,174,233
|
||||
ForegroundInactive=199,199,199
|
||||
ForegroundLink=0,100,255
|
||||
ForegroundNegative=218,68,83
|
||||
ForegroundNeutral=246,116,0
|
||||
ForegroundNormal=239,240,241
|
||||
ForegroundPositive=36,173,89
|
||||
ForegroundVisited=115,115,158
|
||||
|
||||
[Colors:View]
|
||||
BackgroundAlternate=54,54,54
|
||||
BackgroundNormal=44,44,44
|
||||
DecorationFocus=52,120,218
|
||||
DecorationHover=0,161,236
|
||||
ForegroundActive=61,174,233
|
||||
ForegroundInactive=199,199,199
|
||||
ForegroundLink=0,100,255
|
||||
ForegroundNegative=218,68,83
|
||||
ForegroundNeutral=246,116,0
|
||||
ForegroundNormal=241,241,241
|
||||
ForegroundPositive=36,173,89
|
||||
ForegroundVisited=115,115,158
|
||||
|
||||
[Colors:Window]
|
||||
BackgroundAlternate=77,77,77
|
||||
BackgroundNormal=34,34,34
|
||||
DecorationFocus=52,120,218
|
||||
DecorationHover=0,161,236
|
||||
ForegroundActive=61,174,233
|
||||
ForegroundInactive=199,199,199
|
||||
ForegroundLink=0,100,255
|
||||
ForegroundNegative=218,68,83
|
||||
ForegroundNeutral=246,116,0
|
||||
ForegroundNormal=239,240,241
|
||||
ForegroundPositive=36,173,89
|
||||
ForegroundVisited=115,115,158
|
||||
|
||||
[General]
|
||||
ColorScheme=Darkly
|
||||
|
||||
[Icons]
|
||||
Theme=Papirus-Dark
|
||||
|
||||
[KDE]
|
||||
contrast=0
|
||||
frameContrast=0.2
|
||||
|
||||
[KFileDialog Settings]
|
||||
Allow Expansion=false
|
||||
Automatically select filename extension=true
|
||||
Breadcrumb Navigation=true
|
||||
Decoration position=2
|
||||
Show Full Path=false
|
||||
Show Inline Previews=true
|
||||
Show Preview=false
|
||||
Show Speedbar=true
|
||||
Show hidden files=false
|
||||
Sort by=Name
|
||||
Sort directories first=true
|
||||
Sort hidden files last=false
|
||||
Sort reversed=false
|
||||
Speedbar Width=154
|
||||
View Style=DetailTree
|
||||
|
||||
[WM]
|
||||
activeBackground=34,34,34
|
||||
activeBlend=255,255,255
|
||||
activeForeground=204,204,204
|
||||
inactiveBackground=44,44,44
|
||||
inactiveBlend=44,44,44
|
||||
inactiveForeground=144,144,144
|
||||
@@ -6,44 +6,44 @@
|
||||
|
||||
# Default colors
|
||||
[colors.primary]
|
||||
background = "#24283b"
|
||||
foreground = "#c0caf5"
|
||||
background = '#24283b'
|
||||
foreground = '#c0caf5'
|
||||
|
||||
[colors.cursor]
|
||||
cursor = "#c0caf5"
|
||||
text = "#24283b"
|
||||
cursor = '#c0caf5'
|
||||
text = '#24283b'
|
||||
|
||||
[colors.selection]
|
||||
text = "#c0caf5"
|
||||
background = "#2e3c64"
|
||||
text = '#c0caf5'
|
||||
background = '#2e3c64'
|
||||
|
||||
# Normal colors
|
||||
[colors.normal]
|
||||
black = "#1d202f"
|
||||
red = "#f7768e"
|
||||
green = "#9ece6a"
|
||||
yellow = "#e0af68"
|
||||
blue = "#7aa2f7"
|
||||
magenta = "#bb9af7"
|
||||
cyan = "#7dcfff"
|
||||
white = "#a9b1d6"
|
||||
black = '#1d202f'
|
||||
red = '#f7768e'
|
||||
green = '#9ece6a'
|
||||
yellow = '#e0af68'
|
||||
blue = '#7aa2f7'
|
||||
magenta = '#bb9af7'
|
||||
cyan = '#7dcfff'
|
||||
white = '#a9b1d6'
|
||||
|
||||
# Bright colors
|
||||
[colors.bright]
|
||||
black = "#414868"
|
||||
red = "#ff899d"
|
||||
green = "#9fe044"
|
||||
yellow = "#faba4a"
|
||||
blue = "#8db0ff"
|
||||
magenta = "#c7a9ff"
|
||||
cyan = "#a4daff"
|
||||
white = "#c0caf5"
|
||||
black = '#414868'
|
||||
red = '#ff899d'
|
||||
green = '#9fe044'
|
||||
yellow = '#faba4a'
|
||||
blue = '#8db0ff'
|
||||
magenta = '#c7a9ff'
|
||||
cyan = '#a4daff'
|
||||
white = '#c0caf5'
|
||||
|
||||
# Indexed Colors
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = "#ff9e64"
|
||||
color = '#ff9e64'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = "#db4b4b"
|
||||
color = '#db4b4b'
|
||||
|
||||
@@ -9,10 +9,10 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.desktop.terminal = {
|
||||
alacritty.enable = false;
|
||||
foot.enable = false;
|
||||
alacritty.enable = true;
|
||||
foot.enable = true;
|
||||
kitty.enable = true;
|
||||
ghostty.enable = false;
|
||||
ghostty.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.my.desktop.terminal.default = {
|
||||
command = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "kitty";
|
||||
};
|
||||
desktop = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "kitty.desktop";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -3,29 +3,115 @@
|
||||
lib,
|
||||
pkgs,
|
||||
assets,
|
||||
impure,
|
||||
...
|
||||
}:
|
||||
let
|
||||
niriCfg = config.my.hm.wayland.windowManager.niri;
|
||||
settings = config.my.hm.programs.niri.settings;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.my.desktop.wm.niri.enable {
|
||||
my.hm = {
|
||||
xdg.configFile."niri".source = impure.mkImpureLink ./config;
|
||||
xdg.configFile."niri-generated.kdl".text = niriCfg.finalConfig;
|
||||
my.hm.programs.niri.settings = {
|
||||
input = {
|
||||
focus-follows-mouse = {
|
||||
enable = true;
|
||||
max-scroll-amount = "0%";
|
||||
};
|
||||
workspace-auto-back-and-forth = true;
|
||||
};
|
||||
|
||||
layout = {
|
||||
gaps = 23;
|
||||
center-focused-column = "always";
|
||||
always-center-single-column = true;
|
||||
focus-ring.enable = false;
|
||||
border = {
|
||||
enable = true;
|
||||
width = 4;
|
||||
|
||||
inactive.color = "#2e2e3eee";
|
||||
active.gradient = {
|
||||
from = "#6186d6ee";
|
||||
to = "#cba6f7ee";
|
||||
angle = 180;
|
||||
relative-to = "workspace-view";
|
||||
};
|
||||
};
|
||||
insert-hint = {
|
||||
enable = true;
|
||||
display.color = "rgba(42, 44, 54, 0.5)";
|
||||
};
|
||||
preset-column-widths = [
|
||||
{ proportion = 0.33333; }
|
||||
{ proportion = 0.4; }
|
||||
{ proportion = 0.5; }
|
||||
{ proportion = 0.6; }
|
||||
{ proportion = 0.66667; }
|
||||
{ proportion = 0.8; }
|
||||
];
|
||||
default-column-width.proportion = 0.8;
|
||||
background-color = "transparent";
|
||||
};
|
||||
|
||||
animations = {
|
||||
enable = true;
|
||||
slowdown = 1.5;
|
||||
workspace-switch.kind.spring = {
|
||||
damping-ratio = 1.0;
|
||||
stiffness = 1000;
|
||||
epsilon = 0.0001;
|
||||
};
|
||||
};
|
||||
|
||||
prefer-no-csd = true;
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
|
||||
clipboard.disable-primary = true;
|
||||
|
||||
layer-rules = [
|
||||
{
|
||||
matches = [ { namespace = "^wallpaper$"; } ];
|
||||
place-within-backdrop = true;
|
||||
}
|
||||
{
|
||||
matches = [ { namespace = "^waybar$"; } ];
|
||||
opacity = 0.99;
|
||||
}
|
||||
];
|
||||
overview.workspace-shadow.enable = false;
|
||||
|
||||
window-rules = [
|
||||
{
|
||||
geometry-corner-radius = {
|
||||
bottom-left = 14.;
|
||||
bottom-right = 14.;
|
||||
top-left = 14.;
|
||||
top-right = 14.;
|
||||
};
|
||||
clip-to-geometry = true;
|
||||
draw-border-with-background = false;
|
||||
}
|
||||
{
|
||||
matches = [ { app-id = "kitty|foot|Alacritty|ghostty|chromium-browser|zen-beta|wofi"; } ];
|
||||
opacity = 0.8;
|
||||
}
|
||||
{
|
||||
matches = [ { app-id = "org.gnome.Nautilus"; } ];
|
||||
opacity = 0.6;
|
||||
}
|
||||
];
|
||||
|
||||
wayland.windowManager.niri.settings = {
|
||||
environment.NIXOS_OZONE_WL = "1";
|
||||
|
||||
spawn-at-startup = lib.mkBefore [
|
||||
spawn-at-startup = lib.mkBefore (
|
||||
map (c: { command = c; }) [
|
||||
(
|
||||
[
|
||||
"dbus-update-activation-environment"
|
||||
"--systemd"
|
||||
]
|
||||
++ (builtins.attrNames niriCfg.settings.environment)
|
||||
++ builtins.attrNames settings.environment
|
||||
)
|
||||
|
||||
[
|
||||
"${lib.getExe pkgs.swaybg}"
|
||||
"-m"
|
||||
@@ -49,28 +135,222 @@ in
|
||||
"cliphist"
|
||||
"store"
|
||||
]
|
||||
[ "noctalia-shell" ]
|
||||
];
|
||||
# TODO: Is there a better way?
|
||||
[
|
||||
"systemctl"
|
||||
"restart"
|
||||
"--user"
|
||||
"noctalia-shell.service"
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
binds = lib.mkMerge [
|
||||
binds =
|
||||
let
|
||||
noctalia =
|
||||
cmd:
|
||||
[
|
||||
"noctalia-shell"
|
||||
"ipc"
|
||||
"call"
|
||||
]
|
||||
++ (lib.splitString " " cmd);
|
||||
in
|
||||
with config.my.hm.lib.niri.actions;
|
||||
{
|
||||
"Mod+G".spawn = [ config.my.desktop.browser.default.command ];
|
||||
"Mod+Return".spawn = [ config.my.desktop.terminal.default.command ];
|
||||
}
|
||||
(builtins.listToAttrs (
|
||||
map (n: {
|
||||
name = "Mod+${toString n}";
|
||||
value.focus-workspace = n;
|
||||
}) (lib.range 0 9)
|
||||
))
|
||||
(builtins.listToAttrs (
|
||||
map (n: {
|
||||
name = "Mod+Shift+${toString n}";
|
||||
value.move-column-to-workspace = n;
|
||||
}) (lib.range 0 9)
|
||||
))
|
||||
"Ctrl+Alt+T".action.spawn = [
|
||||
"kitty"
|
||||
];
|
||||
"Mod+T".action.spawn = [
|
||||
"kitty"
|
||||
];
|
||||
"Mod+Return".action.spawn = [
|
||||
"kitty"
|
||||
];
|
||||
"Mod+G".action.spawn = [ config.my.desktop.browser.default.command ];
|
||||
"Mod+E".action.spawn = [ "nautilus" ];
|
||||
"Mod+R".action.spawn = noctalia "launcher toggle";
|
||||
"Mod+V".action.spawn = noctalia "launcher clipboard";
|
||||
|
||||
"XF86AudioRaiseVolume" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = [
|
||||
"wpctl"
|
||||
"set-volume"
|
||||
"@DEFAULT_SINK@"
|
||||
"2%+"
|
||||
];
|
||||
};
|
||||
"XF86AudioLowerVolume" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = [
|
||||
"wpctl"
|
||||
"set-volume"
|
||||
"@DEFAULT_SINK@"
|
||||
"2%-"
|
||||
];
|
||||
};
|
||||
"XF86AudioMute" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = noctalia "media playPause";
|
||||
};
|
||||
"Super+XF86AudioRaiseVolume" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = noctalia "media next";
|
||||
};
|
||||
"Super+XF86AudioLowerVolume" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = noctalia "media previous";
|
||||
};
|
||||
|
||||
"XF86MonBrightnessUp" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = [
|
||||
"brightnessctl"
|
||||
"set"
|
||||
"+5%"
|
||||
];
|
||||
};
|
||||
"XF86MonBrightnessDown" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = [
|
||||
"brightnessctl"
|
||||
"set"
|
||||
"5%-"
|
||||
];
|
||||
};
|
||||
"Alt+XF86AudioRaiseVolume" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = [
|
||||
"brightnessctl"
|
||||
"set"
|
||||
"+5%"
|
||||
];
|
||||
};
|
||||
"Alt+XF86AudioLowerVolume" = {
|
||||
allow-when-locked = true;
|
||||
action.spawn = [
|
||||
"brightnessctl"
|
||||
"set"
|
||||
"5%-"
|
||||
];
|
||||
};
|
||||
|
||||
"Mod+Q".action = close-window;
|
||||
|
||||
"Mod+Left".action = focus-column-left;
|
||||
"Mod+Right".action = focus-column-right;
|
||||
"Mod+Up".action = focus-window-up;
|
||||
"Mod+Down".action = focus-window-down;
|
||||
|
||||
"Mod+Ctrl+Left".action = move-column-left;
|
||||
"Mod+Ctrl+Right".action = move-column-right;
|
||||
"Mod+Ctrl+Up".action = move-window-up;
|
||||
"Mod+Ctrl+Down".action = move-window-down;
|
||||
|
||||
"Mod+Alt+Left".action = consume-or-expel-window-left;
|
||||
"Mod+Alt+Right".action = consume-or-expel-window-right;
|
||||
|
||||
"Mod+Shift+Left".action = focus-monitor-left;
|
||||
"Mod+Shift+Right".action = focus-monitor-right;
|
||||
"Mod+Shift+Up".action = focus-monitor-up;
|
||||
"Mod+Shift+Down".action = focus-monitor-down;
|
||||
|
||||
"Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left;
|
||||
"Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right;
|
||||
"Mod+Shift+Ctrl+Up".action = move-column-to-monitor-up;
|
||||
"Mod+Shift+Ctrl+Down".action = move-column-to-monitor-down;
|
||||
|
||||
"Mod+Page_Up".action = focus-workspace-up;
|
||||
"Mod+Page_Down".action = focus-workspace-down;
|
||||
|
||||
"Mod+Ctrl+Page_Up".action = move-column-to-workspace-up;
|
||||
"Mod+Ctrl+Page_Down".action = move-column-to-workspace-down;
|
||||
|
||||
"Mod+Shift+Page_Up".action = move-workspace-up;
|
||||
"Mod+Shift+Page_Down".action = move-workspace-down;
|
||||
|
||||
"Mod+L".action = switch-preset-column-width;
|
||||
"Mod+Shift+L".action = reset-window-height;
|
||||
"Mod+M".action = maximize-column;
|
||||
"Mod+Shift+M".action = fullscreen-window;
|
||||
"Mod+C".action = center-column;
|
||||
"Mod+F".action = toggle-window-floating;
|
||||
"Mod+H".action = expand-column-to-available-width;
|
||||
|
||||
"Mod+Minus".action.set-column-width = "-10%";
|
||||
"Mod+Equal".action.set-column-width = "+10%";
|
||||
"Mod+Shift+Minus".action.set-window-height = "-10%";
|
||||
"Mod+Shift+Equal".action.set-window-height = "+10%";
|
||||
|
||||
"Ctrl+Alt+A".action.screenshot = [ ];
|
||||
# "Ctrl+Alt+A".action = screenshot;
|
||||
"Print".action.screenshot-screen = [ ];
|
||||
"Alt+Print".action.screenshot-window = [ ];
|
||||
# "Alt+Print".action = screenshot-window;
|
||||
|
||||
"Mod+Shift+E".action = quit;
|
||||
|
||||
"Mod+O".action = toggle-overview;
|
||||
"Super+Tab".action = toggle-overview;
|
||||
|
||||
"Mod+WheelScrollDown" = {
|
||||
cooldown-ms = 150;
|
||||
action = focus-workspace-down;
|
||||
};
|
||||
"Mod+WheelScrollUp" = {
|
||||
cooldown-ms = 150;
|
||||
action = focus-workspace-up;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollDown" = {
|
||||
cooldown-ms = 150;
|
||||
action = move-workspace-down;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollUp" = {
|
||||
cooldown-ms = 150;
|
||||
action = move-workspace-up;
|
||||
};
|
||||
|
||||
"Mod+WheelScrollRight" = {
|
||||
cooldown-ms = 150;
|
||||
action = focus-column-right;
|
||||
};
|
||||
"Mod+WheelScrollLeft" = {
|
||||
cooldown-ms = 150;
|
||||
action = focus-column-left;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollRight" = {
|
||||
cooldown-ms = 150;
|
||||
action = move-column-right;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollLeft" = {
|
||||
cooldown-ms = 150;
|
||||
action = move-column-left;
|
||||
};
|
||||
|
||||
"Mod+Shift+WheelScrollDown" = {
|
||||
cooldown-ms = 150;
|
||||
action = focus-column-right;
|
||||
};
|
||||
"Mod+Shift+WheelScrollUp" = {
|
||||
cooldown-ms = 150;
|
||||
action = focus-column-left;
|
||||
};
|
||||
"Mod+Ctrl+Shift+WheelScrollDown" = {
|
||||
cooldown-ms = 150;
|
||||
action = move-column-right;
|
||||
};
|
||||
"Mod+Ctrl+Shift+WheelScrollUp" = {
|
||||
cooldown-ms = 150;
|
||||
action = move-column-left;
|
||||
};
|
||||
}
|
||||
// lib.attrsets.mergeAttrsList (
|
||||
map (n: {
|
||||
"Mod+${toString n}".action.focus-workspace = n;
|
||||
"Mod+Shift+${toString n}".action.move-column-to-workspace = n;
|
||||
}) (lib.range 0 9)
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
binds {
|
||||
Ctrl+Alt+Escape { spawn "missioncenter"; }
|
||||
|
||||
Mod+R { spawn "noctalia" "msg" "panel-toggle" "launcher"; }
|
||||
Mod+V { spawn "noctalia" "msg" "panel-toggle" "clipboard"; }
|
||||
Mod+W { spawn "noctalia" "msg" "panel-toggle" "launcher" "/win"; }
|
||||
|
||||
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_SINK@" "2%+"; }
|
||||
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_SINK@" "2%-"; }
|
||||
XF86AudioMute allow-when-locked=true { spawn "noctalia" "msg" "media" "playPause"; }
|
||||
Super+XF86AudioRaiseVolume allow-when-locked=true { spawn "noctalia" "msg" "media" "next"; }
|
||||
Super+XF86AudioLowerVolume allow-when-locked=true { spawn "noctalia" "msg" "media" "previous"; }
|
||||
|
||||
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "+5%"; }
|
||||
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "5%-"; }
|
||||
Alt+XF86AudioRaiseVolume allow-when-locked=true { spawn "brightnessctl" "set" "+5%"; }
|
||||
Alt+XF86AudioLowerVolume allow-when-locked=true { spawn "brightnessctl" "set" "5%-"; }
|
||||
|
||||
Mod+Q { close-window; }
|
||||
Mod+Shift+E { quit; }
|
||||
|
||||
Mod+Left { focus-column-left; }
|
||||
Mod+Right { focus-column-right; }
|
||||
Mod+Up { focus-window-up; }
|
||||
Mod+Down { focus-window-down; }
|
||||
|
||||
Mod+Ctrl+Left { move-column-left; }
|
||||
Mod+Ctrl+Right { move-column-right; }
|
||||
Mod+Ctrl+Up { move-window-up; }
|
||||
Mod+Ctrl+Down { move-window-down; }
|
||||
|
||||
Mod+Alt+Left { consume-or-expel-window-left; }
|
||||
Mod+Alt+Right { consume-or-expel-window-right; }
|
||||
|
||||
Mod+Shift+Left { focus-monitor-left; }
|
||||
Mod+Shift+Right { focus-monitor-right; }
|
||||
Mod+Shift+Up { focus-monitor-up; }
|
||||
Mod+Shift+Down { focus-monitor-down; }
|
||||
|
||||
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
|
||||
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
|
||||
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
|
||||
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
|
||||
|
||||
Mod+Page_Up { focus-workspace-up; }
|
||||
Mod+Page_Down { focus-workspace-down; }
|
||||
|
||||
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
|
||||
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
|
||||
|
||||
Mod+Shift+Page_Up { move-workspace-up; }
|
||||
Mod+Shift+Page_Down { move-workspace-down; }
|
||||
|
||||
Mod+L { switch-preset-column-width; }
|
||||
Mod+Shift+L { reset-window-height; }
|
||||
Mod+M { maximize-column; }
|
||||
Mod+Shift+M { fullscreen-window; }
|
||||
Mod+C { center-column; }
|
||||
Mod+F { toggle-window-floating; }
|
||||
Mod+H { expand-column-to-available-width; }
|
||||
Mod+T { toggle-column-tabbed-display; }
|
||||
|
||||
Mod+Equal { set-column-width "+10%"; }
|
||||
Mod+Minus { set-column-width "-10%"; }
|
||||
Mod+Shift+Equal { set-window-height "+10%"; }
|
||||
Mod+Shift+Minus { set-window-height "-10%"; }
|
||||
|
||||
Ctrl+Alt+A { screenshot show-pointer=false; }
|
||||
Print { screenshot-screen show-pointer=false; }
|
||||
Alt+Print { screenshot-window; }
|
||||
|
||||
Mod+O { toggle-overview; }
|
||||
Super+Tab { toggle-overview; }
|
||||
|
||||
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
|
||||
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
|
||||
Mod+WheelScrollLeft cooldown-ms=150 { focus-column-left; }
|
||||
Mod+WheelScrollRight cooldown-ms=150 { focus-column-right; }
|
||||
|
||||
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-workspace-up; }
|
||||
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-workspace-down; }
|
||||
Mod+Ctrl+WheelScrollLeft cooldown-ms=150 { move-column-left; }
|
||||
Mod+Ctrl+WheelScrollRight cooldown-ms=150 { move-column-right; }
|
||||
|
||||
Mod+Shift+WheelScrollUp cooldown-ms=150 { focus-column-left; }
|
||||
Mod+Shift+WheelScrollDown cooldown-ms=150 { focus-column-right; }
|
||||
Mod+Ctrl+Shift+WheelScrollUp cooldown-ms=150 { move-column-left; }
|
||||
Mod+Ctrl+Shift+WheelScrollDown cooldown-ms=150 { move-column-right; }
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user