From 6d56cad1ef9770df8514deb394e27f6bf64d7dab Mon Sep 17 00:00:00 2001 From: System administrator Date: Fri, 15 Nov 2024 12:19:35 +0000 Subject: [PATCH] initial commit --- .gitignore | 2 ++ configuration.nix | 12 ++++++++++++ gandicloud.nix | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .gitignore create mode 100644 configuration.nix create mode 100644 gandicloud.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3226101 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/result + diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..f7dc4e6 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./gandicloud.nix ]; + + environment.systemPackages = with pkgs; [ + vim + gnumake + git tig + wget + ]; +} diff --git a/gandicloud.nix b/gandicloud.nix new file mode 100644 index 0000000..64075fa --- /dev/null +++ b/gandicloud.nix @@ -0,0 +1,45 @@ +# This is the configuration required to run NixOS on GandiCloud. +{ lib, modulesPath, ... }: +{ + imports = [ + (modulesPath + "/virtualisation/openstack-config.nix") + ]; + config = { + boot.initrd.kernelModules = [ + "xen-blkfront" "xen-tpmfront" "xen-kbdfront" "xen-fbfront" + "xen-netfront" "xen-pcifront" "xen-scsifront" + ]; + + # Show debug kernel message on boot then reduce loglevel once booted + boot.consoleLogLevel = 7; + boot.kernel.sysctl."kernel.printk" = "4 4 1 7"; + + # For "openstack console log show" + boot.kernelParams = [ "console=ttyS0" ]; + systemd.services."serial-getty@ttyS0" = { + enable = true; + wantedBy = [ "multi-user.target" ]; + serviceConfig.Restart = "always"; + }; + + # The device exposed by Xen + boot.loader.grub.device = lib.mkForce "/dev/xvda"; + + # This is to get a prompt via the "openstack console url show" command + systemd.services."getty@tty1" = { + enable = lib.mkForce true; + wantedBy = [ "multi-user.target" ]; + serviceConfig.Restart = "always"; + }; + + # This is required to get an IPv6 address on our infrastructure + networking.tempAddresses = "disabled"; + + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + + system.stateVersion = "23.11"; + }; +} +