nix: Add host polder and refractor modules

This commit is contained in:
js0ny 2025-10-21 16:14:34 +00:00
parent 1b99070718
commit 3756bbfb45
38 changed files with 284 additions and 172 deletions

View file

@ -1,109 +0,0 @@
{
config,
pkgs,
...
}: {
security.pam.services.login.enableGnomeKeyring = true;
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "Europe/London";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
i18n = {
defaultLocale = "en_GB.UTF-8";
# extraLocales = [
# "en_GB.UTF-8/UTF-8"
# ];
extraLocaleSettings = {
# LC_CTYPE = "en_GB.UTF-8";
LC_ALL = "en_GB.UTF-8";
};
};
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Configure keymap in X11
services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound.
# services.pulseaudio.enable = true;
# OR
services.pipewire = {
enable = true;
pulse.enable = true;
};
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
environment.shellAliases = {
nrs = "sudo nixos-rebuild switch --flake ~/.dotfiles/nixcfgs";
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
# enableSSHSupport = true;
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.js0ny = {
isNormalUser = true;
extraGroups = [
"wheel"
"docker"
"libvirtd"
"dialout"
]; # Enable sudo for the user.
packages = with pkgs; [
tree
];
};
services.flatpak.enable = true;
}

View file

@ -0,0 +1,43 @@
{
config,
pkgs,
...
}: {
# Select internationalisation properties.
i18n = {
defaultLocale = "en_GB.UTF-8";
extraLocales = [
"en_GB.UTF-8/UTF-8"
];
extraLocaleSettings = {
# LC_CTYPE = "en_GB.UTF-8";
LC_ALL = "en_GB.UTF-8";
};
};
environment.shellAliases = {
nrs = "sudo nixos-rebuild switch --flake ~/.dotfiles/nixcfgs";
};
# system.copySystemConfiguration = true;
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Define a user account. Don't forget to set a password with passwd.
users.users.js0ny = {
isNormalUser = true;
extraGroups = [
"wheel"
"docker"
"libvirtd"
"dialout"
]; # Enable sudo for the user.
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJToUo2jT3qt7eHIME9e1awabZZVmtKhbxwVz9BMSM2d js0ny@zephyrus"
];
};
programs.command-not-found.enable = true;
}

View file

@ -1,13 +1,11 @@
# ~/.config/nix-config/common/packages-headless.nix
{pkgs, ...}: {
# nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
vim
wget
curl
git
tmux
wl-clipboard
nix-index
file
unzip

View file

@ -1,8 +1,7 @@
{pkgs, ...}: {
imports = [
./configuration.nix
./packages.nix
./fonts.nix
./rime.nix
./core/configuration.nix
./core/packages.nix
];
}

View file

@ -0,0 +1,51 @@
{...}: {
imports = [
../rime.nix
../fonts.nix
];
services.pipewire = {
enable = true;
pulse.enable = true;
};
# Set your time zone.
time.timeZone = "Europe/London";
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Configure keymap in X11
services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
security.pam.services.login.enableGnomeKeyring = true;
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
};
environment.systemPackages = with pkgs; [
wl-clipboard
];
}

View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
powertop
];
}

View file

@ -1,25 +0,0 @@
{pkgs, ...}: {
users.users.guest = {
isNormalUser = true;
description = "Guest user";
home = "/home/guest";
extraGroups = [""]; # 可选,是否允许 sudo
shell = pkgs.bash;
# hashedPassword = ""; # 空密码,意味着需要手动设置或禁用登录
# 或者直接禁止密码登录:
hashedPassword = null;
};
systemd.services."guest-reset-home" = {
description = "Reset guest home directory on boot";
wantedBy = ["multi-user.target"];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
rm -rf /home/guest/*
cp -r /etc/skel/. /home/guest/
chown -R guest:guest /home/guest
'';
};
};
}

View file

@ -1,11 +0,0 @@
# ~/.config/nix-config/common/packages-headless.nix
{ pkgs, ... }:
{
# nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
powertop
];
}

View file

@ -1,6 +1,5 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
chromium
nil
nixd
libnotify