[hosts] add oparic-local-dev

This commit is contained in:
2026-05-16 21:42:13 +08:00
parent 65f8fb639c
commit df61c211c2
4 changed files with 173 additions and 0 deletions
+23
View File
@@ -28,6 +28,13 @@
./hosts/eris/configuration.nix ./hosts/eris/configuration.nix
]; ];
}; };
"oparic-local-dev" = nixpkgs-linux.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/oparic-local-dev/configuration.nix
];
};
}; };
darwinConfigurations = { darwinConfigurations = {
@@ -73,6 +80,22 @@
}; };
}; };
"origami@oparic-local-dev" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs-linux.legacyPackages.x86_64-linux;
modules = [
{ nixpkgs.config.allowUnfreePredicate = _: true; }
inputs.sops-nix.homeManagerModules.sops
./home/hosts/oparic-local-dev.nix
];
extraSpecialArgs = {
inherit inputs;
lib = import ./home/lib/origami404.nix {
hmSource = inputs.home-manager;
npLib = nixpkgs-linux.lib;
};
};
};
"origami@hypnos" = home-manager-darwin.lib.homeManagerConfiguration { "origami@hypnos" = home-manager-darwin.lib.homeManagerConfiguration {
pkgs = nixpkgs-darwin.legacyPackages.aarch64-darwin; pkgs = nixpkgs-darwin.legacyPackages.aarch64-darwin;
modules = [ modules = [
+17
View File
@@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
{
home.homeDirectory = "/home/origami";
imports = [
../modules/common.nix
../modules/shell.nix
../modules/zsh.nix
../modules/shell-develop.nix
../modules/ssh.nix
];
programs.fish.shellAliases = {
"flake-update" = "nixos-rebuild switch --use-remote-sudo --flake ${config.home.homeDirectory}/flakes#oparic-local-dev";
};
}
+105
View File
@@ -0,0 +1,105 @@
{ 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";
}
@@ -0,0 +1,28 @@
# PVE 虚拟机, BIOS 启动, 单 ext4 硬盘
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/5cc6cc26-502d-4a00-9f7a-95fd4432a1f4";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/396a18e2-4091-4da2-ab46-9a6ef3ae6e3d";
fsType = "ext4";
};
swapDevices = [ ];
networking.useDHCP = lib.mkDefault false;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}