diff --git a/flake.nix b/flake.nix index 7b94d7b..6ab3d8b 100644 --- a/flake.nix +++ b/flake.nix @@ -146,6 +146,11 @@ hostName = "cyper-desktop"; system = "x86_64-linux"; }; + "cyper-node-1" = mkSystem { + hostName = "cyper-node-1"; + system = "x86_64-linux"; + isServer = true; + }; }; darwinConfigurations."cyper-mac" = mkSystem { diff --git a/home/packages.nix b/home/packages.nix index fca5bcf..73c64c0 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, ... }: +{ + pkgs, + lib, + isServer, + ... +}: { home = { packages = @@ -12,18 +17,14 @@ ripgrep jq yq-go - # GUI openscad fstl - # PDF Tools pandoc - # misc yt-dlp ffmpeg - # Archives zip unzip @@ -32,7 +33,6 @@ gnutar unrar sops - # Nix tools nix-index ] @@ -47,11 +47,11 @@ file which libnotify - # encryption age ssh-to-age - + ] + ++ lib.optionals (!pkgs.stdenv.isDarwin && !isServer) [ # GUI element-desktop zapzap diff --git a/hosts/cyper-node-1/configuration.nix b/hosts/cyper-node-1/configuration.nix new file mode 100644 index 0000000..efdd23a --- /dev/null +++ b/hosts/cyper-node-1/configuration.nix @@ -0,0 +1,33 @@ +{ + imports = [ ./hardware-configuration.nix ]; + + networking = { + useNetworkd = true; + useDHCP = false; + firewall.enable = true; + }; + + systemd.network = { + enable = true; + networks."10-ethernet" = { + matchConfig.Name = "enp1s0"; + networkConfig = { + Address = "192.168.2.30/24"; + Gateway = "192.168.2.1"; + DNS = "192.168.2.2"; + DHCP = "no"; + }; + }; + }; + + boot.loader = { + systemd-boot = { + enable = true; + configurationLimit = 10; + editor = false; + }; + efi.canTouchEfiVariables = true; + }; + + system.stateVersion = "26.05"; +} diff --git a/hosts/cyper-node-1/hardware-configuration.nix b/hosts/cyper-node-1/hardware-configuration.nix new file mode 100644 index 0000000..f6f9e88 --- /dev/null +++ b/hosts/cyper-node-1/hardware-configuration.nix @@ -0,0 +1,51 @@ +{ + config, + lib, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usb_storage" + "sd_mod" + ]; + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "ext4"; + }; + + "/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + }; + + swapDevices = [ + { + device = "/swapfile"; + size = 4096; + } + ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/server/default.nix b/nixos/server/default.nix new file mode 100644 index 0000000..9822ae9 --- /dev/null +++ b/nixos/server/default.nix @@ -0,0 +1,14 @@ +{ ... }: +{ + services.nginx = { + enable = true; + virtualHosts.localhost = { + locations."/" = { + return = "200 'It works'"; + extraConfig = '' + default_type text/html; + ''; + }; + }; + }; +}