massicot: add new machine

This commit is contained in:
Xinyang Li 2023-07-29 23:34:24 +08:00
parent 8f0971ab2b
commit 42f550f156
4 changed files with 94 additions and 0 deletions

View file

@ -63,6 +63,14 @@
];
};
nixosConfigurations.massicot = mkNixos {
system = "aarch64-linux";
modules = [
machines/massicot
(mkHome "xin" "gold")
]
}
nixosConfigurations.raspite = mkNixos {
system = "aarch64-linux";
modules = [

View file

@ -0,0 +1,37 @@
{ config, libs, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
./networking.nix
];
environment.systemPackages = with pkgs; [
git
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "22.11";
networking = {
hostName = "massicot";
useDHCP = false;
};
services.openssh = {
enable = true;
};
systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
users.users.xin = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPBcSvUQnmMFtpftFKIsDqeyUyZHzRg5ewgn3VEcLnss"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIInPn+7cMbH7zCEPJArU/Ot6oq8NHo8a2rYaCfTp7zgd"
];
};
}

View file

@ -0,0 +1,36 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "virtio_scsi" "usbhid" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/934bc9cd-c80f-4af0-a446-e92c3b21ad9e";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/06F4-7777";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eth0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

View file

@ -0,0 +1,13 @@
networking = {
interfaces = {
eth0.ipv6.addresses = [{
address = "2a01:4f8:c17:345f::1";
prefixLength = 64;
}];
};
defaultGateway6 = {
address = "fe80::1";
interface = "eth0";
};
nameservers = [ "2a00:1098:2b::1" "2a00:1098:2c::1" "2a01:4f9:c010:3f02::1"]
};