]> git.dkaiser.de - config/nixos.git/commitdiff
Add server config
authorDominik Kaiser <dominik-kaiser@mailbox.org>
Sat, 15 Feb 2025 19:59:42 +0000 (20:59 +0100)
committerDominik Kaiser <dominik-kaiser@mailbox.org>
Sat, 15 Feb 2025 19:59:42 +0000 (20:59 +0100)
flake.nix
hosts/antares/configuration.nix [new file with mode: 0644]
hosts/antares/hardware-configuration.nix [new file with mode: 0644]

index 65a7b1759fb3fbb0ad8b66943336db54765529ba..b6feaf56f887e37fe90857703f37cc405f88f716 100644 (file)
--- a/flake.nix
+++ b/flake.nix
@@ -8,6 +8,10 @@
     # Home manager
     home-manager.url = "github:nix-community/home-manager/release-24.11";
     home-manager.inputs.nixpkgs.follows = "nixpkgs";
+    
+    # Disko
+    disko.url = "github:nix-community/disko";
+    disko.inputs.nixpkgs.follows = "nixpkgs";
   };
 
   outputs = {
         specialArgs = {inherit inputs outputs;};
         modules = [./nixos/configuration.nix];
       };
+      antares = nixpkgs.lib.nixosSystem {
+        system = "x86_64-linux";
+        modules = [
+          disko.nixosModules.disko
+          ./hosts/antares/configuration.nix
+          ./hosts/antares/hardware-configuration.nix
+        ];
+      };
     };
 
     # Standalone home-manager configuration entrypoint
diff --git a/hosts/antares/configuration.nix b/hosts/antares/configuration.nix
new file mode 100644 (file)
index 0000000..f942e6d
--- /dev/null
@@ -0,0 +1,32 @@
+{
+  modulesPath,
+  lib,
+  pkgs,
+  ...
+}:
+{
+  imports = [
+    (modulesPath + "/installer/scan/not-detected.nix")
+    (modulesPath + "/profiles/qemu-guest.nix")
+    ./disk-config.nix
+  ];
+  boot.loader.grub = {
+    # no need to set devices, disko will add all devices that have a EF02 partition to the list already
+    # devices = [ ];
+    efiSupport = true;
+    efiInstallAsRemovable = true;
+  };
+  services.openssh.enable = true;
+
+  environment.systemPackages = map lib.lowPrio [
+    pkgs.curl
+    pkgs.gitMinimal
+  ];
+
+  users.users.root.openssh.authorizedKeys.keys = [
+    # change this to your ssh key
+    "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICtL2eG098LhkFPR4N5e44XMq60uvCUCOuKMYs5zjg6f dk@nixos"
+  ];
+
+  system.stateVersion = "24.05";
+}
diff --git a/hosts/antares/hardware-configuration.nix b/hosts/antares/hardware-configuration.nix
new file mode 100644 (file)
index 0000000..4534c62
--- /dev/null
@@ -0,0 +1,24 @@
+# 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" "uhci_hcd" "virtio_pci" "virtio_blk" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-amd" ];
+  boot.extraModulePackages = [ ];
+
+  # 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.<interface>.useDHCP`.
+  networking.useDHCP = lib.mkDefault true;
+  # networking.interfaces.ens6.useDHCP = lib.mkDefault true;
+
+  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+}