From 8287465048a0fd7e1a848e5ddb1a249b71c79c24 Mon Sep 17 00:00:00 2001 From: Adrian G L Date: Mon, 8 Apr 2024 23:04:08 +0200 Subject: [PATCH] elrond flake ready --- machines/elrond/configuration.nix | 21 +++++++++--- machines/elrond/hardware-configuration.nix | 39 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 machines/elrond/hardware-configuration.nix diff --git a/machines/elrond/configuration.nix b/machines/elrond/configuration.nix index 7bc152d..72d2f1b 100644 --- a/machines/elrond/configuration.nix +++ b/machines/elrond/configuration.nix @@ -6,12 +6,19 @@ { imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix ../../profiles/webhost.nix - #../../services/ssh.nix - #../../services/nginx.nix + ../../profiles/base.nix ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + + # Set your time zone. time.timeZone = "Europe/Oslo"; @@ -167,14 +174,18 @@ users.users."gunalx".openssh.authorizedKeys.keys = [ allowedTCPPorts = config.networking.firewall.allowedUDPPorts; }; - # not needed in this config but should sty in default configuration.nix + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave + # on your system were taken. It's perfectly fine and recommended to leave # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - #system.stateVersion = "20.09"; # Did you read the comment? + system.stateVersion = "23.05"; # Did you read the comment? } diff --git a/machines/elrond/hardware-configuration.nix b/machines/elrond/hardware-configuration.nix new file mode 100644 index 0000000..eb321d0 --- /dev/null +++ b/machines/elrond/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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 + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "xhci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; +# boot.kernelParams = ["ipv6.disable=1"]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/3e1f4758-3147-4c69-8135-050e5192f228"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D0CE-6A68"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/76455791-f672-4fda-867c-df1db247b4ea"; } + ]; + + # 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.ens3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}