From 651852986d259759840cfea734141bbc6231c5d4 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Sat, 21 Sep 2024 14:03:24 -0500 Subject: [PATCH] task | formating --- hosts/smaug/hardware-configuration.nix | 42 ++++++++++++++------------ nixos-anywhere/configuration-vm.nix | 18 ++++++++--- nixos-anywhere/configuration.nix | 8 ++++- nixos-anywhere/disk-config-vm.nix | 3 +- nixos-anywhere/disk-config.nix | 3 +- nixos-anywhere/flake.nix | 35 +++++++++++---------- 6 files changed, 64 insertions(+), 45 deletions(-) diff --git a/hosts/smaug/hardware-configuration.nix b/hosts/smaug/hardware-configuration.nix index 07cbb6f..7683f69 100644 --- a/hosts/smaug/hardware-configuration.nix +++ b/hosts/smaug/hardware-configuration.nix @@ -1,30 +1,34 @@ # 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 + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "sd_mod" "rtsx_pci_sdmmc"]; + boot.initrd.kernelModules = ["dm-snapshot"]; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/c871ca4a-fb86-4631-b3bd-105931c5f373"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/c871ca4a-fb86-4631-b3bd-105931c5f373"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/55CA-7FD8"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/55CA-7FD8"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; - swapDevices = [ ]; + 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 diff --git a/nixos-anywhere/configuration-vm.nix b/nixos-anywhere/configuration-vm.nix index b917130..661ceed 100644 --- a/nixos-anywhere/configuration-vm.nix +++ b/nixos-anywhere/configuration-vm.nix @@ -1,4 +1,10 @@ -{ modulesPath, config, lib, pkgs, ... }: { +{ + modulesPath, + config, + lib, + pkgs, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/profiles/qemu-guest.nix") @@ -6,12 +12,14 @@ ]; boot = { kernelPackages = pkgs.linuxPackages_latest; - kernelParams = [ "consoleblank=60" ]; + kernelParams = ["consoleblank=60"]; loader = { timeout = 10; - /* systemd-boot = { + /* + systemd-boot = { enable = true; - }; */ + }; + */ grub = { device = "nodev"; efiSupport = true; @@ -28,7 +36,7 @@ theme = "breeze"; }; kernel = { - sysctl = { "vm.swappiness" = 10;}; + sysctl = {"vm.swappiness" = 10;}; }; }; services.openssh.enable = true; diff --git a/nixos-anywhere/configuration.nix b/nixos-anywhere/configuration.nix index 7d3d7fb..99933d9 100644 --- a/nixos-anywhere/configuration.nix +++ b/nixos-anywhere/configuration.nix @@ -1,4 +1,10 @@ -{ modulesPath, config, lib, pkgs, ... }: { +{ + modulesPath, + config, + lib, + pkgs, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/profiles/qemu-guest.nix") diff --git a/nixos-anywhere/disk-config-vm.nix b/nixos-anywhere/disk-config-vm.nix index 88e17e5..fda4c63 100644 --- a/nixos-anywhere/disk-config-vm.nix +++ b/nixos-anywhere/disk-config-vm.nix @@ -1,6 +1,5 @@ # Example to create a bios compatible gpt partition -{ lib, ... }: -{ +{lib, ...}: { disko.devices = { disk.disk1 = { device = lib.mkDefault "/dev/vda"; diff --git a/nixos-anywhere/disk-config.nix b/nixos-anywhere/disk-config.nix index 75ae234..c72a8d4 100644 --- a/nixos-anywhere/disk-config.nix +++ b/nixos-anywhere/disk-config.nix @@ -1,6 +1,5 @@ # Example to create a bios compatible gpt partition -{ lib, ... }: -{ +{lib, ...}: { disko.devices = { disk.disk1 = { device = lib.mkDefault "/dev/sda"; diff --git a/nixos-anywhere/flake.nix b/nixos-anywhere/flake.nix index aebd87d..a20e3bf 100644 --- a/nixos-anywhere/flake.nix +++ b/nixos-anywhere/flake.nix @@ -3,21 +3,24 @@ inputs.disko.url = "github:nix-community/disko"; inputs.disko.inputs.nixpkgs.follows = "nixpkgs"; - outputs = { nixpkgs, disko, ... }: - { - nixosConfigurations.smaug = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - disko.nixosModules.disko - ./configuration.nix - ]; - }; - nixosConfigurations.vm = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - disko.nixosModules.disko - ./configuration-vm.nix - ]; - }; + outputs = { + nixpkgs, + disko, + ... + }: { + nixosConfigurations.smaug = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + disko.nixosModules.disko + ./configuration.nix + ]; }; + nixosConfigurations.vm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + disko.nixosModules.disko + ./configuration-vm.nix + ]; + }; + }; }