106 lines
2.0 KiB
Nix
106 lines
2.0 KiB
Nix
{ config, lib, pkgs, inputs, ... }:
|
|
|
|
{
|
|
imports =
|
|
[
|
|
./hardware-configuration.nix
|
|
inputs.sops-nix.nixosModules.sops
|
|
];
|
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
# BIOS + GRUB, 安装到 MBR
|
|
boot.loader.grub = {
|
|
enable = true;
|
|
device = "/dev/sda";
|
|
configurationLimit = 10;
|
|
};
|
|
|
|
networking.hostName = "oparic-local-dev";
|
|
|
|
# 静态 IP
|
|
networking.interfaces.ens18.ipv4.addresses = [{
|
|
address = "192.168.2.22";
|
|
prefixLength = 24;
|
|
}];
|
|
networking.defaultGateway = "192.168.2.1";
|
|
networking.nameservers = [ "119.29.29.29" ];
|
|
|
|
time.timeZone = "Asia/Shanghai";
|
|
|
|
nix.settings = {
|
|
trusted-users = [ "origami" ];
|
|
substituters = [
|
|
"https://mirrors.bfsu.edu.cn/nix-channels/store"
|
|
];
|
|
auto-optimise-store = true;
|
|
};
|
|
|
|
nix.gc = {
|
|
automatic = true;
|
|
dates = "weekly";
|
|
options = "--delete-older-than 1w";
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
git
|
|
vim
|
|
wget
|
|
curl
|
|
|
|
zip
|
|
xz
|
|
unzip
|
|
p7zip
|
|
zstd
|
|
gnutar
|
|
|
|
file
|
|
which
|
|
tree
|
|
gnused
|
|
gawk
|
|
gnupg
|
|
pciutils
|
|
usbutils
|
|
|
|
home-manager
|
|
nix-output-monitor
|
|
];
|
|
|
|
i18n = {
|
|
defaultLocale = "C.UTF-8";
|
|
extraLocaleSettings = {
|
|
LC_MESSAGES = "en_US.UTF-8";
|
|
LC_TIME = "C.UTF-8";
|
|
LC_CTYPE = "zh_CN.UTF-8";
|
|
};
|
|
};
|
|
|
|
# PVE guest agent
|
|
services.qemuGuest.enable = true;
|
|
|
|
# 用户
|
|
programs.fish.enable = true;
|
|
users.groups.origami.gid = 1000;
|
|
users.users.origami = {
|
|
isNormalUser = true;
|
|
shell = pkgs.fish;
|
|
description = "Origami404";
|
|
group = "origami";
|
|
extraGroups = [ "wheel" ];
|
|
openssh.authorizedKeys.keys = [
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAZxRoweHoLfoaydPqhsLnc4EGgwTp7Uz1DZ2DG447B+ origami@fedora"
|
|
];
|
|
};
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
sops.defaultSopsFile = ../../secrets/ssh-private.yaml;
|
|
sops.defaultSopsFormat = "yaml";
|
|
sops.age.keyFile = "/home/origami/.config/sops/age/keys.txt";
|
|
|
|
services.openssh.enable = true;
|
|
|
|
system.stateVersion = "23.11";
|
|
}
|