From 8872b9d5b5370afc8eb71368d5ff18499c57a537 Mon Sep 17 00:00:00 2001 From: dracoling Date: Wed, 1 May 2024 12:10:00 -0400 Subject: [PATCH] add local config for nixos --- machines/nixos/flake.nix | 20 ++++++++++++++ machines/nixos/hardware-configuration.nix | 33 +++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 machines/nixos/flake.nix create mode 100644 machines/nixos/hardware-configuration.nix diff --git a/machines/nixos/flake.nix b/machines/nixos/flake.nix new file mode 100644 index 0000000..2d9d1ce --- /dev/null +++ b/machines/nixos/flake.nix @@ -0,0 +1,20 @@ +{ + description = "A simple NixOS flake"; + + inputs = { + # NixOS official package source, using the nixos-23.11 branch here + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + # Please replace my-nixos with your hostname + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + # Import the previous configuration.nix we used, + # so the old configuration file still takes effect + ./configuration.nix + ]; + }; + }; +} diff --git a/machines/nixos/hardware-configuration.nix b/machines/nixos/hardware-configuration.nix new file mode 100644 index 0000000..d1a439e --- /dev/null +++ b/machines/nixos/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/8841366a-793c-47e2-bfdd-14d8c6181f7e"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/dddc2653-c760-41fc-92a3-5b3a6d3d11b3"; } + ]; + + # 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.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}