add host Remilia

This commit is contained in:
2021-05-31 02:48:14 +05:30
parent 8952fafe65
commit 02fa695a0f
25 changed files with 98 additions and 32 deletions

1
hosts/personal/README.md Normal file
View File

@@ -0,0 +1 @@
Satori is my home laptop

34
hosts/personal/boot.nix Normal file
View File

@@ -0,0 +1,34 @@
{lib, config, pkgs, ... }:
{
boot = {
kernelPackages = pkgs.linuxPackagesFor (pkgs.linux_zen.override {
structuredExtraConfig = with lib.kernel; {
CONFIG_SCHED_MUQSS = yes;
};
ignoreConfigErrors = true;
});
initrd={
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod"];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel"];
extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
enable = true;
useOSProber = true;
efiSupport = true;
device = "nodev";
splashImage = ./cirno.png;
splashMode = "stretch";
configurationName = "nixbruh";
};
};
kernelParams = [ "nvidia-drm.modeset=1" "intel_pstate=active"];
};
}

BIN
hosts/personal/cirno.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -0,0 +1,51 @@
{ config, lib, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4c02ddf5-d00e-4d84-856f-c327ae44d047";
fsType = "btrfs";
options = ["compress-force=zstd:2"];
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/58B1-4631";
fsType = "vfat";
};
fileSystems."/home" =
{ device = "/dev/nvme0n1p6";
fsType = "ext4";
};
fileSystems."/mnt/Stuff" =
{ device = "/dev/sda2";
fsType = "ntfs";
options = ["uid=natto" "gid=users" "umask=0022" "rw"];
};
fileSystems."/mnt/Games" =
{ device = "/dev/sda4";
fsType = "ntfs";
options = ["uid=natto" "gid=users" "umask=0022" "rw"];
};
fileSystems."/mnt/Extra" =
{ device = "/dev/sda3";
fsType = "ntfs";
options = ["uid=natto" "gid=users" "umask=0022" "rw"];
};
fileSystems."/mnt/LinuxGames" =
{ device = "/dev/sda5";
fsType = "btrfs";
options = ["rw" "compress-force=zstd:2"];
};
swapDevices = [ {device = "/dev/nvme0n1p7";} ];
powerManagement = {
enable = true;
cpuFreqGovernor = "powersave";
};
}

View File

@@ -0,0 +1,21 @@
{config, ... }:
{
networking = {
hostName = "Satori";
wireless.enable = true; # Enables wireless support via wpa_supplicant.
firewall.allowedTCPPorts = [ 22 ];
interfaces = {
enp7s0.useDHCP = true;
wlp0s20f3 = {
useDHCP = true;
ipv4.addresses = [ {
prefixLength = 24;
address = "192.168.0.109";
} ];
};
};
defaultGateway = "192.168.0.1";
nameservers = [ "1.1.1.1" "8.8.8.8" ];
};
}

51
hosts/personal/pkgs.nix Normal file
View File

@@ -0,0 +1,51 @@
{lib, config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
bc
gnumake
pciutils
git
ntfs3g
python3
htop
nodejs
wineWowPackages.staging
wget
ripgrep
kbd
cachix
gcc
rustc
jdk
];
programs = {
steam.enable = true;
gnupg = {
agent = {
enableSSHSupport = true;
enable = true;
pinentryFlavor = "curses";
};
};
zsh = {
enable = true;
promptInit = "PROMPT='%B%F{cyan}%~ %F{blue}%f%b'\nRPROMPT='%B%F{cyan}%n%f@%F{red}%m%b'";
histSize = 12000;
enableCompletion = true;
syntaxHighlighting.enable = true;
autosuggestions. enable = true;
ohMyZsh.enable = true;
};
dconf.enable = true;
adb.enable = true;
};
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command ca-references flakes
'';
trustedUsers = [ "root" "natto" ];
};
}

17
hosts/personal/satori.nix Normal file
View File

