diff --git a/flake.nix b/flake.nix index 2666c80..fca0108 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,9 @@ laptop = systemConfig { modules = [./hosts/laptop]; }; + server = systemConfig { + modules = [./hosts/server]; + }; }; }; inputs = { diff --git a/hosts/server/default.nix b/hosts/server/default.nix new file mode 100644 index 0000000..dbd773f --- /dev/null +++ b/hosts/server/default.nix @@ -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 + ]; +} diff --git a/hosts/server/hardware.nix b/hosts/server/hardware.nix new file mode 100644 index 0000000..5de40c0 --- /dev/null +++ b/hosts/server/hardware.nix @@ -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..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; +} diff --git a/modules/apps/home/zsh/scripts/rebuild.sh b/modules/apps/home/zsh/scripts/rebuild.sh index 496dfba..fec3d2f 100755 --- a/modules/apps/home/zsh/scripts/rebuild.sh +++ b/modules/apps/home/zsh/scripts/rebuild.sh @@ -14,6 +14,8 @@ if echo "$hostname" | grep -q 'desktop'; then sudo nixos-rebuild switch --flake ~/nix/#desktop elif echo "$hostname" | grep -q 'laptop'; then 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 nix-on-droid switch --flake ~/nix fi diff --git a/modules/hardware/boot/default.nix b/modules/hardware/boot/default.nix index 2f5433b..14e966f 100644 --- a/modules/hardware/boot/default.nix +++ b/modules/hardware/boot/default.nix @@ -1,3 +1,3 @@ { - boot.loader.systemd-boot.enable = true; + # boot.loader.systemd-boot.enable = true; } diff --git a/modules/services/invidious/default.nix b/modules/services/invidious/default.nix index b30fc2b..588ffb7 100644 --- a/modules/services/invidious/default.nix +++ b/modules/services/invidious/default.nix @@ -6,7 +6,7 @@ user = "invidious"; dbname = "invidious"; }; - host_binding = "0.0.0.0"; + # host_binding = "0.0.0.0"; }; }; } diff --git a/modules/system/default.nix b/modules/system/default.nix index b6cee94..6c240eb 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -3,7 +3,6 @@ ./user ./homemanger ./xdg - # ./appimage ./networking ./misc ]; diff --git a/modules/system/user/default.nix b/modules/system/user/default.nix index 77b429e..307a831 100644 --- a/modules/system/user/default.nix +++ b/modules/system/user/default.nix @@ -2,6 +2,6 @@ users.users.joy = { isNormalUser = true; description = "joy"; - extraGroups = ["wheel"]; + extraGroups = ["wheel" "sudo"]; }; }