diff --git a/flake.nix b/flake.nix index 7df8209..d477632 100644 --- a/flake.nix +++ b/flake.nix @@ -141,13 +141,11 @@ docker = nixpkgs.lib.nixosSystem { ]; }; - linode = nixpkgs.lib.nixosSystem { + linode-minimal = nixpkgs.lib.nixosSystem { inherit system; modules = [ ./hosts/linode/configuration.nix ./modules/hardware-configuration/vm/linode.nix - ./hosts/linode/disko.nix - inputs.disko.nixosModules.disko home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/hosts/linode/configuration.nix b/hosts/linode/configuration.nix index c88acdd..e478fa3 100644 --- a/hosts/linode/configuration.nix +++ b/hosts/linode/configuration.nix @@ -2,23 +2,116 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config, lib, pkgs, inputs, ... }: +{ config, lib, pkgs, ... }: { imports = [ # Include the results of the hardware scan. ../../modules/common/configuration.nix -# ../../modules/nix/cache-client.nix -# ../../modules/nix/remote-builder-client.nix - ../../modules/tailscale/enable-service.nix - ../../modules/docker/enable-service.nix ]; - networking.hostName = "linode"; # Define your hostname. + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + # boot.loader.grub.efiSupport = true; + # boot.loader.grub.efiInstallAsRemovable = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + # Define on which hard drive you want to install Grub. + # boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only + + # networking.hostName = "nixos"; # Define your hostname. + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + + # Set your time zone. + # time.timeZone = "Europe/Amsterdam"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfig = true; # use xkb.options in tty. + # }; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + + + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # services.pulseaudio.enable = true; + # OR + # services.pipewire = { + # enable = true; + # pulse.enable = true; + # }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + # users.users.alice = { + # isNormalUser = true; + # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # packages = with pkgs; [ + # tree + # ]; + # }; + + # programs.firefox.enable = true; + + # List packages installed in system profile. + # You can use https://search.nixos.org/ to find more packages (and options). + # environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + # ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + +environment.systemPackages = with pkgs; [ + inetutils + mtr + sysstat +]; + +users.users.nixos = { + isNormalUser = true; + home = "/home/nixos"; + description = "nixos"; + extraGroups = [ "wheel" "networkmanager" ]; +}; + +networking.usePredictableInterfaceNames = false; +networking.useDHCP = false; +networking.interfaces.eth0.useDHCP = true; + + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; +# settings.permitRootLogin = "yes"; +}; # Open ports in the firewall. -# networking.firewall.allowedTCPPorts = [ 80 8080 443 ]; + # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; # Or disable the firewall altogether. # networking.firewall.enable = false; @@ -44,6 +137,8 @@ # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, # and migrated your data accordingly. # - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.sta> - system.stateVersion = "25.05"; # Did you read the comment? + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "26.05"; # Did you read the comment? + } + diff --git a/hosts/linode/disko.nix b/hosts/linode/disko.nix deleted file mode 100644 index 110dba6..0000000 --- a/hosts/linode/disko.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib, ... }: - -{ - disko.devices = { - disk = { - main = { - type = "disk"; - device = "/dev/sda"; - - content = { - type = "gpt"; - - partitions = { - boot = { - size = "1M"; - type = "EF02"; - }; - - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; -} \ No newline at end of file diff --git a/hosts/nix-minimal/configuration.nix b/hosts/nix-minimal/configuration.nix index 2622600..e2e62c8 100644 --- a/hosts/nix-minimal/configuration.nix +++ b/hosts/nix-minimal/configuration.nix @@ -8,8 +8,8 @@ imports = [ # Include the results of the hardware scan. ../../modules/common/configuration.nix - ../../modules/nix/cache-client.nix - ../../modules/nix/remote-builder-client.nix + ../../modules/nix-cache/client.nix + ../../modules/remote-builder-client.nix ]; networking.hostName = "nix-minimal"; # Define your hostname. diff --git a/modules/common/configuration.nix b/modules/common/configuration.nix index ce674ba..60ac48d 100644 --- a/modules/common/configuration.nix +++ b/modules/common/configuration.nix @@ -8,7 +8,7 @@ ]; # Use the GRUB 2 boot loader. boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only + #boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. diff --git a/modules/hardware-configuration/vm/linode.nix b/modules/hardware-configuration/vm/linode.nix index 647f7c3..14b1d05 100644 --- a/modules/hardware-configuration/vm/linode.nix +++ b/modules/hardware-configuration/vm/linode.nix @@ -8,17 +8,32 @@ [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ "virtio_scsi" "ahci" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/39c9f27b-5fea-4024-8a5d-64f5537e604d"; + { device = "/dev/sda"; fsType = "ext4"; }; - swapDevices = [ ]; + swapDevices = + [ { device = "/dev/sdb"; } + ]; + +# Enable LISH +boot.kernelParams = [ "console=ttyS0,19200n8" ]; +boot.loader.grub.extraConfig = '' + serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1; + terminal_input serial; + terminal_output serial; +''; + +boot.loader.grub.forceInstall = true; +boot.loader.grub.device = "nodev"; +boot.loader.timeout = 10; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} \ No newline at end of file +} diff --git a/modules/hardware-configuration/vm/proxmox.nix b/modules/hardware-configuration/vm/proxmox.nix index 6874fda..9458410 100644 --- a/modules/hardware-configuration/vm/proxmox.nix +++ b/modules/hardware-configuration/vm/proxmox.nix @@ -12,6 +12,7 @@ boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; + boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only fileSystems."/" = { device = "/dev/disk/by-label/nixos";