Compare commits

..
2 Commits
Author SHA1 Message Date
imxyy1soope1 8a31f71d80 chore(zen): xdg migration 2026-02-20 17:14:57 +08:00
imxyy1soope1 04116ebfcb chore(hmcl): remove hack 2026-02-20 17:14:37 +08:00
150 changed files with 2828 additions and 3054 deletions
-1
View File
@@ -1,2 +1 @@
export IMPURE_ROOT=$(pwd) export IMPURE_ROOT=$(pwd)
dotenv
-8
View File
@@ -49,11 +49,3 @@ alias offline := switch-offline
@fmt: @fmt:
echo "Formatting files..." echo "Formatting files..."
nix fmt 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
+5 -10
View File
@@ -6,10 +6,9 @@
This repository is home to the nix code that builds my systems: This repository is home to the nix code that builds my systems:
Currently, this repository contains the nix code that builds: Currently, this repository contains the nix code that builds:
1. NixOS Desktop (`imxyy-nix`): NixOS with home-manager, niri, neovim, etc. 1. NixOS Desktop: NixOS with home-manager, niri, neovim, etc.
2. NixOS Laptop (`imxyy-nix-x16`): the desktop profile on a laptop 2. NixOS home server
3. NixOS home server (`imxyy-nix-server`) 3. NixOS WSL
4. NixOS WSL (`imxyy-nix-wsl`)
See [./hosts](./hosts) for details of each host. See [./hosts](./hosts) for details of each host.
@@ -28,15 +27,12 @@ enabling declarative host definitions and cleaner separation of concerns.
## Folder Structure ## 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/core/` - core system modules (nix, persistence, time, user, xdg)
- `modules/cli/` - command-line tools and utilities - `modules/cli/` - command-line tools and utilities
- `modules/coding/` - development environments and editors - `modules/coding/` - development environments and editors
- `modules/desktop/` - desktop applications and window managers - `modules/desktop/` - desktop applications and window managers
- `modules/virt/` - virtualization configurations - `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/` - system configuration profiles
- `profiles/base.nix` - base configuration for all hosts - `profiles/base.nix` - base configuration for all hosts
- `profiles/desktop.nix` - desktop environment configuration - `profiles/desktop.nix` - desktop environment configuration
@@ -45,10 +41,9 @@ enabling declarative host definitions and cleaner separation of concerns.
- `hosts/<name>/` - host-specific configs - `hosts/<name>/` - host-specific configs
- `flake/` - flake-parts modules - `flake/` - flake-parts modules
- `flake/hosts.nix` - declarative host definitions - `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 - `lib/` - custom nix library
- `pkgs/` - custom packages - `pkgs/` - custom packages
- `overlays/` - nixpkgs overlays
- `vars.nix` - my variables - `vars.nix` - my variables
- `secrets/` - secrets managed by sops-nix. see [./secrets](./secrets) for details - `secrets/` - secrets managed by sops-nix. see [./secrets](./secrets) for details
- `flake.nix` - flake entry - `flake.nix` - flake entry
Generated
+723 -243
View File
File diff suppressed because it is too large Load Diff
+23 -49
View File
@@ -3,8 +3,12 @@
inputs = { inputs = {
# Nixpkgs # Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
multiverse.url = "github:fzakaria/nixpkgs-multiverse"; 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
home-manager = { home-manager = {
@@ -16,7 +20,6 @@
nixos-wsl = { nixos-wsl = {
url = "github:nix-community/NixOS-WSL"; url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
}; };
# Flake organization tools # Flake organization tools
@@ -37,20 +40,20 @@
# Useful modules # Useful modules
# keep-sorted start block=yes # keep-sorted start block=yes
impermanence = { catppuccin = {
url = "github:nix-community/impermanence"; url = "github:catppuccin/nix";
inputs.nixpkgs.follows = "nixpkgs"; 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 = { sops-nix = {
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix/pull/779/merge";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
stylix = { stylix = {
url = "github:danth/stylix"; url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
inputs.systems.follows = "systems";
}; };
system76-scheduler-niri = { system76-scheduler-niri = {
url = "github:Kirottu/system76-scheduler-niri"; url = "github:Kirottu/system76-scheduler-niri";
@@ -68,47 +71,21 @@
url = "github:Bali10050/Darkly"; url = "github:Bali10050/Darkly";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
fast-nix-gc = {
url = "github:Mic92/fast-nix-gc";
inputs.nixpkgs.follows = "nixpkgs";
inputs.treefmt-nix.follows = "treefmt";
};
fenix = { fenix = {
url = "github:nix-community/fenix"; url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
llm-agents = { go-musicfox = {
url = "github:numtide/llm-agents.nix"; url = "github:imxyy1soope1/go-musicfox";
# 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";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-tree-rs = { niri.url = "github:sodiboo/niri-flake";
url = "github:Mic92/nix-tree-rs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
inputs.treefmt-nix.follows = "treefmt";
};
noctalia = { noctalia = {
url = "github:noctalia-dev/noctalia-shell/v5.0.0-beta.10"; url = "github:noctalia-dev/noctalia-shell/v4.5.0";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
selector4nix = { zen.inputs.nixpkgs.follows = "nixpkgs";
url = "github:StarryReverie/selector4nix"; zen.url = "github:0xc000022070/zen-browser-flake";
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";
};
# keep-sorted end # keep-sorted end
# Misc # Misc
@@ -116,15 +93,11 @@
url = "github:numtide/treefmt-nix"; url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
my-templates.url = "git+https://git.imxyy.top/imxyy1soope1/flake-templates"; plant = {
url = "git+ssh://git@git.imxyy.top:2222/imxyy1soope1/HF-plant.git?rev=08dc0b3889797eb3618c7475c3c367ec0e5fdf40";
# Flattened indirect dependencies flake = false;
flake-compat.url = "github:edolstra/flake-compat";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
}; };
systems.url = "github:nix-systems/default"; my-templates.url = "git+https://git.imxyy.top/imxyy1soope1/flake-templates";
}; };
outputs = outputs =
@@ -147,6 +120,7 @@
./flake/hosts.nix ./flake/hosts.nix
./flake/pkgs.nix ./flake/pkgs.nix
./treefmt.nix ./treefmt.nix
./overlays
]; ];
nixosHosts = { nixosHosts = {
+24 -21
View File
@@ -2,25 +2,20 @@
self, self,
lib, lib,
inputs, inputs,
withSystem,
config, config,
pkgsParams, pkgsParams,
... ...
}: }:
let let
vars = import ../vars.nix; vars = import ../vars.nix;
pkgsModule = args: { pkgsModule = {
nixpkgs = lib.mkMerge [ nixpkgs = pkgsParams;
pkgsParams
{
overlays = import ./overlays args;
}
];
}; };
hmModule = { hmModule = {
home-manager = { home-manager = {
sharedModules = [ sharedModules = [
# keep-sorted start # keep-sorted start
inputs.niri-nix.homeModules.default
inputs.noctalia.homeModules.default inputs.noctalia.homeModules.default
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeModules.stylix inputs.stylix.homeModules.stylix
@@ -34,16 +29,6 @@ let
useGlobalPkgs = true; 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 in
{ {
options.nixosHosts = lib.mkOption { options.nixosHosts = lib.mkOption {
@@ -66,11 +51,13 @@ in
modules = lib.mkOption { modules = lib.mkOption {
type = lib.types.listOf lib.types.deferredModule; type = lib.types.listOf lib.types.deferredModule;
default = lib.umport { default = (
lib.umport {
paths = [ ../hosts/${name} ]; paths = [ ../hosts/${name} ];
extraExcludePredicate = path: lib.hasInfix "/_" (toString path); extraExcludePredicate = path: lib.hasInfix "/_" (toString path);
recursive = true; recursive = true;
}; }
);
description = "Additional NixOS modules specific to this host"; description = "Additional NixOS modules specific to this host";
}; };
@@ -91,6 +78,8 @@ in
# Generate nixosConfigurations from declarative host definitions # Generate nixosConfigurations from declarative host definitions
flake.nixosConfigurations = lib.mapAttrs ( flake.nixosConfigurations = lib.mapAttrs (
hostname: hostConfig: hostname: hostConfig:
withSystem hostConfig.system (
{ ... }:
lib.nixosSystem { lib.nixosSystem {
inherit (hostConfig) system; inherit (hostConfig) system;
@@ -117,25 +106,39 @@ in
// hostConfig.extraSpecialArgs; // hostConfig.extraSpecialArgs;
modules = modules =
# Automatically import all feature modules
(lib.umport { (lib.umport {
paths = [ ../modules ]; paths = [ ../modules ];
extraExcludePredicate = path: lib.hasInfix "/_" (toString path); extraExcludePredicate = path: lib.hasInfix "/_" (toString path);
recursive = true; recursive = true;
}) })
++ [ ++ [
# Base profile (always included)
../profiles/base.nix ../profiles/base.nix
] ]
# Add requested profiles
++ (map (profile: ../profiles/${profile}.nix) hostConfig.profiles) ++ (map (profile: ../profiles/${profile}.nix) hostConfig.profiles)
# Add host-specific modules
++ hostConfig.modules ++ hostConfig.modules
++ upstreamModules
++ [ ++ [
(lib.mkAliasOptionModule [ "my" "hm" ] [ "home-manager" "users" vars.username ]) (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 # pkgs and home-manager configuration
pkgsModule pkgsModule
hmModule hmModule
]; ];
} }
)
) config.nixosHosts; ) config.nixosHosts;
}; };
} }
-21
View File
@@ -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
View File
@@ -9,26 +9,16 @@
_module.args = { _module.args = {
pkgsParams = { pkgsParams = {
overlays = builtins.attrValues config.flake.overlays ++ [ 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.fenix.overlays.default
inputs.angrr.overlays.default inputs.angrr.overlays.default
inputs.llm-agents.overlays.shared-nixpkgs (final: prev: {
( darkly-qt5 = inputs.darkly.packages.${final.stdenv.hostPlatform.system}.darkly-qt5;
final: prev: darkly-qt6 = inputs.darkly.packages.${final.stdenv.hostPlatform.system}.darkly-qt6;
let
system = final.stdenv.hostPlatform.system;
in
{
darkly-qt6 = inputs.darkly.packages.${system}.darkly-qt6;
noctalia-shell = inputs.noctalia.packages.${system}.default; noctalia-shell = inputs.noctalia.packages.${final.stdenv.hostPlatform.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;
};
}
)
]; ];
config.allowUnfree = true; config.allowUnfree = true;
flake.setNixPath = false; flake.setNixPath = false;
-12
View File
@@ -2,18 +2,6 @@
services.caddy = { services.caddy = {
enable = true; enable = true;
email = "acme@imxyy.top"; 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 = { security.acme = {
acceptTerms = true; acceptTerms = true;
+3 -2
View File
@@ -7,8 +7,9 @@
users.users.coder.extraGroups = [ "podman" ]; users.users.coder.extraGroups = [ "podman" ];
services.caddy.virtualHosts."coder.imxyy.top" = { services.caddy.virtualHosts."coder.imxyy.top" = {
extraConfig = '' extraConfig = ''
reverse_proxy :8086 reverse_proxy :8086 {
header_up X-Real-IP {remote_host}
}
''; '';
}; };
my.services.frp.webServers = [ "coder.imxyy.top" ];
} }
+14
View File
@@ -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;
};
}
+13 -6
View File
@@ -25,6 +25,13 @@
config.sops.secrets.efl-tuwunel-env.path 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 = { send = {
image = "lanol/filecodebox:latest"; image = "lanol/filecodebox:latest";
@@ -34,16 +41,16 @@
}; };
services.caddy.virtualHosts."mtx.eflx.top" = { services.caddy.virtualHosts."mtx.eflx.top" = {
extraConfig = '' extraConfig = ''
reverse_proxy :6167 reverse_proxy :6167 {
header_up X-Real-IP {remote_host}
}
''; '';
}; };
services.caddy.virtualHosts."send.eflx.top" = { services.caddy.virtualHosts."send.eflx.top" = {
extraConfig = '' extraConfig = ''
reverse_proxy :12345 reverse_proxy :12345 {
header_up X-Real-IP {remote_host}
}
''; '';
}; };
my.services.frp.webServers = [
"mtx.eflx.top"
"send.eflx.top"
];
} }
-33
View File
@@ -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);
};
}
+4 -15
View File
@@ -1,19 +1,11 @@
{ {
services.caddy.virtualHosts."git.imxyy.top" = { services.caddy.virtualHosts."git.imxyy.top" = {
extraConfig = '' 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 = { services.gitea = {
enable = true; enable = true;
appName = "imxyy_soope_'s Gitea"; appName = "imxyy_soope_'s Gitea";
@@ -33,10 +25,7 @@
SSH_PORT = 2222; SSH_PORT = 2222;
}; };
service = { service = {
DISABLE_REGISTRATION = true; REGISTER_MANUAL_CONFIRM = true;
};
security = {
REVERSE_PROXY_TRUSTED_PROXIES = "127.0.0.0/8,::1/128";
}; };
}; };
}; };
+43
View File
@@ -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}
}
'';
};
}
+38 -17
View File
@@ -5,7 +5,7 @@
... ...
}: }:
let let
btrfs = "/dev/disk/by-uuid/1e1b403d-4a04-46ee-a6eb-cb4dd5f793a2"; btrfs = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0";
in in
{ {
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
@@ -18,11 +18,12 @@ in
]; ];
boot.initrd.kernelModules = [ "amdgpu" ]; boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_xanmod; # LTS boot.kernelPackages = lib.mkForce pkgs.linuxPackages_xanmod_stable;
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.tmp.useTmpfs = true; boot.tmp.useTmpfs = true;
boot.supportedFilesystems = [ "zfs" ]; boot.supportedFilesystems = [ "zfs" ];
boot.zfs = { boot.zfs = {
package = pkgs.zfs_unstable;
extraPools = [ "data" ]; extraPools = [ "data" ];
forceImportRoot = false; forceImportRoot = false;
}; };
@@ -30,12 +31,13 @@ in
services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.enable = true;
networking.hostId = "10ca95b4"; networking.hostId = "10ca95b4";
my.persist.btrfs = { fileSystems."/" = {
device = btrfs; device = btrfs;
mountPoint = "/nix/persist"; fsType = "btrfs";
persistSubvol = "persist"; options = [
rootSubvol = "root"; "compress=zstd"
zstdCompress = true; "subvol=root"
];
}; };
fileSystems."/nix" = { fileSystems."/nix" = {
@@ -47,25 +49,44 @@ in
]; ];
}; };
fileSystems."/swap" = { my.persist.location = "/nix/persist";
fileSystems."/nix/persist" = {
device = btrfs; device = btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"noatime" "compress=zstd"
"subvol=swap" "subvol=persist"
]; ];
neededForBoot = true; neededForBoot = true;
}; };
swapDevices = [
{ boot.initrd.postDeviceCommands = lib.mkAfter ''
device = "/swap/swapfile"; mkdir /btrfs_tmp
size = 24 * 1024; 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" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/58F4-135A"; device = "/dev/disk/by-uuid/32AA-2998";
fsType = "vfat"; fsType = "vfat";
options = [ options = [
"uid=0" "uid=0"
-1
View File
@@ -8,7 +8,6 @@
coding.langs.lua.enable = true; coding.langs.lua.enable = true;
coding.langs.rust.enable = true; coding.langs.rust.enable = true;
coding.langs.js.enable = true; coding.langs.js.enable = true;
coding.agents.enable = true;
fonts.enable = lib.mkForce false; fonts.enable = lib.mkForce false;
persist = { persist = {
enable = true; enable = true;
-1
View File
@@ -11,5 +11,4 @@
reverse_proxy :8085 reverse_proxy :8085
''; '';
}; };
my.services.frp.webServers = [ "home.imxyy.top" ];
} }
+3 -2
View File
@@ -13,8 +13,9 @@
}; };
services.caddy.virtualHosts."immich.imxyy.top" = { services.caddy.virtualHosts."immich.imxyy.top" = {
extraConfig = '' extraConfig = ''
reverse_proxy :8096 reverse_proxy :8096 {
header_up X-Real-IP {remote_host}
}
''; '';
}; };
my.services.frp.webServers = [ "immich.imxyy.top" ];
} }
-8
View File
@@ -1,8 +0,0 @@
{
services.caddy.virtualHosts."linspirer.imxyy.top" = {
extraConfig = ''
reverse_proxy :8800
'';
};
my.services.frp.webServers = [ "linspirer.imxyy.top" ];
}
+3 -2
View File
@@ -46,8 +46,9 @@
}; };
services.caddy.virtualHosts."mail.imxyy.top" = { services.caddy.virtualHosts."mail.imxyy.top" = {
extraConfig = '' extraConfig = ''
reverse_proxy :8087 reverse_proxy :8087 {
header_up X-Real-IP {remote_host}
}
''; '';
}; };
my.services.frp.webServers = [ "mail.imxyy.top" ];
} }
+1 -48
View File
@@ -1,17 +1,10 @@
{ {
lib,
pkgs,
config, config,
secrets, secrets,
... ...
}: }:
{ {
nixpkgs.config.permittedInsecurePackages = nixpkgs.config.permittedInsecurePackages = [
lib.warn
''
mautrix-telegram still using olm-3.2.16
''
[
"olm-3.2.16" "olm-3.2.16"
]; ];
sops.secrets.tuwunel-reg-token = { sops.secrets.tuwunel-reg-token = {
@@ -74,10 +67,6 @@
reverse_proxy :8094 reverse_proxy :8094
''; '';
}; };
my.services.frp.webServers = [
"imxyy.top"
"matrix.imxyy.top"
];
sops.secrets.mautrix-telegram = { sops.secrets.mautrix-telegram = {
sopsFile = secrets.mautrix-telegram; sopsFile = secrets.mautrix-telegram;
@@ -106,12 +95,7 @@
displayname_template = "{displayname} (Telegram)"; displayname_template = "{displayname} (Telegram)";
permissions = { permissions = {
"@imxyy_soope_:imxyy.top" = "admin"; "@imxyy_soope_:imxyy.top" = "admin";
"*" = "relaybot";
}; };
relaybot = {
whitelist = [ ];
};
relay_user_distinguishers = [ ];
}; };
telegram = { telegram = {
# borrowed from https://github.com/telegramdesktop/tdesktop/blob/9bdc19e2fd4d497c8f403891848383a88faadc25/snap/snapcraft.yaml#L134-L135 # 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";
};
};
};
};
} }
+20
View File
@@ -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
View File
@@ -47,31 +47,81 @@
"192.168.3.2" "192.168.3.2"
]; ];
firewall = { firewall.enable = false;
nftables = {
enable = true; enable = true;
checkReversePath = false; flushRuleset = true;
allowedTCPPorts = [ ruleset = ''
80 table inet firewall {
443 set LANv4 {
2222 type ipv4_addr
]; flags interval
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 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 }
ip6 saddr { fd00::/8, fe80::/10 } accept }
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 = { services.openssh = {
enable = true; enable = true;
openFirewall = false;
settings = { settings = {
# PermitRootLogin = "yes"; # PermitRootLogin = "yes";
PermitRootLogin = "prohibit-password"; PermitRootLogin = "prohibit-password";
@@ -93,7 +143,6 @@
services.dae = { services.dae = {
enable = true; enable = true;
configFile = config.sops.secrets.dae-imxyy-nix-server.path; configFile = config.sops.secrets.dae-imxyy-nix-server.path;
openFirewall.enable = false;
}; };
systemd.services.dae = { systemd.services.dae = {
after = [ "sops-nix.service" ]; after = [ "sops-nix.service" ];
@@ -128,6 +177,237 @@
serverAddr = "{{ .Envs.FRP_SERVER_ADDR }}"; serverAddr = "{{ .Envs.FRP_SERVER_ADDR }}";
serverPort = 7000; serverPort = 7000;
auth.token = "{{ .Envs.FRP_AUTH_TOKEN }}"; 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" = { services.caddy.virtualHosts."oidc.imxyy.top" = {
extraConfig = '' 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"; description = "Go Dynamic DNS";
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { 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"; Restart = "always";
RestartSec = 120; 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; enable = true;
resolveLocalQueries = false; resolveLocalQueries = false;
settings = { settings = {
no-resolv = true; no-resolv = true;
server = [ "192.168.3.1" ]; server = [ "192.168.3.1" ];
host-record = [ address = map (sub: "/${sub}.imxyy.top/192.168.3.2") subDomains ++ [
"imxyy-nix-server,192.168.3.2" "/imxyy-nix-server/192.168.3.2"
"imxyy-cloudwin,192.168.3.4" "/imxyy-cloudwin/192.168.3.4"
"printer.home,192.168.3.53" "/printer.home/192.168.3.53"
] ];
++ (map (domain: "${domain},192.168.3.2") config.my.services.frp.webServers);
cache-size = 0; cache-size = 0;
log-queries = "extra"; log-queries = "extra";
}; };
+3 -9
View File
@@ -17,13 +17,14 @@ in
services.nextcloud = { services.nextcloud = {
enable = true; enable = true;
package = pkgs.nextcloud34; package = pkgs.nextcloud32;
extraApps = { extraApps = {
inherit (pkgs.nextcloud34.packages.apps) inherit (pkgs.nextcloud32.packages.apps)
bookmarks bookmarks
previewgenerator previewgenerator
spreed spreed
notes notes
registration
; ;
}; };
extraAppsEnable = true; extraAppsEnable = true;
@@ -72,12 +73,6 @@ in
"pm.max_spare_servers" = "12"; "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" = { services.nginx.virtualHosts."nextcloud.imxyy.top" = {
listen = [ listen = [
{ {
@@ -113,7 +108,6 @@ in
redir /.well-known/caldav /remote.php/dav/ 301 redir /.well-known/caldav /remote.php/dav/ 301
''; '';
}; };
my.services.frp.webServers = [ "nextcloud.imxyy.top" ];
/* /*
systemd.timers."kopia" = { systemd.timers."kopia" = {
+12 -1
View File
@@ -28,6 +28,13 @@
]; ];
ports = [ "8095:6806" ]; ports = [ "8095:6806" ];
}; };
memos = {
image = "neosmemo/memos:stable";
volumes = [
"/mnt/nas/memos:/var/opt/memos"
];
ports = [ "8097:5230" ];
};
}; };
services.caddy.virtualHosts = { services.caddy.virtualHosts = {
"sy.imxyy.top" = { "sy.imxyy.top" = {
@@ -35,6 +42,10 @@
reverse_proxy :8095 reverse_proxy :8095
''; '';
}; };
"memo.imxyy.top" = {
extraConfig = ''
reverse_proxy :8097
'';
};
}; };
my.services.frp.webServers = [ "sy.imxyy.top" ];
} }
+74
View File
@@ -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" ];
}
];
}
-20
View File
@@ -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";
};
};
}
+16 -1
View File
@@ -36,5 +36,20 @@ in
reverse_proxy :8100 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" ];
}
];
} }
+16 -1
View File
@@ -30,5 +30,20 @@
reverse_proxy :8101 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" ];
}
];
} }
+3 -2
View File
@@ -24,8 +24,9 @@
}; };
services.caddy.virtualHosts."vault.imxyy.top" = { services.caddy.virtualHosts."vault.imxyy.top" = {
extraConfig = '' extraConfig = ''
reverse_proxy :8083 reverse_proxy :8083 {
header_up X-Real-IP {remote_host}
}
''; '';
}; };
my.services.frp.webServers = [ "vault.imxyy.top" ];
} }
+42 -5
View File
@@ -30,12 +30,13 @@ in
}; };
}; };
my.persist.btrfs = { fileSystems."/" = {
device = btrfs; device = btrfs;
mountPoint = "/nix/persist"; fsType = "btrfs";
persistSubvol = "persist"; options = [
rootSubvol = "root"; "compress=zstd"
zstdCompress = true; "subvol=root"
];
}; };
fileSystems."/nix" = { 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" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/96D3-93B0"; device = "/dev/disk/by-uuid/96D3-93B0";
fsType = "vfat"; fsType = "vfat";
+95 -26
View File
@@ -1,28 +1,28 @@
{ {
config,
pkgs, pkgs,
username, 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 = { my.hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
localsend
wpsoffice-cn
wps-office-fonts
ttf-wps-fonts
papers
anki
ayugram-desktop
signal-desktop-wayland
element-desktop
fractal
qq-wayland
wechat
gnome-clocks gnome-clocks
]; ];
programs.zsh = { programs.zsh = {
@@ -34,15 +34,19 @@
set -gp PATH $HOME/bin set -gp PATH $HOME/bin
''; '';
wayland.windowManager.niri.settings = { programs.niri.settings = {
environment.STEAM_FORCE_DESKTOPUI_SCALING = "1.25"; environment.STEAM_FORCE_DESKTOPUI_SCALING = "1.25";
output = [ outputs = {
{ eDP-1 = {
_args = [ "eDP-1" ]; enable = true;
mode = "1920x1200@60.002"; mode = {
width = 1920;
height = 1200;
refresh = 60.002;
};
scale = 1.25; scale = 1.25;
} };
]; };
}; };
}; };
@@ -52,9 +56,52 @@
coding.all.enable = true; coding.all.enable = true;
desktop.all.enable = true; desktop.all.enable = true;
virt.moonlight.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 = { persist = {
enable = true; enable = true;
homeDirs = [ homeDirs = [
@@ -69,6 +116,28 @@
".cache" ".cache"
".local/state" ".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"
]; ];
}; };
}; };
+36 -9
View File
@@ -12,17 +12,45 @@
my.persist.nixosDirs = [ "/etc/NetworkManager/system-connections" ]; my.persist.nixosDirs = [ "/etc/NetworkManager/system-connections" ];
networking = { networking = {
networkmanager.enable = true; networkmanager.enable = true;
firewall = { firewall.enable = false;
nftables = {
enable = true; enable = true;
checkReversePath = false; flushRuleset = true;
allowPing = false; ruleset = ''
extraInputRules = '' table inet firewall {
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 set LANv4 {
ip6 saddr { fd00::/8, fe80::/10 } accept 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 = { sops.secrets.dae-imxyy-nix-x16 = {
@@ -33,7 +61,6 @@
services.dae = { services.dae = {
enable = true; enable = true;
configFile = config.sops.secrets.dae-imxyy-nix-x16.path; configFile = config.sops.secrets.dae-imxyy-nix-x16.path;
openFirewall.enable = false;
}; };
systemd.services.dae.after = [ "sops-nix.service" ]; systemd.services.dae.after = [ "sops-nix.service" ];
sops.secrets.mihomo = { sops.secrets.mihomo = {
-1
View File
@@ -31,7 +31,6 @@
services.openssh = { services.openssh = {
enable = true; enable = true;
openFirewall = false;
settings = { settings = {
# Forbid root login through SSH. # Forbid root login through SSH.
PermitRootLogin = null; PermitRootLogin = null;
+42 -10
View File
@@ -34,20 +34,16 @@ in
resumeDevice = btrfs; resumeDevice = btrfs;
kernelParams = [ kernelParams = [
"resume_offset=6444127" "resume_offset=6444127"
# Fix connector hotplug at ly display manager
"amdgpu.runpm=0"
]; ];
zswap.enable = true;
}; };
my.persist.btrfs = { fileSystems."/" = {
device = btrfs; device = btrfs;
mountPoint = "/nix/persist"; fsType = "btrfs";
persistSubvol = "persistent"; options = [
rootSubvol = "root"; "compress=zstd"
zstdCompress = true; "subvol=root"
];
}; };
fileSystems."/nix" = { fileSystems."/nix" = {
@@ -56,6 +52,17 @@ in
options = [ "compress=zstd" ]; options = [ "compress=zstd" ];
}; };
my.persist.location = "/nix/persist";
fileSystems."/nix/persist" = {
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
"subvol=persistent"
];
neededForBoot = true;
};
fileSystems."/swap" = { fileSystems."/swap" = {
device = btrfs; device = btrfs;
fsType = "btrfs"; fsType = "btrfs";
@@ -66,6 +73,31 @@ in
neededForBoot = true; 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" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/B7DC-E9AC"; device = "/dev/disk/by-uuid/B7DC-E9AC";
fsType = "vfat"; fsType = "vfat";
+108 -31
View File
@@ -1,28 +1,28 @@
{ {
config,
pkgs, pkgs,
username, 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 = { my.hm = {
home.packages = with pkgs; [ home.packages = with pkgs; [
localsend
wpsoffice-cn
wps-office-fonts
ttf-wps-fonts
papers
anki
ayugram-desktop
signal-desktop-wayland
element-desktop
fractal
qq-wayland
wechat
gnome-clocks gnome-clocks
]; ];
programs.zsh = { programs.zsh = {
@@ -48,35 +48,92 @@
''; '';
}; };
wayland.windowManager.niri.settings = { programs.niri.settings = {
environment.STEAM_FORCE_DESKTOPUI_SCALING = "1.25"; environment.STEAM_FORCE_DESKTOPUI_SCALING = "1.25";
output = [ outputs = {
{ DP-1 = {
_args = [ "DP-1" ]; enable = true;
mode = "2560x1440@75.033"; mode = {
width = 2560;
height = 1440;
refresh = 75.033;
};
scale = 1.25; scale = 1.25;
position._props = { position = {
x = 0; x = 0;
y = 0; y = 0;
}; };
} };
{ DP-2 = {
_args = [ "DP-2" ]; enable = true;
mode = "2560x1440@75.033"; mode = {
width = 2560;
height = 1440;
refresh = 75.033;
};
scale = 1.25; scale = 1.25;
} };
]; };
}; };
}; };
my = { my = {
autologin = {
enable = true;
user = username;
ttys = [ 6 ];
};
gpg.enable = true; gpg.enable = true;
cli.all.enable = true; cli.all.enable = true;
coding.all.enable = true; coding.all.enable = true;
desktop.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 = { persist = {
enable = true; enable = true;
homeDirs = [ homeDirs = [
@@ -89,8 +146,28 @@
".cache" ".cache"
".local/state" ".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" ".config/sunshine"
".gemini"
".claude"
".claude-code-router"
];
homeFiles = [
".claude.json"
]; ];
}; };
}; };
+39 -12
View File
@@ -24,6 +24,7 @@
eth0 = { eth0 = {
useDHCP = lib.mkForce true; useDHCP = lib.mkForce true;
wakeOnLan.enable = true; wakeOnLan.enable = true;
macAddress = "3C:7C:3F:7C:D3:9D";
ipv4 = { ipv4 = {
addresses = [ addresses = [
{ {
@@ -42,22 +43,49 @@
"192.168.3.2" "192.168.3.2"
]; ];
firewall = { firewall.enable = false;
nftables = {
enable = true; enable = true;
checkReversePath = false; flushRuleset = true;
allowPing = false; ruleset = ''
trustedInterfaces = [ "waydroid0" ]; table inet firewall {
extraInputRules = '' set LANv4 {
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 type ipv4_addr
ip6 saddr { fd00::/8, fe80::/10 } accept flags interval
'';
filterForward = true; 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 }
extraForwardRules = '' }
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 iifname waydroid0 accept
oifname waydroid0 accept oifname waydroid0 accept
}
}
''; '';
}; };
nftables.enable = true;
}; };
sops.secrets.dae-imxyy-nix = { sops.secrets.dae-imxyy-nix = {
@@ -68,7 +96,6 @@
services.dae = { services.dae = {
enable = true; enable = true;
configFile = config.sops.secrets.dae-imxyy-nix.path; configFile = config.sops.secrets.dae-imxyy-nix.path;
openFirewall.enable = false;
}; };
systemd.services.dae.after = [ "sops-nix.service" ]; systemd.services.dae.after = [ "sops-nix.service" ];
sops.secrets.mihomo = { sops.secrets.mihomo = {
-1
View File
@@ -78,7 +78,6 @@ in
}; };
services.openssh = { services.openssh = {
enable = true; enable = true;
openFirewall = false;
settings = { settings = {
# Forbid root login through SSH. # Forbid root login through SSH.
PermitRootLogin = null; PermitRootLogin = null;
+3 -3
View File
@@ -19,8 +19,8 @@ let
with lib; with lib;
with fileset; with fileset;
let let
excludedFiles = filter pathIsRegularFile exclude; excludedFiles = filter (path: pathIsRegularFile path) exclude;
excludedDirs = filter pathIsDirectory exclude; excludedDirs = filter (path: pathIsDirectory path) exclude;
isExcluded = isExcluded =
path: path:
(elem path excludedFiles) (elem path excludedFiles)
@@ -39,7 +39,7 @@ let
) (builtins.readDir path) ) (builtins.readDir path)
) (unique (if path == null then paths else [ path ] ++ paths)) ) (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 in
umport umport
-9
View File
@@ -16,17 +16,8 @@ in
Enable = "Source,Sink,Media,Socket"; Enable = "Source,Sink,Media,Socket";
Disable = "HeadSet"; Disable = "HeadSet";
MultiProfile = "multiple"; MultiProfile = "multiple";
# Avoid bluetooth headset connection failure
Experimental = true;
FastConnectable = true;
ControllerMode = "dual";
}; };
}; };
}; };
boot.extraModprobeConfig = ''
options btusb enable_autosuspend=n
'';
}; };
} }
+1
View File
@@ -9,6 +9,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.cli.media = { my.cli.media = {
go-musicfox.enable = true;
ffmpeg.enable = true; ffmpeg.enable = true;
}; };
}; };
+39
View File
@@ -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"
];
};
};
}
+2 -2
View File
@@ -53,7 +53,6 @@ in
my.persist.homeDirs = [ my.persist.homeDirs = [
".local/share/zoxide" ".local/share/zoxide"
".config/television/cable" ".config/television/cable"
".config/dconf"
]; ];
my.hm = { my.hm = {
programs.fish.shellAliases = { programs.fish.shellAliases = {
@@ -68,12 +67,13 @@ in
aria2 aria2
bat bat
comma comma
fastfetch-unwrapped fastfetch
fd fd
fzf fzf
jq jq
keep-sorted keep-sorted
lsd lsd
neofetch
ripgrep ripgrep
socat socat
typos typos
-1
View File
@@ -12,7 +12,6 @@ in
zsh.enable = true; zsh.enable = true;
fish.enable = true; fish.enable = true;
starship.enable = true; starship.enable = true;
carapace.enable = true;
}; };
}; };
} }
-17
View File
@@ -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;
};
};
};
}
+1 -1
View File
@@ -32,7 +32,7 @@ in
shellAliases = { shellAliases = {
la = "lsd -lah"; la = "lsd -lah";
ls = "lsd"; ls = "lsd";
svim = "sudoedit"; svim = "doasedit";
nf = "fastfetch"; nf = "fastfetch";
}; };
interactiveShellInit = lib.mkBefore '' interactiveShellInit = lib.mkBefore ''
+1 -1
View File
@@ -53,7 +53,7 @@ symbol = " "
symbol = " " symbol = " "
[git_commit] [git_commit]
tag_symbol = "" tag_symbol = ''
[golang] [golang]
symbol = " " symbol = " "
+2 -1
View File
@@ -17,7 +17,8 @@ in
enable = true; enable = true;
settings = lib.recursiveUpdate (with builtins; fromTOML (readFile ./starship-preset.toml)) { settings = lib.recursiveUpdate (with builtins; fromTOML (readFile ./starship-preset.toml)) {
add_newline = false; add_newline = false;
scan_timeout = 1500; command_timeout = 2000;
nix_shell.disabled = true;
format = format =
let let
dedupDollar = dedupDollar =
+1 -1
View File
@@ -51,7 +51,7 @@ in
}; };
shellAliases = { shellAliases = {
ls = "lsd"; ls = "lsd";
svim = "sudoedit"; svim = "doasedit";
nf = "fastfetch"; nf = "fastfetch";
}; };
}; };
-3
View File
@@ -17,9 +17,6 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.persist.homeDirs = [
".config/jj"
];
my.hm = { my.hm = {
programs.jujutsu = { programs.jujutsu = {
enable = true; enable = true;
-51
View File
@@ -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"
];
};
};
}
-1
View File
@@ -11,7 +11,6 @@ in
my.coding = { my.coding = {
editor.all.enable = true; editor.all.enable = true;
langs.all.enable = true; langs.all.enable = true;
agents.enable = true;
misc.enable = true; misc.enable = true;
}; };
}; };
+2 -2
View File
@@ -10,8 +10,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.coding.editor = { my.coding.editor = {
neovim.enable = true; neovim.enable = true;
vscode.enable = false; vscode.enable = true;
zed.enable = false; zed.enable = true;
}; };
}; };
} }
+2 -30
View File
@@ -7,7 +7,6 @@
}: }:
let let
cfg = config.my.coding.editor.neovim; cfg = config.my.coding.editor.neovim;
desktop = [ "nvim.desktop" ];
in in
{ {
options.my.coding.editor.neovim = { options.my.coding.editor.neovim = {
@@ -15,8 +14,6 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# workaround
environment.sessionVariables.EDITOR = "nvim";
my.hm = { my.hm = {
xdg.configFile."nvim".source = impure.mkImpureLink ./nvim; xdg.configFile."nvim".source = impure.mkImpureLink ./nvim;
programs.neovim = { programs.neovim = {
@@ -25,45 +22,20 @@ in
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
vimdiffAlias = true; vimdiffAlias = true;
withPython3 = false;
withRuby = false;
sideloadInitLua = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
# treesitter gcc # treesitter
tree-sitter
gnutar
curl
gcc
ripgrep # telescope ripgrep # telescope
# language servers
vscode-json-languageserver vscode-json-languageserver
vscode-langservers-extracted vscode-langservers-extracted
taplo
typos-lsp typos-lsp
# render-markdown.nvim
python3Packages.pylatexenc
]; ];
}; };
}; };
my.persist.homeDirs = [ my.persist.homeDirs = [
".local/share/nvim" ".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,44 @@
{ {
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" }, "LuaSnip": { "branch": "master", "commit": "de10d8414235b0a8cabfeba60d07c24304e71f5c" },
"blink.cmp": { "branch": "main", "commit": "3db7326f54b73df4789e0fd6274bedda33975fea" }, "blink.cmp": { "branch": "main", "commit": "f9e855c4d96e1264f7c818844f5a0166ad48c212" },
"blink.lib": { "branch": "main", "commit": "b127d48bf8e9ac9cf41f6e0fbead317503f76558" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "25050e4ed39e628282831d4cbecb1850454ce915" }, "gitsigns.nvim": { "branch": "main", "commit": "c7d37ca22b461f64e26f8f6701b2586128ed0bef" },
"glance.nvim": { "branch": "master", "commit": "bf86d8b79dce808e65fdb6e9269d0b4ed6d2eefc" }, "glance.nvim": { "branch": "master", "commit": "bf86d8b79dce808e65fdb6e9269d0b4ed6d2eefc" },
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
"hunk.nvim": { "branch": "master", "commit": "c8a8e7b6973576f63e5bf39aa8338d7f37f4dc53" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, "inlay-hints.nvim": { "branch": "master", "commit": "990e1f96699b8293b6665b9e73b16128c66684e6" },
"inlay-hints.nvim": { "branch": "master", "commit": "297a65ab9543eb0850c1a55df4bb89e22cfec504" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, "leap.nvim": { "branch": "main", "commit": "02bf52e49c72cc5dabb53ec9494d10d304f0b2c9" },
"leap.nvim": { "branch": "main", "commit": "d3641f9aa86e7460b14d9f4479e7454f88cc6b2d" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" }, "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, "mini.nvim": { "branch": "main", "commit": "8c40d95931cbe6138391af9180e59439ed2e69df" },
"mini.nvim": { "branch": "main", "commit": "b2ac6522f7a54b475d9fad711b938eefc6d3d0a6" }, "neo-tree.nvim": { "branch": "main", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
"neo-tree.nvim": { "branch": "main", "commit": "83e7a2982fd12b9c3d35bc39dd5877cd91a02a61" }, "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-lspconfig": { "branch": "master", "commit": "229b79051b380377664edc4cbd534930154921a1" }, "nvim-lspconfig": { "branch": "master", "commit": "276ce3bc878243dc63c32b75790c4296d11848f6" },
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, "nvim-notify": { "branch": "master", "commit": "397c7c1184745fca649e5104de659e6392ef5a4d" },
"nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" },
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" }, "nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
"nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, "nvim-web-devicons": { "branch": "master", "commit": "3362099de3368aa620a8105b19ed04c2053e38c0" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "outline.nvim": { "branch": "main", "commit": "0eb9289ab39c91caf8b3ed0e3a17764809d69558" },
"outline.nvim": { "branch": "main", "commit": "2a132953b944561d45b52e4541ebfff71934a742" }, "pest.vim": { "branch": "master", "commit": "7cfcb43f824e74d13dfe631359fff2ec23836a77" },
"pest.vim": { "branch": "master", "commit": "60cae7ea1beb644ed40081a3ec213ea9061aba09" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "97bf4b8ef9298644a29fcd9dd41a0210cf08cac7" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "a798325b7f36acc62741d1029930a7b96d4dd4bf" }, "render-markdown.nvim": { "branch": "main", "commit": "3da7bb459f6cff03980dd1e106c46f3e62ff4d9f" },
"registers": { "branch": "main", "commit": "c217f8f369e0886776cda6c94eab839b30a8940d" }, "ripgrep": { "branch": "master", "commit": "119a58a400ea948c2d2b0cd4ec58361e74478641" },
"render-markdown.nvim": { "branch": "main", "commit": "5adf0895310c1904e5abfaad40a2baad7fe44a07" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"ripgrep": { "branch": "master", "commit": "82313cf95849bfe425109ad9506a52154879b1b1" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"telescope.nvim": { "branch": "master", "commit": "7d324792b7943e4aa16ad007212e6acc6f9fe335" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "tree-sitter-nu": { "branch": "main", "commit": "6544c4383643cf8608d50def2247a7af8314e148" },
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "vim-floaterm": { "branch": "master", "commit": "fd4bdd66eca56c6cc59f2119e4447496d8cde2ea" },
"vim-floaterm": { "branch": "master", "commit": "bb4ba7952e906408e1f83b215f55ffe57efcade6" }, "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" },
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" } "workspace-diagnostics.nvim": { "branch": "main", "commit": "60f9175b2501ae3f8b1aba9719c0df8827610c8e" }
} }
@@ -24,6 +24,7 @@ keymap.set("i", "<pageup>", string.rep("<up>", 9), opt)
keymap.set("i", "<pagedown>", string.rep("<down>", 9), opt) keymap.set("i", "<pagedown>", string.rep("<down>", 9), opt)
keymap.set("n", "<leader>ww", ":w<CR>", 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>qq", ":q<CR>", opt)
keymap.set("n", "<leader>qa", ":qa<CR>", opt) keymap.set("n", "<leader>qa", ":qa<CR>", opt)
keymap.set("n", "<leader>c", function() keymap.set("n", "<leader>c", function()
@@ -6,7 +6,6 @@ opt.shiftwidth = 4
opt.softtabstop = 4 opt.softtabstop = 4
opt.expandtab = true opt.expandtab = true
opt.autoindent = true opt.autoindent = true
opt.smartindent = true
-- Linenumber setting -- Linenumber setting
opt.number = true opt.number = true
@@ -23,7 +22,6 @@ opt.smartcase = true
opt.termguicolors = true opt.termguicolors = true
opt.signcolumn = "yes" opt.signcolumn = "yes"
opt.colorcolumn = "110" opt.colorcolumn = "110"
opt.textwidth = 110
opt.scrolloff = 8 opt.scrolloff = 8
opt.sidescrolloff = 8 opt.sidescrolloff = 8
@@ -34,8 +32,6 @@ opt.completeopt = ""
opt.exrc = true opt.exrc = true
opt.conceallevel = 2
opt.autoread = true opt.autoread = true
vim.g.autoread = true vim.g.autoread = true
@@ -80,10 +80,8 @@ local servers = {
html = {}, html = {},
java_language_server = {}, java_language_server = {},
jsonls = {}, jsonls = {},
pyrefly = {}, pyright = {},
ruff = {}, taplo = {},
-- taplo = {},
tombi = {},
ts_ls = {}, ts_ls = {},
typos_lsp = {}, typos_lsp = {},
-- keep-sorted end -- keep-sorted end
@@ -21,7 +21,7 @@ local plugins = {
}, },
{ {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
dependencies = { { "nvim-tree/nvim-web-devicons" } }, dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } },
config = function() config = function()
require("lualine").setup(require("plugins.lualine")) require("lualine").setup(require("plugins.lualine"))
end, end,
@@ -81,26 +81,25 @@ local plugins = {
}, },
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
branch = "main",
dependencies = { dependencies = {
{
branch = "main",
"nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/nvim-treesitter-textobjects",
}, "nushell/tree-sitter-nu",
}, },
config = function() config = function()
require("nvim-treesitter").setup(require("plugins.treesitter")) require("nvim-treesitter.configs").setup(require("plugins.treesitter"))
end, end,
build = ":TSUpdate", build = ":TSUpdate",
}, },
{ {
url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim", url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
event = "VeryLazy",
config = function() config = function()
require("plugins.rainbow-delimiters") require("plugins.rainbow-delimiters")
end, end,
}, },
{ {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
event = "VeryLazy",
dependencies = { "https://gitlab.com/HiPhish/rainbow-delimiters.nvim" }, dependencies = { "https://gitlab.com/HiPhish/rainbow-delimiters.nvim" },
config = function() config = function()
require("ibl").setup(require("plugins.indent-blankline")) require("ibl").setup(require("plugins.indent-blankline"))
@@ -108,11 +107,13 @@ local plugins = {
}, },
{ {
"norcalli/nvim-colorizer.lua", "norcalli/nvim-colorizer.lua",
event = "VeryLazy",
opt = {}, opt = {},
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
dependencies = { "saghen/blink.cmp" }, dependencies = { "saghen/blink.cmp" },
event = "VeryLazy",
config = function() config = function()
require("plugins.lsp.lspconfig") require("plugins.lsp.lspconfig")
require("plugins.lsp.others") require("plugins.lsp.others")
@@ -174,11 +175,12 @@ local plugins = {
}, },
{ {
"saghen/blink.cmp", "saghen/blink.cmp",
event = "VeryLazy",
dependencies = { dependencies = {
{ {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
event = "InsertEnter", event = "InsertEnter",
dependencies = { { "rafamadriz/friendly-snippets" } }, dependencies = { { "rafamadriz/friendly-snippets", lazy = true } },
build = "make install_jsregexp", build = "make install_jsregexp",
config = function() config = function()
require("luasnip").setup(require("plugins.cmp.luasnip")) require("luasnip").setup(require("plugins.cmp.luasnip"))
@@ -193,7 +195,6 @@ local plugins = {
}, },
}, },
}, },
"saghen/blink.lib",
}, },
config = function() config = function()
require("blink.cmp").setup(require("plugins.cmp.cmp")) require("blink.cmp").setup(require("plugins.cmp.cmp"))
@@ -201,6 +202,7 @@ local plugins = {
}, },
{ {
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
event = "VeryLazy",
opts = {}, opts = {},
}, },
{ {
@@ -216,6 +218,7 @@ local plugins = {
}, },
{ {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
event = "VeryLazy",
config = function() config = function()
require("gitsigns").setup(require("plugins.gitsigns")) require("gitsigns").setup(require("plugins.gitsigns"))
end, end,
@@ -254,7 +257,6 @@ local plugins = {
dependencies = { "tpope/vim-repeat" }, dependencies = { "tpope/vim-repeat" },
config = function() config = function()
vim.keymap.set({ "n", "x", "o" }, "s", "<Plug>(leap)") 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)") vim.keymap.set("n", "S", "<Plug>(leap-from-window)")
-- Exclude whitespace and the middle of alphabetic words from preview: -- Exclude whitespace and the middle of alphabetic words from preview:
-- foobar[baaz] = quux -- foobar[baaz] = quux
@@ -267,31 +269,20 @@ local plugins = {
}, },
{ {
"alexghergh/nvim-tmux-navigation", "alexghergh/nvim-tmux-navigation",
event = "VeryLazy",
config = function() config = function()
require("nvim-tmux-navigation").setup(require("plugins.tmuxnav")) require("nvim-tmux-navigation").setup(require("plugins.tmuxnav"))
end, end,
}, },
{ {
"MeanderingProgrammer/render-markdown.nvim", "MeanderingProgrammer/render-markdown.nvim",
dependencies = { dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
event = "BufEnter *.md", event = "BufEnter *.md",
--- @type render.md.UserConfig opts = {},
opts = {
completions = {
blink = {
enabled = true,
},
lsp = {
enabled = true,
},
},
},
}, },
{ {
"folke/noice.nvim", "folke/noice.nvim",
event = "VeryLazy",
dependencies = { dependencies = {
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
@@ -306,14 +297,31 @@ local plugins = {
}, },
{ {
"voldikss/vim-floaterm", "voldikss/vim-floaterm",
event = "VeryLazy",
config = function() config = function()
require("plugins.floaterm") require("plugins.floaterm")
end, end,
}, },
{ {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
event = "VeryLazy",
opts = {}, 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", "pest-parser/pest.vim",
ft = "pest", ft = "pest",
@@ -322,56 +330,9 @@ local plugins = {
{ {
"nmac427/guess-indent.nvim", "nmac427/guess-indent.nvim",
event = "VeryLazy",
opts = {}, 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, {}) require("lazy").setup(plugins, {})
@@ -1,15 +1,21 @@
--- @type TSConfig --- @type TSConfig
M = { 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", { vim.filetype.add({
callback = function() pattern = {
-- Enable treesitter highlighting and disable regex syntax [".*/hypr/.*%.conf"] = "hyprlang",
pcall(vim.treesitter.start) [".*%.hl"] = "hyprlang",
-- Enable treesitter-based indentation },
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
}) })
return M return M
+5 -2
View File
@@ -1,6 +1,7 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: }:
let let
@@ -13,12 +14,14 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.hm = { my.hm = {
programs.vscodium.enable = true; programs.vscode = {
enable = true;
package = pkgs.vscodium-wayland;
};
}; };
my.persist.homeDirs = [ my.persist.homeDirs = [
".config/VSCodium" ".config/VSCodium"
".vscode-oss" ".vscode-oss"
".vscode-oss-shared"
]; ];
}; };
} }
+2 -2
View File
@@ -15,9 +15,9 @@ in
python.enable = true; python.enable = true;
rust.enable = true; rust.enable = true;
lua.enable = true; lua.enable = true;
java.enable = false; java.enable = true;
qml.enable = true;
typst.enable = true; typst.enable = true;
toml.enable = true;
}; };
}; };
} }
-2
View File
@@ -18,8 +18,6 @@ in
(lib.hiPrio clang) (lib.hiPrio clang)
clang-tools clang-tools
cmake cmake
ninja
meson
]; ];
}; };
} }
+1 -1
View File
@@ -16,7 +16,7 @@ in
my.hm.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
go go
gotools gotools
(lib.hiPrio gopls) gopls
]; ];
my.persist.homeDirs = [ my.persist.homeDirs = [
"go" "go"
+2 -1
View File
@@ -19,7 +19,8 @@ in
pnpm pnpm
typescript typescript
typescript-language-server nodePackages.typescript-language-server
vue-language-server
biome biome
]; ];
+2 -8
View File
@@ -14,15 +14,9 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.hm.home.packages = with pkgs; [ my.hm.home.packages = with pkgs; [
(python3.withPackages ( python3
ps: with ps; [
tomli
tomli-w
]
))
uv uv
pyrefly pyright
ruff
]; ];
}; };
} }
+20
View File
@@ -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
];
};
}
+1 -1
View File
@@ -23,7 +23,7 @@ in
"rustfmt" "rustfmt"
"rust-analyzer" "rust-analyzer"
]) ])
stdenv.cc # linker evcxr # rust repl
pest-ide-tools pest-ide-tools
]; ];
-20
View File
@@ -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
];
};
}
-35
View File
@@ -19,52 +19,17 @@ in
gnumake gnumake
github-cli # gh 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 = { programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true;
config = { config = {
global = { global = {
warn_timeout = 0; warn_timeout = 0;
hide_env_diff = false; 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 = [ my.persist.homeDirs = [
".config/gh"
".local/share/direnv" ".local/share/direnv"
]; ];
}; };
+11 -64
View File
@@ -30,52 +30,25 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
nix-output-monitor nix-output-monitor
nh nh
nix-tree-rs
fast-nix-gc
]; ];
environment.etc = ( environment.etc = lib.mapAttrs' (name: value: {
lib.mapAttrs' (name: value: {
name = "nix/path/${name}"; name = "nix/path/${name}";
value.source = value.flake; value.source = value.flake;
}) config.nix.registry }) 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"
];
};
};
nix.settings = { nix.settings = {
experimental-features = [ experimental-features = "nix-command flakes pipe-operators";
"nix-command" substituters = [
"flakes" "https://mirrors.sjtug.sjtu.edu.cn/nix-channels/store"
"pipe-operators" "https://mirror.sjtu.edu.cn/nix-channels/store"
]; "https://mirrors.ustc.edu.cn/nix-channels/store"
substituters = lib.mkForce [ "https://nix-community.cachix.org"
"http://127.0.0.1:${toString (config.services.selector4nix.settings.server.port or 5496)}" "https://cache.garnix.io"
"https://cache.nixos.org"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"selector4nix.cachix.org-1:wovVlT07In5JCVz2tFgxPQTLpnN8hZT6P/RwfFcz3KE=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="
]; ];
download-buffer-size = 536870912; # 512 MiB download-buffer-size = 536870912; # 512 MiB
warn-dirty = false; warn-dirty = false;
@@ -119,33 +92,7 @@ in
services.angrr = { services.angrr = {
enable = true; enable = true;
settings = { settings = {
temporary-root-policies = { period = "1month";
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;
};
};
}; };
}; };
}; };
+5 -82
View File
@@ -10,35 +10,15 @@ in
{ {
options.my.persist = { options.my.persist = {
enable = lib.mkEnableOption "persist"; enable = lib.mkEnableOption "persist";
btrfs = lib.mkOption { location = 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 {
type = lib.types.str; type = lib.types.str;
default = "/nix/persist"; default = "/nix/persist";
example = lib.literalExpression '' example = lib.literalExpression ''
"/persistent" "/persistent"
''; '';
}; description = lib.mdDoc ''
}; Persistent location
} '';
);
}; };
homeDirs = lib.mkOption { homeDirs = lib.mkOption {
default = [ ]; default = [ ];
@@ -89,65 +69,8 @@ in
}; };
config = lib.mkIf cfg.enable { 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; programs.fuse.userAllowOther = true;
environment.persistence.${cfg.btrfs.mountPoint} = { environment.persistence.${cfg.location} = {
hideMounts = true; hideMounts = true;
directories = cfg.nixosDirs; directories = cfg.nixosDirs;
files = cfg.nixosFiles; files = cfg.nixosFiles;
+55 -9
View File
@@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
hostname,
username, username,
userdesc, userdesc,
secrets, secrets,
@@ -28,12 +27,10 @@ in
mutableUsers = false; mutableUsers = false;
users.${username} = { users.${username} = {
isNormalUser = true; isNormalUser = true;
uid = 1000;
description = userdesc; description = userdesc;
extraGroups = [ extraGroups = [
username username
"wheel" "wheel"
"input"
]; ];
hashedPasswordFile = lib.mkDefault config.sops.secrets.imxyy-nix-hashed-password.path; 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; users.users.root.hashedPasswordFile = lib.mkDefault config.sops.secrets.imxyy-nix-hashed-password.path;
security.sudo = { security.sudo.enable = false;
security.doas = {
enable = true; enable = true;
extraRules = [ extraRules = [
{ {
users = [ "imxyy" ]; users = [ username ];
commands = lib.singleton { noPass = true;
command = "ALL"; keepEnv = true;
options = lib.optionals (hostname == "imxyy-nix") [ "NOPASSWD" ];
};
} }
]; ];
}; };
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 = [ nix.settings.trusted-users = [
"root" "root"
+8 -10
View File
@@ -2,6 +2,7 @@
lib, lib,
config, config,
pkgs, pkgs,
username,
... ...
}: }:
let let
@@ -37,10 +38,7 @@ in
dataHome = "${homedir}/.local/share"; dataHome = "${homedir}/.local/share";
stateHome = "${homedir}/.local/state"; stateHome = "${homedir}/.local/state";
userDirs = { userDirs.enable = true;
enable = true;
setSessionVariables = true;
};
configFile."mimeapps.list".force = true; configFile."mimeapps.list".force = true;
@@ -50,12 +48,12 @@ in
}; };
}; };
gtk.gtk3.bookmarks = [ gtk.gtk3.bookmarks = [
"file://${homedir}/Documents Documents" "file://${homedir}/Documents "
"file://${homedir}/Downloads Downloads" "file://${homedir}/Downloads "
"file://${homedir}/Pictures Pictures" "file://${homedir}/Pictures "
"file://${homedir}/Videos Videos" "file://${homedir}/Videos "
"file://${homedir}/Music Music" "file://${homedir}/Music "
"file://${homedir}/workspace Workspace" "file://${homedir}/workspace "
]; ];
}; };
}; };
-1
View File
@@ -17,7 +17,6 @@ in
wm.all.enable = true; wm.all.enable = true;
style.enable = true; style.enable = true;
wine.enable = true; wine.enable = true;
obsidian.enable = true;
}; };
}; };
} }
+2 -2
View File
@@ -9,8 +9,8 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.desktop.browser = { my.desktop.browser = {
firefox.enable = false; firefox.enable = true;
chromium.enable = false; chromium.enable = true;
zen.enable = true; zen.enable = true;
}; };
}; };
+1 -16
View File
@@ -1,8 +1,4 @@
{ lib, config, ... }: { lib, ... }:
let
cfg = config.my.desktop.browser.default;
desktop = [ cfg.desktop ];
in
{ {
options.my.desktop.browser.default = { options.my.desktop.browser.default = {
command = lib.mkOption { command = lib.mkOption {
@@ -14,15 +10,4 @@ in
default = "zen-beta.desktop"; 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;
};
};
} }
+2 -5
View File
@@ -8,12 +8,9 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.hm.programs.firefox = { my.hm.programs.firefox.enable = true;
enable = true;
configPath = "${config.my.hm.xdg.configHome}/mozilla/firefox";
};
my.persist.homeDirs = [ my.persist.homeDirs = [
".config/mozilla" ".mozilla"
]; ];
}; };
} }
+2
View File
@@ -2,6 +2,7 @@
config, config,
lib, lib,
pkgs, pkgs,
hostname,
... ...
}: }:
let let
@@ -16,6 +17,7 @@ in
my.hm.programs.zen-browser = { my.hm.programs.zen-browser = {
enable = true; enable = true;
nativeMessagingHosts = [ pkgs.firefoxpwa ]; nativeMessagingHosts = [ pkgs.firefoxpwa ];
suppressXdgMigrationWarning = hostname == "imxyy-nix";
policies = { policies = {
# find more options here: https://mozilla.github.io/policy-templates/ # find more options here: https://mozilla.github.io/policy-templates/
DisableAppUpdate = true; DisableAppUpdate = true;
-1
View File
@@ -20,7 +20,6 @@ in
my.persist.homeDirs = [ my.persist.homeDirs = [
".minecraft" ".minecraft"
".local/share/hmcl" ".local/share/hmcl"
".hmcl"
]; ];
}; };
} }
+1 -3
View File
@@ -15,12 +15,10 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.steam = { programs.steam = {
enable = true; enable = true;
package = pkgs.steam;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
gamescope gamescope
]; ];
extraCompatPackages = with pkgs; [
proton-ge-bin
];
}; };
my.persist.homeDirs = [ my.persist.homeDirs = [
".local/share/Steam" ".local/share/Steam"
+3 -4
View File
@@ -9,14 +9,13 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.desktop.media = { my.desktop.media = {
cine.enable = true;
mpv.enable = true; mpv.enable = true;
loupe.enable = true; loupe.enable = true;
thunderbird.enable = true; thunderbird.enable = true;
vlc.enable = false; vlc.enable = true;
splayer.enable = true; splayer.enable = true;
spotify.enable = false; spotify.enable = true;
spotube.enable = false; spotube.enable = true;
}; };
}; };
} }
-23
View File
@@ -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;
};
};
}
-8
View File
@@ -6,7 +6,6 @@
}: }:
let let
cfg = config.my.desktop.media.loupe; cfg = config.my.desktop.media.loupe;
desktop = [ "org.gnome.Loupe.desktop" ];
in in
{ {
options.my.desktop.media.loupe = { options.my.desktop.media.loupe = {
@@ -15,12 +14,5 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.hm.home.packages = [ pkgs.loupe ]; my.hm.home.packages = [ pkgs.loupe ];
my.xdg.defaultApplications = {
"image/*" = desktop;
"image/gif" = desktop;
"image/jpeg" = desktop;
"image/png" = desktop;
"image/webp" = desktop;
};
}; };
} }
+2 -4
View File
@@ -13,11 +13,9 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.hm.home.packages = [ my.hm.home.packages = [ pkgs.splayer ];
pkgs.splayer-next
];
my.persist.homeDirs = [ my.persist.homeDirs = [
".config/SPlayer-Next" ".config/SPlayer"
]; ];
}; };
} }
-23
View File
@@ -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"
];
};
}
+1 -1
View File
@@ -9,7 +9,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.desktop.screencast = { my.desktop.screencast = {
obs-studio.enable = false; obs-studio.enable = true;
}; };
}; };
} }
+27 -20
View File
@@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
impure,
... ...
}: }:
let let
@@ -14,12 +13,30 @@ in
}; };
config = lib.mkIf cfg.enable { 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 = { my.hm = {
stylix = { stylix = {
enable = true; enable = true;
autoEnable = false; autoEnable = false;
base16Scheme = ./tokyonight-storm.yaml; base16Scheme = ./tokyonight-storm.yaml;
polarity = "dark"; polarity = "dark";
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
icons = { icons = {
enable = true; enable = true;
package = pkgs.papirus-icon-theme; package = pkgs.papirus-icon-theme;
@@ -27,14 +44,6 @@ in
light = "Papirus-Light"; 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
gtk = { gtk = {
@@ -61,7 +70,6 @@ in
}; };
}; };
gtk4 = { gtk4 = {
theme = null;
extraConfig = { extraConfig = {
gtk-decoration-layout = ":none"; gtk-decoration-layout = ":none";
gtk-application-prefer-dark-theme = 1; gtk-application-prefer-dark-theme = 1;
@@ -72,21 +80,20 @@ in
#QT #QT
qt = { qt = {
enable = true; enable = true;
platformTheme.name = "kde"; style.package = with pkgs; [
style = { darkly-qt5
package = with pkgs; [
darkly-qt6 darkly-qt6
]; ];
name = "Darkly"; platformTheme.name = "qtct";
};
}; };
xdg.configFile = { xdg.configFile = {
kdeglobals.source = impure.mkImpureLink ./kdeglobals; "qt5ct/qt5ct.conf".source = pkgs.replaceVars ./qtct/qt5ct.conf {
plasmarc.text = '' darker = pkgs.libsForQt5.qt5ct + /share/qt5ct/colors/darker.conf;
[Theme] };
name=darkly "qt6ct/qt6ct.conf".source = pkgs.replaceVars ./qtct/qt6ct.conf {
''; darker = pkgs.qt6Packages.qt6ct + /share/qt6ct/colors/darker.conf;
};
}; };
}; };
}; };
-140
View File
@@ -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 # Default colors
[colors.primary] [colors.primary]
background = "#24283b" background = '#24283b'
foreground = "#c0caf5" foreground = '#c0caf5'
[colors.cursor] [colors.cursor]
cursor = "#c0caf5" cursor = '#c0caf5'
text = "#24283b" text = '#24283b'
[colors.selection] [colors.selection]
text = "#c0caf5" text = '#c0caf5'
background = "#2e3c64" background = '#2e3c64'
# Normal colors # Normal colors
[colors.normal] [colors.normal]
black = "#1d202f" black = '#1d202f'
red = "#f7768e" red = '#f7768e'
green = "#9ece6a" green = '#9ece6a'
yellow = "#e0af68" yellow = '#e0af68'
blue = "#7aa2f7" blue = '#7aa2f7'
magenta = "#bb9af7" magenta = '#bb9af7'
cyan = "#7dcfff" cyan = '#7dcfff'
white = "#a9b1d6" white = '#a9b1d6'
# Bright colors # Bright colors
[colors.bright] [colors.bright]
black = "#414868" black = '#414868'
red = "#ff899d" red = '#ff899d'
green = "#9fe044" green = '#9fe044'
yellow = "#faba4a" yellow = '#faba4a'
blue = "#8db0ff" blue = '#8db0ff'
magenta = "#c7a9ff" magenta = '#c7a9ff'
cyan = "#a4daff" cyan = '#a4daff'
white = "#c0caf5" white = '#c0caf5'
# Indexed Colors # Indexed Colors
[[colors.indexed_colors]] [[colors.indexed_colors]]
index = 16 index = 16
color = "#ff9e64" color = '#ff9e64'
[[colors.indexed_colors]] [[colors.indexed_colors]]
index = 17 index = 17
color = "#db4b4b" color = '#db4b4b'
+3 -3
View File
@@ -9,10 +9,10 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
my.desktop.terminal = { my.desktop.terminal = {
alacritty.enable = false; alacritty.enable = true;
foot.enable = false; foot.enable = true;
kitty.enable = true; kitty.enable = true;
ghostty.enable = false; ghostty.enable = true;
}; };
}; };
} }
-13
View File
@@ -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";
};
};
}
+307 -26
View File
@@ -3,29 +3,119 @@
lib, lib,
pkgs, pkgs,
assets, assets,
impure,
... ...
}: }:
let let
niriCfg = config.my.hm.wayland.windowManager.niri; settings = config.my.hm.programs.niri.settings;
in in
{ {
config = lib.mkIf config.my.desktop.wm.niri.enable { config = lib.mkIf config.my.desktop.wm.niri.enable {
my.hm = { my.hm.programs.niri.settings = {
xdg.configFile."niri".source = impure.mkImpureLink ./config; input = {
xdg.configFile."niri-generated.kdl".text = niriCfg.finalConfig; focus-follows-mouse = {
enable = true;
max-scroll-amount = "0%";
};
workspace-auto-back-and-forth = true;
};
layout = {
gaps = 23;
center-focused-column = "on-overflow";
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";
tab-indicator = {
width = 10;
place-within-column = true;
};
};
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"; environment.NIXOS_OZONE_WL = "1";
spawn-at-startup = lib.mkBefore [ spawn-at-startup = lib.mkBefore (
map (c: { command = c; }) [
( (
[ [
"dbus-update-activation-environment" "dbus-update-activation-environment"
"--systemd" "--systemd"
] ]
++ (builtins.attrNames niriCfg.settings.environment) ++ builtins.attrNames settings.environment
) )
[ [
"${lib.getExe pkgs.swaybg}" "${lib.getExe pkgs.swaybg}"
"-m" "-m"
@@ -49,28 +139,219 @@ in
"cliphist" "cliphist"
"store" "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".action.spawn = [
"Mod+Return".spawn = [ config.my.desktop.terminal.default.command ]; "kitty"
} "-1"
(builtins.listToAttrs ( ];
map (n: { "Mod+G".action.spawn = [ config.my.desktop.browser.default.command ];
name = "Mod+${toString n}"; "Mod+E".action.spawn = [ "nautilus" ];
value.focus-workspace = n; "Mod+R".action.spawn = noctalia "launcher toggle";
}) (lib.range 0 9) "Mod+V".action.spawn = noctalia "launcher clipboard";
)) "Mod+W".action.spawn = noctalia "launcher windows";
(builtins.listToAttrs (
map (n: { "XF86AudioRaiseVolume" = {
name = "Mod+Shift+${toString n}"; allow-when-locked = true;
value.move-column-to-workspace = n; action.spawn = [
}) (lib.range 0 9) "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+T".action = toggle-column-tabbed-display;
"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)
);
}; };
}; };
} }
-89
View File
@@ -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; }
}
-84
View File
@@ -1,84 +0,0 @@
include "~/.config/niri-generated.kdl"
include "rules.kdl"
include "binds.kdl"
input {
focus-follows-mouse max-scroll-amount="0%"
workspace-auto-back-and-forth
}
layout {
gaps 23
center-focused-column "on-overflow"
always-center-single-column
focus-ring {
off
}
border {
on
width 4
inactive-color "#2e2e3eee"
active-gradient from="#6186d6ee" to="#cba6f7ee" angle=180 relative-to="workspace-view"
}
insert-hint {
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"
tab-indicator {
width 10
place-within-column
}
}
gestures {
hot-corners {
off
}
}
prefer-no-csd
hotkey-overlay {
skip-at-startup
}
clipboard {
disable-primary
}
blur {
passes 3
offset 4
noise 0.02
saturation 1.5
}
overview {
workspace-shadow {
off
}
}
animations {
on
slowdown 1.5
workspace-switch {
spring damping-ratio=1.0 stiffness=1000 epsilon=0.0001
}
}
-38
View File
@@ -1,38 +0,0 @@
layer-rule {
match namespace="^wallpaper$"
place-within-backdrop true
}
window-rule {
draw-border-with-background false
geometry-corner-radius 14.000000 14.000000 14.000000 14.000000
clip-to-geometry true
background-effect {
xray true
blur true
}
}
window-rule {
match is-floating=true
background-effect {
xray false
}
}
window-rule {
match app-id="kitty|foot|Alacritty|ghostty"
opacity 0.8
}
window-rule {
match app-id="org.gnome.Nautilus"
opacity 0.6
}
window-rule {
match app-id="org.jackhuang.hmcl.Launcher"
border {
off
}
}
+171 -23
View File
@@ -2,7 +2,7 @@
lib, lib,
config, config,
pkgs, pkgs,
impure, assets,
... ...
}: }:
let let
@@ -18,17 +18,11 @@ in
programs.niri = { programs.niri = {
enable = true; enable = true;
package = pkg; package = pkg;
# We manage xdg.portal ourselves below.
withXDG = false;
}; };
services.displayManager = { services.displayManager = {
ly = { sddm = {
enable = true; enable = true;
settings = { wayland.enable = true;
animation = "matrix";
session_log = ".local/state/ly-session.log";
shell = false;
};
}; };
}; };
@@ -58,17 +52,8 @@ in
xdg-desktop-portal-gnome xdg-desktop-portal-gnome
]; ];
}; };
# Keep switch-to-configuration from stopping the running compositor systemd.user.services.niri-flake-polkit.serviceConfig.ExecStart =
# when the niri store path changes; niri-nix dropped this drop-in in lib.mkForce "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
# acccaf2202. The new binary takes effect on next login instead.
systemd.user.units."niri.service" = {
overrideStrategy = "asDropinIfExists";
text = ''
[Service]
X-StopIfChanged=false
X-RestartIfChanged=false
'';
};
services.system76-scheduler.enable = true; services.system76-scheduler.enable = true;
@@ -76,22 +61,185 @@ in
home.packages = with pkgs; [ home.packages = with pkgs; [
xwayland-satellite-unstable xwayland-satellite-unstable
wlr-randr
wl-clipboard wl-clipboard
cliphist cliphist
brightnessctl brightnessctl
mission-center nautilus
noctalia-shell
xdg-terminal-exec xdg-terminal-exec
]; ];
services.system76-scheduler-niri.enable = true; services.system76-scheduler-niri.enable = true;
programs.noctalia = { programs.noctalia-shell = {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
# modified from official Tokyo-Night theme
colors = {
mError = "#f7768e";
mOnError = "#16161e";
mOnPrimary = "#16161e";
mOnSecondary = "#16161e";
mOnSurface = "#c0caf5";
mOnSurfaceVariant = "#9aa5ce";
mOnTertiary = "#16161e";
mOutline = "#565f89";
mPrimary = "#7aa2f7";
mSecondary = "#9a9ef7";
mTertiary = "#bb9af7";
# mSecondary = "#bb9af7";
# mTertiary = "#9ece6a";
mShadow = "#15161e";
mSurface = "#1a1b26";
mSurfaceVariant = "#24283b";
};
settings = {
appLauncher = {
enableClipboardHistory = true;
useApp2Unit = true;
terminalCommand = "kitty -e";
};
audio.mprisBlacklist = [
"firefox"
"chromium"
"zen"
];
bar = {
density = "comfortable";
floating = true;
marginHorizontal = 0.5;
marginVertical = 0.5;
showCapsule = false;
widgets = {
left = [
{
id = "ControlCenter";
useDistroLogo = true;
}
{
id = "Clock";
formatHorizontal = "HH:mm MM/dd ddd";
useCustomFont = false;
usePrimaryColor = true;
}
{
id = "SystemMonitor";
showCpuTemp = false;
showCpuUsage = true;
showDiskUsage = false;
showMemoryAsPercent = false;
showMemoryUsage = true;
showNetworkStats = true;
}
{
id = "Workspace";
hideUnoccupied = false;
labelMode = "none";
}
];
center = [
{
id = "MediaMini";
hideMode = "hidden";
scrollingMode = "hover";
showAlbumArt = true;
showVisualizer = true;
visualizerType = "wave";
}
];
right = [
{
id = "NotificationHistory";
hideWhenZero = true;
showUnreadBadge = true;
}
{
id = "Tray";
drawerEnabled = false;
colorizeIcons = false;
}
{
id = "Volume";
displayMode = "onhover";
}
{
id = "Microphone";
displayMode = "onhover";
}
{
id = "Battery";
hideIfNotDetected = true;
}
];
};
};
controlCenter = {
cards = [
{
id = "profile-card";
enabled = true;
}
{
id = "shortcuts-card";
enabled = true;
}
{
id = "audio-card";
enabled = true;
}
{
id = "weather-card";
enabled = false;
}
{
id = "media-sysmon-card";
enabled = true;
}
];
position = "top_left";
shortcuts = {
left = [
{ id = "Bluetooth"; }
{ id = "Network"; }
];
right = [ { id = "Notifications"; } ];
};
};
dock.enabled = false;
general = {
avatarImage = "${assets.avatar}";
scaleRatio = 1.05;
radiusRatio = 0.8;
enableShadows = false;
telemetryEnabled = false;
};
location.weatherEnabled = false;
network.wifiEnabled = false;
notifications = {
alwaysOnTop = true;
location = "top";
};
osd = {
alwaysOnTop = true;
# enable all types
enabledTypes = [ ];
location = "top";
};
setupCompleted = true;
ui = {
# I love Jetbrains Mono
fontDefault = "Monospace";
fontFixed = "Monospace";
panelsAttachedToBar = false;
panelsOverlayLayer = true;
tooltipsEnabled = true;
};
wallpaper.enabled = false;
};
}; };
xdg.configFile."noctalia".source = impure.mkImpureLink ./noctalia;
}; };
}; };
} }
@@ -1,2 +0,0 @@
[accessibility]
ui_scale = 1
@@ -1,2 +0,0 @@
[audio]
enable_sounds = true

Some files were not shown because too many files have changed in this diff Show More