This commit is contained in:
joy 2024-10-08 22:43:41 +02:00
parent e6dccb18c4
commit 4bbf906cdd
8 changed files with 58 additions and 4 deletions

View file

@ -25,6 +25,9 @@
laptop = systemConfig { laptop = systemConfig {
modules = [./hosts/laptop]; modules = [./hosts/laptop];
}; };
server = systemConfig {
modules = [./hosts/server];
};
}; };
}; };
inputs = { inputs = {

12
hosts/server/default.nix Normal file
View file

@ -0,0 +1,12 @@
{
networking.hostName = "server";
services.logind.lidSwitch = "ignore";
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
imports = [
./hardware.nix
../../modules/apps
../../modules/system
];
}

38
hosts/server/hardware.nix Normal file
View file

@ -0,0 +1,38 @@
# 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 = ["xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/e30db84a-3640-433e-9d83-b61550b82bc1";
fsType = "ext4";
};
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.wlp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wwp0s20u8c2i12.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -14,6 +14,8 @@ if echo "$hostname" | grep -q 'desktop'; then
sudo nixos-rebuild switch --flake ~/nix/#desktop sudo nixos-rebuild switch --flake ~/nix/#desktop
elif echo "$hostname" | grep -q 'laptop'; then elif echo "$hostname" | grep -q 'laptop'; then
sudo nixos-rebuild switch --flake ~/nix/#laptop sudo nixos-rebuild switch --flake ~/nix/#laptop
elif echo "$server" | grep -q 'laptop'; then
sudo nixos-rebuild switch --flake ~/nix/#server
elif echo "$hostname" | grep -q 'localhost'; then elif echo "$hostname" | grep -q 'localhost'; then
nix-on-droid switch --flake ~/nix nix-on-droid switch --flake ~/nix
fi fi

View file

@ -1,3 +1,3 @@
{ {
boot.loader.systemd-boot.enable = true; # boot.loader.systemd-boot.enable = true;
} }

View file

@ -6,7 +6,7 @@
user = "invidious"; user = "invidious";
dbname = "invidious"; dbname = "invidious";
}; };
host_binding = "0.0.0.0"; # host_binding = "0.0.0.0";
}; };
}; };
} }

View file

@ -3,7 +3,6 @@
./user ./user
./homemanger ./homemanger
./xdg ./xdg
# ./appimage
./networking ./networking
./misc ./misc
]; ];

View file

@ -2,6 +2,6 @@
users.users.joy = { users.users.joy = {
isNormalUser = true; isNormalUser = true;
description = "joy"; description = "joy";
extraGroups = ["wheel"]; extraGroups = ["wheel" "sudo"];
}; };
} }