diff --git a/flake.nix b/flake.nix index f5bb503..884500c 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,9 @@ mcp = mkNixosConfig { path = ./system/hosts/mcp; }; + sirius-a = mkNixosConfig { + path = ./system/hosts/sirius-a; + }; }; features = { development = import ./home-manager/features/development/development.nix; diff --git a/system/hosts/mcp/configuration.nix b/system/hosts/mcp/configuration.nix index 2051e33..901b45e 100644 --- a/system/hosts/mcp/configuration.nix +++ b/system/hosts/mcp/configuration.nix @@ -45,12 +45,6 @@ LC_TIME = "en_US.UTF-8"; }; - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.drew = { isNormalUser = true; @@ -67,11 +61,9 @@ linger = true; }; - # List packages installed in system profile. To search, run: - # $ nix search wget + # List packages installed in system profile. 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 + vim ]; # Some programs need SUID wrappers, can be configured further or are diff --git a/system/hosts/sirius-a/configuration.nix b/system/hosts/sirius-a/configuration.nix new file mode 100644 index 0000000..c2c788d --- /dev/null +++ b/system/hosts/sirius-a/configuration.nix @@ -0,0 +1,76 @@ +{ + pkgs, + ... +}: + +{ + imports = [ + ./gandicloud.nix + ]; + + networking = { + hostName = "sirius-a"; # Define your hostname. + + # Enable networking + networkmanager.enable = true; + # Disable wpa-supplicant to avoid conflicts with network manager. + wireless.enable = false; + + firewall.allowedTCPPorts = [ 22 ]; + }; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + # Set your time zone. + time.timeZone = "America/Los_Angeles"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + programs.zsh.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.drew = { + isNormalUser = true; + description = "Drew Haven"; + extraGroups = [ + "networkmanager" + "wheel" + "docker-registry" + "docker" + ]; + shell = pkgs.zsh; + # Enable linger so that systemd services run for this user are started and + # persist even without an active session. + linger = true; + }; + + security.sudo = { + enable = true; + + extraConfig = '' + Defaults:root,%wheel timestamp_timeout=30 + ''; + }; + + system.stateVersion = "24.11"; # Did you read the comment? + + # Enable flakes + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; +} diff --git a/system/hosts/sirius-a/default.nix b/system/hosts/sirius-a/default.nix new file mode 100644 index 0000000..09b9d3a --- /dev/null +++ b/system/hosts/sirius-a/default.nix @@ -0,0 +1,18 @@ +{ ... }: +{ + imports = [ + ./configuration.nix + ../../authorized-keys.nix + ../../features/gc.nix + ]; + + nixpkgs.config.allowUnfree = true; + + home-manager.users.drew = + { ... }: + { + imports = [ + ./drew.nix + ]; + }; +} diff --git a/system/hosts/sirius-a/drew.nix b/system/hosts/sirius-a/drew.nix new file mode 100644 index 0000000..da63b75 --- /dev/null +++ b/system/hosts/sirius-a/drew.nix @@ -0,0 +1,26 @@ +{ ... }: +{ + imports = map (x: ../../../home-manager + x) [ + "/features/development.nix" + ]; + + # This config file is needed for nix shell to allow unfree programs. I'm not + # sure why this isn't a home-manager option. + home = { + file.".config/nixpkgs/config.nix".text = '' + { allowUnfree = true; } + ''; + + stateVersion = "24.11"; + + username = "drew"; + homeDirectory = "/home/drew"; + }; + + programs.git.settings = { + user = { + name = "Drew Haven"; + email = "periodic@blazestar.net"; + }; + }; +} diff --git a/system/hosts/sirius-a/gandicloud.nix b/system/hosts/sirius-a/gandicloud.nix new file mode 100644 index 0000000..6a2f7dd --- /dev/null +++ b/system/hosts/sirius-a/gandicloud.nix @@ -0,0 +1,47 @@ +# 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 = "24.11"; + }; +}