@@ -0,0 +1,17 @@
{ lib, config, ...}:
{
imports =
[
./satori/hardware.nix
./satori/stuff.nix
./satori/pkgs.nix
./satori/networking.nix
./satori/boot.nix
./satori/services.nix
./common/nvidia-offload.nix
./common/pipewire.nix
./common/xorg.nix
./configs/nvim.nix
];
system.stateVersion = "20.09";
}

View File

@@ -0,0 +1,38 @@
{lib, config, pkgs, ... }:
{
systemd.services.nbfc = {
description = "Notebook Fancontrol";
wantedBy = lib.mkForce [];
serviceConfig = {
Type = "forking";
Restart = "on-failure";
ExecStart = "${pkgs.mono}/bin/mono-service -l:/run/nbfc.pid -m:NbfcService /opt/nbfc/NbfcService.exe";
ExecStop = "kill -SIGTERM $(cat /run/nbfc.pid)";
PIDFile = "/run/nbfc.pid";
};
};
services = {
tor.enable = true;
logmein-hamachi.enable = true;
mysql = {
enable = true;
package = pkgs.mysql;
dataDir = "/var/db";
};
sshd.enable = true;
/* vault = {
enable = true;
storageBackend = "mysql";
storagePath = "/var/db";
};*/
};
systemd.services = {
tor.wantedBy = lib.mkForce [];
logmein-hamachi.wantedBy = lib.mkForce [];
sshd.wantedBy = lib.mkForce [];
mysql.wantedBy = lib.mkForce [];
#printing.wantedBy = lib.mkForce [];
#vault.wantedBy = lib.mkForce [];
};
}

39
hosts/personal/stuff.nix Normal file
View File

@@ -0,0 +1,39 @@
{config, agenix, pkgs, ... }:
{
time.timeZone = "Asia/Kolkata";
environment = {
sessionVariables = {
QT_X11_NO_MITSHM="1";
QT_QPA_PLATFORMTHEME = "gtk3";
};
};
security={
sudo.enable = false;
doas = {
enable = true;
extraRules = [
{
users = [ "natto" ];
keepEnv = true;
persist = true;
}
];
};
};
nix.gc = {
automatic = false;
dates = "20:15";
};
fonts.fonts = with pkgs; [
fira-mono
font-awesome
vistafonts
noto-fonts-cjk
];
users.users.natto = {
isNormalUser = true;
shell = pkgs.zsh;
home = "/home/natto";
extraGroups = [ "wheel" "adbusers" ];
};
}

15
hosts/servers/marisa.nix Executable file
View File

@@ -0,0 +1,15 @@
{lib, config, ...}:
{
imports =
[
./pkgs.nix
./stuff.nix
./marisa/networking.nix
./marisa/hardware.nix
./marisa/boot.nix
./marisa/services.nix
./marisa/cachix.nix
../../configs/nvim.nix
];
system.stateVersion = "21.05";
}

15
hosts/servers/marisa/boot.nix Executable file
View File

@@ -0,0 +1,15 @@
{config, ...}:
{
boot = {
initrd.availableKernelModules = [ "xhci_pci" "usb_storage" "usbhid" "uas" "pcie-brcmstb"];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable= true;
raspberryPi= {
version = 4;
firmwareConfig = "dtparam=sd_poll_once=on";
enable = true;
};
};
};
}

View File

@@ -0,0 +1,14 @@
# WARN: this file will get overwritten by $ cachix use <name>
{ pkgs, lib, ... }:
let
folder = ./cachix;
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in {
inherit imports;
nix.binaryCaches = ["https://cache.nixos.org/"];
}

View File

@@ -0,0 +1,12 @@
{
nix = {
binaryCaches = [
"https://rpi4.cachix.org"
];
binaryCachePublicKeys = [
"rpi4.cachix.org-1:fMaYBuIlj/Sa9YTXnXMXoXnVZEoVhnFxOkxseKKlku8="
];
};
}

View File

