feat(g2): ok
This commit is contained in:
39
hosts/g2/hardware-configuration.nix
Normal file
39
hosts/g2/hardware-configuration.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
# 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 + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/3e260c5d-3e8c-47ad-9cad-ce3613c4e7a0";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/8956-3461";
|
||||
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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.eno2.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp2s0np0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
let
|
||||
mainCfg = config.nasp;
|
||||
hostName = ("g" + (builtins.toString mainCfg.serial));
|
||||
ipSuffix = (builtins.toString (mainCfg.serial + 100))
|
||||
ipSuffix = (builtins.toString (mainCfg.serial + 100));
|
||||
in
|
||||
{
|
||||
options.nasp = {
|
||||
@@ -14,6 +14,7 @@ in
|
||||
};
|
||||
|
||||
# inplementation
|
||||
config = {
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nix.settings.substituters = [ "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" ];
|
||||
## system config
|
||||
@@ -51,7 +52,6 @@ in
|
||||
address = "0.0.0.0";
|
||||
prefixLength = 0;
|
||||
via = "192.168.16.118";
|
||||
metric = 10;
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -130,6 +130,7 @@ in
|
||||
];
|
||||
hashedPassword = "$y$j9T$Ei67I7VhQD6gF20/lNBUx0$jnrLqLNSJVCS959deKCamoOi4Q76nNeQ7/kDQCCABl1";
|
||||
};
|
||||
users.groups.nasp = {};
|
||||
security.sudo.extraConfig = ''
|
||||
%nasp ALL = (root) NOPASSWD: /usr/bin/docker
|
||||
%nasp ALL = (root) NOPASSWD: /usr/sbin/reboot
|
||||
@@ -139,4 +140,5 @@ in
|
||||
%nasp ALL = (root) NOPASSWD: /usr/sbin/ufw
|
||||
%nasp ALL = (root) NOPASSWD: /usr/sbin/ip
|
||||
'';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user