Compare commits

..

12 Commits

Author SHA1 Message Date
chn
bb97d11d77 modules.packages.vscode: fix 2025-05-20 10:46:29 +08:00
chn
98de92fd76 flake: lock nix-vscode-extensions 2025-05-20 10:13:42 +08:00
chn
ad40c0457e modules.packages.vscode: add copilot-chat 2025-05-20 10:02:49 +08:00
chn
78b67438a7 modules.system.fileSystems.impermanence: mount .config/systemd 2025-05-18 13:18:25 +08:00
chn
7441e19606 modules.system.gui: remove hyprland 2025-05-18 13:14:21 +08:00
chn
fa1d0e6757 update stateVersion 2025-05-18 12:45:53 +08:00
chn
135eaf2760 doc: add 2025-05-18 12:35:14 +08:00
chn
2a04978872 modules.services.nextcloud: update 2025-05-18 12:32:05 +08:00
chn
22abe5378f doc: add 2025-05-18 12:30:30 +08:00
chn
382f74a127 modules.services.synapse: port from new nixpkgs 2025-05-18 12:29:51 +08:00
chn
0cd2c914f8 modules.services.nixvirt: add doc 2025-05-18 11:04:49 +08:00
chn
58836ecef9 modules.services.nixvirt: fix 2025-05-18 10:39:39 +08:00
14 changed files with 42 additions and 370 deletions

View File

@@ -1,8 +1,8 @@
* merge upstream, update flake
* update src
* fix all build errors
* update modules
* update postgresql nextcloud mariadb
* update modules (synapse)
* update postgresql nextcloud
* update stateVersion
* switch
* fix disabled packages

7
flake.lock generated
View File

@@ -823,15 +823,16 @@
]
},
"locked": {
"lastModified": 1746842090,
"narHash": "sha256-W/WqQ8VGZ4tlV6BAFGY6BDEc5ShAm4i3pv5c3s3YlUI=",
"lastModified": 1747382874,
"narHash": "sha256-VCFqktsjKsz5eJOCdX2mM3Uytbb7Et6MHshEpCpuWFk=",
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"rev": "5603fb6fb99f68dfc244429c79a7b706ed9a2fd7",
"rev": "4a7f92bdabb365936a8e8958948536cc2ceac7ba",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "4a7f92bdabb365936a8e8958948536cc2ceac7ba",
"repo": "nix-vscode-extensions",
"type": "github"
}

View File

@@ -13,7 +13,11 @@
sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; };
nur-xddxdd = { url = "github:xddxdd/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-vscode-extensions = { url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-vscode-extensions =
{
url = "github:nix-community/nix-vscode-extensions?ref=4a7f92bdabb365936a8e8958948536cc2ceac7ba";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:CHN-beta/impermanence";
qchem = { url = "github:Nix-QChem/NixOS-QChem/master"; inputs.nixpkgs.follows = "nixpkgs"; };
plasma-manager =

View File

@@ -18,9 +18,15 @@ inputs:
(set:
{
name = set;
value = vscode-extensions.${set} or {}
// nix-vscode-extensions.vscode-marketplace.${set}
// nix-vscode-extensions.vscode-marketplace-release.${set} or {};
value =
# provided by nixpkgs
vscode-extensions.${set} or {}
# provided by nix-vscode-extensions, including pre-release versions, but prefer stable version
// nix-vscode-extensions.vscode-marketplace.${set} or {}
// nix-vscode-extensions.vscode-marketplace-release.${set} or {}
# some versions are too high for the current vscode, use old version from here to override it
// (nix-vscode-extensions.forVSCodeVersion inputs.pkgs.vscode.version)
.vscode-marketplace-release.${set} or {};
})
(inputs.lib.unique
(
@@ -29,7 +35,7 @@ inputs:
++ (builtins.attrNames nix-vscode-extensions.vscode-marketplace-release)
)));
in with extensions;
(with github; [ copilot github-vscode-theme ])
(with github; [ copilot copilot-chat github-vscode-theme ])
++ (with intellsmi; [ comment-translate ])
++ (with ms-vscode; [ cmake-tools cpptools-extension-pack hexeditor remote-explorer ])
++ (with ms-vscode-remote; [ remote-ssh ])

View File

@@ -21,6 +21,7 @@ inputs:
dns = [ "1.1.1.1" ];
# prevent create btrfs subvol
storage-driver = "overlay2";
live-restore = true;
};
};
};

