From e0be8076cd00c27de75122da5469e5bbf4b210cc Mon Sep 17 00:00:00 2001 From: Alex Davies Date: Mon, 13 May 2024 12:42:45 -0300 Subject: [PATCH] Don't need specialArgs --- flake.nix | 13 +------- nixos/configuration.nix | 6 ++-- nixos/hardware/metatron.nix | 66 +++++++++++++++++++++++++++++++++++++ nixos/work.nix | 11 +++++++ 4 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 nixos/hardware/metatron.nix create mode 100644 nixos/work.nix diff --git a/flake.nix b/flake.nix index 283289c..dfa7c79 100644 --- a/flake.nix +++ b/flake.nix @@ -62,10 +62,6 @@ nixosConfigurations = { #Personal laptop, thinkpad t490 athame = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs outputs; - hostname = "athame"; - }; modules = [ ./nixos/configuration.nix ./nixos/kde-desktop.nix @@ -75,22 +71,15 @@ }; #Work laptop, dell g15. metatron = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs outputs; - hostname = "metatron"; - }; modules = [ ./nixos/configuration.nix ./nixos/kde-desktop.nix ./nixos/cad.nix ./nixos/zerotier.nix + ./nixos/work.nix ]; }; hearth = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs outputs; - hostname = "hearth"; - }; modules = [ ./nixos/configuration.nix ./nixos/home-assistant.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 5ccd3b3..8c981da 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -14,7 +14,7 @@ # ./users.nix # Import your generated (nixos-generate-config) hardware configuration - ./hardware/${specialArgs.hostname}.nix + ./hardware/${hostname}.nix ]; nixpkgs = { @@ -42,7 +42,7 @@ }; }; - networking.hostName = specialArgs.hostname; # Define your hostname. + networking.hostName = hostname; # Define your hostname. networking.networkmanager.enable = true; # This will add each flake input as a registry @@ -101,7 +101,7 @@ isNormalUser = true; openssh.authorizedKeys.keys = [ ]; - extraGroups = ["wheel"]; + extraGroups = [ "wheel" "dialout" "networkmanager" "dialout" "docker" "plugdev" "vboxusers" ]; }; }; diff --git a/nixos/hardware/metatron.nix b/nixos/hardware/metatron.nix new file mode 100644 index 0000000..8ea71c4 --- /dev/null +++ b/nixos/hardware/metatron.nix @@ -0,0 +1,66 @@ +# 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") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/6638ca69-8a70-4f82-afd6-02c0d61f4d9f"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-2f7b0c1c-5d7f-403f-b4fd-fc0f423e83ee".device = "/dev/disk/by-uuid/2f7b0c1c-5d7f-403f-b4fd-fc0f423e83ee"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/B01C-E401"; + fsType = "vfat"; + }; + + swapDevices = [ { + device = "/dev/nvme0n1p3"; + randomEncryption.enable = true; + } ]; + + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; + hardware.nvidia.prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + + # Make sure to use the correct Bus ID values for your system! + intelBusId = "PCI:0:0:2"; + nvidiaBusId = "PCI:1:0:0"; + }; + + # 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.br-22d2b0b3a5fd.useDHCP = lib.mkDefault true; + # networking.interfaces.br-6cab41b5b767.useDHCP = lib.mkDefault true; + # networking.interfaces.br-b13218a11bcd.useDHCP = lib.mkDefault true; + # networking.interfaces.docker0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; + # networking.interfaces.veth00fe74b.useDHCP = lib.mkDefault true; + # networking.interfaces.veth059d5b8.useDHCP = lib.mkDefault true; + # networking.interfaces.veth565651d.useDHCP = lib.mkDefault true; + # networking.interfaces.veth588a8d1.useDHCP = lib.mkDefault true; + # networking.interfaces.vetha6a79f7.useDHCP = lib.mkDefault true; + # networking.interfaces.vethb8d496e.useDHCP = lib.mkDefault true; + # networking.interfaces.vethec49f9a.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/work.nix b/nixos/work.nix new file mode 100644 index 0000000..829a42b --- /dev/null +++ b/nixos/work.nix @@ -0,0 +1,11 @@ +{ config, pkgs, lib, ros, ... }: + +{ + virtualisation.virtualbox.host.enable = true; + users.extraGroups.vboxusers.members = [ "traverseda" ]; + environment.systemPackages = with pkgs; [ + pkgs.qgroundcontrol + + ]; +} +