From a31f939a70d8b4e88bc818cd072fbc0d6c9e83be Mon Sep 17 00:00:00 2001 From: Alexander Szczepanski Date: Sat, 31 Aug 2024 16:47:05 +0200 Subject: [PATCH] nixos-libvirt-2024-08-31-16-47-05 --- configs/user-gui.nix | 4 +- flake.lock | 6 +- flake.nix | 9 +++ machine/nixos-libvirt/configuration.nix | 62 +++++++++++++++++++ .../nixos-libvirt/hardware-configuration.nix | 31 ++++++++++ 5 files changed, 107 insertions(+), 5 deletions(-) create mode 100755 machine/nixos-libvirt/configuration.nix create mode 100644 machine/nixos-libvirt/hardware-configuration.nix diff --git a/configs/user-gui.nix b/configs/user-gui.nix index 8be95bb..fbd17f3 100755 --- a/configs/user-gui.nix +++ b/configs/user-gui.nix @@ -11,8 +11,8 @@ fontDir.enable = true; packages = with pkgs; [ - # (nerdfonts.override { fonts = [ "Liberation" ]; }) - nerdfonts + (nerdfonts.override { fonts = [ "Meslo" ]; }) + # nerdfonts corefonts google-fonts liberation_ttf diff --git a/flake.lock b/flake.lock index c07847c..31f1370 100644 --- a/flake.lock +++ b/flake.lock @@ -77,11 +77,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1724855419, - "narHash": "sha256-WXHSyOF4nBX0cvHN3DfmEMcLOVdKH6tnMk9FQ8wTNRc=", + "lastModified": 1725001927, + "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ae2fc9e0e42caaf3f068c1bfdc11c71734125e06", + "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d002291..f711f7f 100644 --- a/flake.nix +++ b/flake.nix @@ -80,6 +80,15 @@ ./machine/mini/configuration.nix ]; }; + + + nixos-libvirt = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs outputs; }; + modules = [ + ./machine/nixos-libvirt/configuration.nix + ]; + }; }; }; } diff --git a/machine/nixos-libvirt/configuration.nix b/machine/nixos-libvirt/configuration.nix new file mode 100755 index 0000000..5cc88aa --- /dev/null +++ b/machine/nixos-libvirt/configuration.nix @@ -0,0 +1,62 @@ +{ config, pkgs, lib, outputs, ... }: +{ + nixpkgs = { + overlays = [ + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + ]; + config = { + allowUnfree = true; + }; + }; + + imports = [ + ./hardware-configuration.nix + ../../configs/common.nix + ../../configs/user.nix + ../../configs/docker.nix + ../../configs/pantheon.nix + ../../configs/user-gui.nix + ]; + + networking.hostName = "nixos-libvirt"; # Define your hostname. + time.timeZone = "Europe/Berlin"; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; + boot.loader.grub.useOSProber = true; + +# boot.loader.systemd-boot.enable = true; +# boot.loader.efi.canTouchEfiVariables = true; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.enp0s1.useDHCP = true; + + programs.nix-ld.enable = true; + + services = { + k3s = { + enable = true; + role = "server"; + }; + }; + + environment.pantheon.excludePackages = (with pkgs.pantheon; [ + elementary-calculator + # elementary-calendar + elementary-camera + elementary-code + elementary-music + # elementary-photos + # elementary-screenshot + # elementary-tasks + elementary-videos + epiphany + ]); + + system.stateVersion = "24.05"; +} diff --git a/machine/nixos-libvirt/hardware-configuration.nix b/machine/nixos-libvirt/hardware-configuration.nix new file mode 100644 index 0000000..73283d5 --- /dev/null +++ b/machine/nixos-libvirt/hardware-configuration.nix @@ -0,0 +1,31 @@ +# 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 = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/bc7b8b67-966c-44f5-824b-bea72de13d92"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # 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.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}