View File

@@ -16,7 +16,7 @@ inputs:
hostName = nextcloud.hostname;
appstoreEnable = false;
https = true;
package = inputs.pkgs.nextcloud30;
package = inputs.pkgs.nextcloud31;
maxUploadSize = "10G";
config =
{

View File

@@ -80,21 +80,17 @@ inputs:
(builtins.attrValues nixvirt.instance);
in lib.network.writeXML (base // { ip = base.ip // { dhcp = base.ip.dhcp // { inherit host; }; }; });
active = true;
# never restart the network
# when adding a new VM, add dhcp resolve manually, by:
# sudo virsh net-update default add ip-dhcp-host "<host mac='' ip='192.168.122.' />" --live
restart = false;
}];
pools =
[{
definition = lib.pool.writeXML
{
name = "default";
uuid = "6fc75fcc-fb95-48b6-8fa4-0e59b6c1b6c7";
type = "dir";
target.path = "/var/lib/libvirt/images";
};
active = true;
restart = false;
# do not define image here, since it still needs to be created manually
}];
# do not use it to define disk, since it is not declartive
# create disk manually, by:
# sudo qemu-img create -f raw /var/lib/libvirt/images/test.img 20G
# sudo chown qemu-libvirt:qemu-libvirt /var/lib/libvirt/images/test.img
# sudo chmod 600 /var/lib/libvirt/images/test.img
pools = [];
};
};
libvirtd.qemu.verbatimConfig =
@@ -139,7 +135,7 @@ inputs:
inherit (vm) name;
inherit (vm.value) uuid;
memory = { count = vm.value.hardware.memoryMB; unit = "MiB"; };
storage_vol = { pool = "default"; volume = "${vm.value.hardware.storage}.img"; };
storage_vol = "/var/lib/libvirt/images/${vm.value.hardware.storage}.img";
install_vol = "${inputs.topInputs.self.src.iso.netboot}";
virtio_video = false;
};

View File