@@ -0,0 +1,28 @@
# 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, ... }:
{
fileSystems."/" =
{ device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
fileSystems."/nix/store" =
{ device = "/nix/store";
fsType = "none";
options = [ "bind" ];
};
swapDevices = [
{
device = "/swapfile";
priority = 0;
size = 10240;
}
];
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
hardware.firmware = [ pkgs.raspberrypiWirelessFirmware ];
}

View File

@@ -0,0 +1,22 @@
{config, ...}:
{
networking = {
hostName = "Marisa";
firewall.allowedTCPPorts = [ 22 80 ];
wireless = {
enable = false;
iwd.enable = true;
};
interfaces = {
wlan0 = {
useDHCP = false;
ipv4.addresses = [ {
prefixLength = 24;
address = "192.168.0.159";
} ];
};
};
defaultGateway = "192.168.0.1";
nameservers = [ "1.1.1.1" "8.8.8.8" ];
};
}

View File

@@ -0,0 +1,10 @@
{config, ...}:
{
services = {
openssh = {
enable = true;
permitRootLogin = "yes";
};
tailscale.enable = true;
};
}

34
hosts/servers/pkgs.nix Executable file
View File

@@ -0,0 +1,34 @@
{lib, config, pkgs, ...}:
{
environment.systemPackages = with pkgs; [
git
gnumake
htop
vim
wireguard
];
programs = {
zsh = {
enable = true;
promptInit = "PROMPT='%B%F{cyan}%~ %F{blue}>%f%b '\nRPROMPT='%B%F{cyan}%n%f@%F{red}%m%b'";
histSize = 12000;
enableCompletion = true;
syntaxHighlighting.enable = true;
autosuggestions. enable = true;
ohMyZsh.enable = true;
};
gnupg = {
agent = {
enable = true;
pinentryFlavor = "curses";
};
};
};
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command ca-references flakes
'';
trustedUsers = [ "root" ];
};
}

15
hosts/servers/remilia.nix Executable file
View File

@@ -0,0 +1,15 @@
{lib, config, ...}:
{
imports =
[
./pkgs.nix
./stuff.nix
./remilia/networking.nix
./remilia/hardware.nix
./remilia/boot.nix
./remilia/services.nix
../../configs/nvim.nix
];
programs.gnupg.agent.enable = lib.mkForce false;
system.stateVersion = "21.11";
}

13
hosts/servers/remilia/boot.nix Executable file
View File

@@ -0,0 +1,13 @@
{config, ...}:
{
boot = {
initrd.kernelModules = [ "bochs_drm" ];
initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" ];
kernelModules = [ "kvm-amd" ];
kernelParams = [ "console=ttyS0" "console=tty1" "nvme.shutdown_timeout=10" "libiscsi.debug_libiscsi_eh=1" ];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
}

View File

@@ -0,0 +1,20 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b";
fsType = "ext4";
};
swapDevices = [
{
device="/swapfile";
size = 7168;
priority = 0;
}
];
}

View File

@@ -0,0 +1,13 @@
{config, ...}:
{
networking = {
useDHCP = false;
hostName = "Remilia";
firewall.allowedTCPPorts = [ 22 80 ];
interfaces = {
ens3 = {
useDHCP = true;
};
};
};
}

View File

@@ -0,0 +1,12 @@
{config, ...}:
{
services = {
openssh = {
enable = true;
permitRootLogin = "yes";
};
};
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJHingN2Aho+KGgEvBMjtoez+W1svl9uVoa4vG0d646j"
];
}

26
hosts/servers/stuff.nix Executable file
View File

@@ -0,0 +1,26 @@
{config, pkgs, ...}:
{
time.timeZone = "Asia/Kolkata";
environment = {
sessionVariables = {
EDITOR = "vim";
};
};
security = {
sudo.enable = false;
doas = {
enable = true;
extraRules = [
{
users = [ ];
keepEnv = true;
persist = true;
}
];
};
};
documentation.enable = false;
users.extraUsers.root = {
shell = pkgs.zsh;
};
}