@@ -1,5 +1,4 @@
# port from nixpkgs#70dc536a
# TODO: update
# port from nixpkgs#a87068b8
inputs:
{
options.nixos.services.synapse.instances = let inherit (inputs.lib) mkOption types; in mkOption
@@ -50,9 +49,11 @@ inputs:
{
description = "synapse-${instance.name}";
enable = instance.value.autoStart;
wants = [ "network-online.target" ];
after = [ "network-online.target" "postgresql.service" ];
requires = [ "network-online.target" "postgresql.service" ];
wantedBy = [ "multi-user.target" ];
environment = { LD_PRELOAD = "${inputs.pkgs.jemalloc}/lib/libjemalloc.so"; PYTHONMALLOC = "malloc"; };
serviceConfig =
{
ExecStart = "${homeserver} --config-path ${config} --keys-directory ${workdir}";

View File

@@ -50,10 +50,10 @@ inputs:
i18n = { defaultLocale = "C.UTF-8"; supportedLocales = [ "all" ]; };
users.mutableUsers = false;
virtualisation.oci-containers.backend = "docker";
home-manager.sharedModules = [{ home.stateVersion = "22.11"; }];
home-manager.sharedModules = [{ home.stateVersion = "25.05"; }];
system =
{
stateVersion = "22.11";
stateVersion = "25.05";
configurationRevision = inputs.topInputs.self.rev or "dirty";
nixos = { versionSuffix = inputs.lib.mkForce ""; tags = [ inputs.topInputs.self.config.branch ]; };
};

View File

@@ -46,10 +46,10 @@ inputs:
};
}
# 挂载更详细的目录
# 对于任何情况,`.cache` 都应该在重启后丢失
# 对于任何情况,`.cache` `.config/systemd` 都应该在重启后丢失
{
"/nix/rootfs/current".users = builtins.listToAttrs (builtins.map
(user: { name = user; value.directories = [ ".cache" ]; })
(user: { name = user; value.directories = [ ".cache" ".config/systemd" ]; })
inputs.config.nixos.user.users);
}
# 对于桌面用途的 chn有一些需要 persist 的目录

View File

@@ -28,7 +28,6 @@ inputs:
sessionVariables.GTK_USE_PORTAL = "1";
persistence."/nix/persistent".directories =
[{ directory = "/var/cache/tuigreet"; user = "greeter"; group = "greeter"; mode = "0700"; }];
systemPackages = with inputs.pkgs; [ waybar ];
};
xdg.portal.extraPortals = builtins.map (p: inputs.pkgs."xdg-desktop-portal-${p}") [ "gtk" "wlr" ];
i18n.inputMethod =
@@ -38,16 +37,7 @@ inputs:
fcitx5.addons = builtins.map (p: inputs.pkgs."fcitx5-${p}")
[ "rime" "chinese-addons" "mozc" "nord" "material-color" ];
};
programs =
{
dconf.enable = true;
# hyprland = { enable = true; withUWSM = true; };
# waybar should not be pull in by graphical-session.target
# waybar.enable = false;
# iio-hyprland.enable = true;
# hyprlock.enable = true;
# uwsm.enable = true;
};
programs.dconf.enable = true;
systemd.services.display-manager.after = [ "plymouth-quit.service" ];
# 在 chromium 中输入汉字有可能会漏字,需要这个配置
nixos.user.sharedModules = [(hmInputs: { gtk =

View File

@@ -49,7 +49,7 @@ inputs:
# lower tcp retransmission tries (5 times, about several seconds)
"net.ipv4.tcp_retries2" = 5;
};
networking.nftables = { enable = true; flushRuleset = false; };
networking.nftables.enable = true;
}
(inputs.localLib.mkConditional (networking == null)
{

View File

@@ -1,276 +0,0 @@
################
### MONITORS ###
################
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto
###################
### MY PROGRAMS ###
###################
# See https://wiki.hyprland.org/Configuring/Keywords/
# Set programs that you use
$terminal = kitty
$fileManager = dolphin
$menu = wofi --show drun
#################
### AUTOSTART ###
#################
# Autostart necessary processes (like notifications daemons, status bars, etc.)
# Or execute your favorite apps at launch like this:
# exec-once = $terminal
# exec-once = nm-applet &
# exec-once = waybar & hyprpaper & firefox
#############################
### ENVIRONMENT VARIABLES ###
#############################
# See https://wiki.hyprland.org/Configuring/Environment-variables/
env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24
#####################
### LOOK AND FEEL ###
#####################
# Refer to https://wiki.hyprland.org/Configuring/Variables/
# https://wiki.hyprland.org/Configuring/Variables/#general
general {
gaps_in = 5
gaps_out = 20
border_size = 2
# https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
# Set to true enable resizing windows by clicking and dragging on borders and gaps
resize_on_border = false
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
layout = dwindle
}
# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration {
rounding = 10
# Change transparency of focused and unfocused windows
active_opacity = 1.0
inactive_opacity = 1.0
shadow {
enabled = true
range = 4
render_power = 3
color = rgba(1a1a1aee)
}
# https://wiki.hyprland.org/Configuring/Variables/#blur
blur {
enabled = true
size = 3
passes = 1
vibrancy = 0.1696
}
}
# https://wiki.hyprland.org/Configuring/Variables/#animations
animations {
enabled = yes, please :)
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = easeOutQuint,0.23,1,0.32,1
bezier = easeInOutCubic,0.65,0.05,0.36,1
bezier = linear,0,0,1,1
bezier = almostLinear,0.5,0.5,0.75,1.0
bezier = quick,0.15,0,0.1,1
animation = global, 1, 10, default
animation = border, 1, 5.39, easeOutQuint
animation = windows, 1, 4.79, easeOutQuint
animation = windowsIn, 1, 4.1, easeOutQuint, popin 87%
animation = windowsOut, 1, 1.49, linear, popin 87%
animation = fadeIn, 1, 1.73, almostLinear
animation = fadeOut, 1, 1.46, almostLinear
animation = fade, 1, 3.03, quick
animation = layers, 1, 3.81, easeOutQuint
animation = layersIn, 1, 4, easeOutQuint, fade
animation = layersOut, 1, 1.5, linear, fade
animation = fadeLayersIn, 1, 1.79, almostLinear
animation = fadeLayersOut, 1, 1.39, almostLinear
animation = workspaces, 1, 1.94, almostLinear, fade
animation = workspacesIn, 1, 1.21, almostLinear, fade
animation = workspacesOut, 1, 1.94, almostLinear, fade
}
# Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/
# "Smart gaps" / "No gaps when only"
# uncomment all if you wish to use that.
# workspace = w[tv1], gapsout:0, gapsin:0
# workspace = f[1], gapsout:0, gapsin:0
# windowrulev2 = bordersize 0, floating:0, onworkspace:w[tv1]
# windowrulev2 = rounding 0, floating:0, onworkspace:w[tv1]
# windowrulev2 = bordersize 0, floating:0, onworkspace:f[1]
# windowrulev2 = rounding 0, floating:0, onworkspace:f[1]
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
dwindle {
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # You probably want this
}
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master {
new_status = master
}
# https://wiki.hyprland.org/Configuring/Variables/#misc
misc {
force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :(
}
#############
### INPUT ###
#############
# https://wiki.hyprland.org/Configuring/Variables/#input
input {
kb_layout = us
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
touchpad {
natural_scroll = false
}
}
# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
workspace_swipe = false
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
device {
name = epic-mouse-v1
sensitivity = -0.5
}
###################
### KEYBINDINGS ###
###################
# See https://wiki.hyprland.org/Configuring/Keywords/
$mainMod = SUPER # Sets "Windows" key as main modifier
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Q, exec, $terminal
bind = $mainMod, C, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Laptop multimedia keys for volume and LCD brightness
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+
bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%-
# Requires playerctl
bindl = , XF86AudioNext, exec, playerctl next
bindl = , XF86AudioPause, exec, playerctl play-pause
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = , XF86AudioPrev, exec, playerctl previous
##############################
### WINDOWS AND WORKSPACES ###
##############################
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# Ignore maximize requests from apps. You'll probably like this.
windowrulev2 = suppressevent maximize, class:.*
# Fix some dragging issues with XWayland
windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0

View File

@@ -1,51 +0,0 @@
inputs:
{
# config = inputs.lib.mkIf (inputs.config.nixos.packages.desktop != null)
config = inputs.lib.mkIf (false)
{
home-manager.users.chn.config =
{
programs.hyprlock =
{
enable = true;
settings =
{
general = { disable_loading_bar = true; hide_cursor = true; };
background.path = "${inputs.topInputs.nixos-wallpaper}/twitter-1884592003595592025.jpg";
input-field =
[{
# as least one entry is required even it is default
position = "0, 0";
# size = "200, 50";
# position = "0, -80";
# font_color = "rgb(202, 211, 245)";
# inner_color = "rgb(91, 96, 120)";
# outer_color = "rgb(24, 25, 38)";
# outline_thickness = 5;
# placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\';
# shadow_passes = 2;
}];
};
};
wayland.windowManager.hyprland =
{
enable = true;
settings =
{
};
extraConfig = builtins.readFile ./hyprland.conf;
systemd.enable = false;
xwayland.enable = true;
};
services.hyprpaper =
{
enable = true;
settings =
{
preload = [ "${inputs.topInputs.nixos-wallpaper}/twitter-1884592003595592025.jpg" ];
wallpaper = [ ",${inputs.topInputs.nixos-wallpaper}/twitter-1884592003595592025.jpg" ];
};
};
};
};
}