From 9ecdc662bc5b7cd8dcd55f92f1a40dddad863fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 20 Jul 2024 18:33:32 +0200 Subject: [PATCH] [fix] machines: remove all configurations Moved them to my main flake instead --- flake.lock | 16 ---- flake.nix | 12 +-- machines/capricorn/default.nix | 57 ------------- machines/capricorn/hardware-configuration.nix | 62 --------------- machines/gemini/default.nix | 66 ---------------- machines/gemini/hardware-configuration.nix | 69 ---------------- machines/libra/default.nix | 79 ------------------- machines/libra/hardware-configuration.nix | 62 --------------- machines/vm/default.nix | 2 +- 9 files changed, 3 insertions(+), 422 deletions(-) delete mode 100644 machines/capricorn/default.nix delete mode 100644 machines/capricorn/hardware-configuration.nix delete mode 100644 machines/gemini/default.nix delete mode 100644 machines/gemini/hardware-configuration.nix delete mode 100644 machines/libra/default.nix delete mode 100644 machines/libra/hardware-configuration.nix diff --git a/flake.lock b/flake.lock index 65c7845..55877b4 100644 --- a/flake.lock +++ b/flake.lock @@ -352,21 +352,6 @@ "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0.tar.gz" } }, - "nixos-hardware": { - "locked": { - "lastModified": 1721331912, - "narHash": "sha256-h2yaU+QEU4pHxMySHPIsRV2T/pihDHnrXBca8BY6xgc=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "bb90787ea034c8b9035dfcfc9b4dc23898d414be", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixos-hardware", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1721226092, @@ -422,7 +407,6 @@ "flake-utils": "flake-utils", "home-manager": "home-manager", "lix-module": "lix-module", - "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixvim": "nixvim", "stylix": "stylix", diff --git a/flake.nix b/flake.nix index 9628da6..06653ba 100644 --- a/flake.nix +++ b/flake.nix @@ -19,8 +19,6 @@ url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; - nixos-hardware.url = "github:NixOS/nixos-hardware"; - # FIXME: pin to 24.05 when avalialble stylix = { url = "github:danth/stylix/release-24.05"; inputs = { @@ -61,7 +59,6 @@ unstable, stylix, home-manager, - nixos-hardware, nixvim, lix-module, ... @@ -223,16 +220,11 @@ nix.registry.nixpkgs.flake = nixpkgs; }; - machines = [ - "capricorn" - "gemini" - "libra" - "vm" - ]; + machines = [ "vm" ]; mkMachine = hostname: { imports = [ nixosModule - (import (./machines + "/${hostname}") { inherit nixos-hardware; }) + (import (./machines + "/${hostname}")) ]; home-manager.sharedModules = [ { jhome.hostName = hostname; } ]; }; diff --git a/machines/capricorn/default.nix b/machines/capricorn/default.nix deleted file mode 100644 index df5a533..0000000 --- a/machines/capricorn/default.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ nixos-hardware }: -{ - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - nixos-hardware.nixosModules.common-pc-laptop - nixos-hardware.nixosModules.common-pc-laptop-hdd - nixos-hardware.nixosModules.common-pc-laptop-ssd - nixos-hardware.nixosModules.common-cpu-intel - ]; - fileSystems = { - # Setup extra filesystem options - "/".options = [ "compress=zstd" ]; - "/home".options = [ "compress=zstd" ]; - "/nix".options = [ - "compress=zstd" - "noatime" - ]; - }; - - hardware.bluetooth.enable = true; - boot.loader = { - # Bootloader - systemd-boot = { - enable = true; - configurationLimit = 10; - }; - efi.canTouchEfiVariables = true; - }; - # Network configuration - networking = { - hostName = "capricorn"; - networkmanager = { - enable = true; - wifi.backend = "iwd"; - appendNameservers = [ - "1.1.1.1" - "1.0.0.1" - "8.8.8.8" - "8.4.4.8" - ]; - }; - }; - - console.useXkbConfig = true; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "22.11"; # Did you read the comment? -} diff --git a/machines/capricorn/hardware-configuration.nix b/machines/capricorn/hardware-configuration.nix deleted file mode 100644 index 0862ea4..0000000 --- a/machines/capricorn/hardware-configuration.nix +++ /dev/null @@ -1,62 +0,0 @@ -# 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, - modulesPath, - ... -}: -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot = { - initrd = { - availableKernelModules = [ - "xhci_pci" - "ahci" - "usb_storage" - "sd_mod" - ]; - kernelModules = [ ]; - }; - kernelModules = [ "kvm-intel" ]; - extraModulePackages = [ ]; - }; - fileSystems = { - "/" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "btrfs"; - options = [ "subvol=root" ]; - }; - - "/nix" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; - - "/home" = { - device = "/dev/disk/by-label/NIXHOME"; - fsType = "btrfs"; - }; - - "/boot" = { - device = "/dev/disk/by-label/NIXBOOT"; - fsType = "vfat"; - }; - }; - - swapDevices = [ { device = "/dev/disk/by-label/NIXSWAP"; } ]; - - # 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.enp0s20f0u1c2.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/machines/gemini/default.nix b/machines/gemini/default.nix deleted file mode 100644 index 47d4b2b..0000000 --- a/machines/gemini/default.nix +++ /dev/null @@ -1,66 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). -{ nixos-hardware }: -{ pkgs, ... }: -{ - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - nixos-hardware.nixosModules.common-pc - nixos-hardware.nixosModules.common-pc-ssd - nixos-hardware.nixosModules.common-cpu-amd - nixos-hardware.nixosModules.common-gpu-amd - ]; - fileSystems = { - "/".options = [ "compress=zstd" ]; - "/steam".options = [ "compress=zstd" ]; - "/home".options = [ "compress=zstd" ]; - "/nix".options = [ - "compress=zstd" - "noatime" - ]; - }; - boot.loader = { - systemd-boot = { - # Use the systemd-boot EFI boot loader. - enable = true; - configurationLimit = 3; - }; - efi.canTouchEfiVariables = true; - }; - - # Enable bluetooth - hardware.bluetooth.enable = true; - networking = { - hostName = "gemini"; - networkmanager.enable = true; - interfaces.enp4s0.wakeOnLan.enable = true; - }; - - console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - useXkbConfig = true; # use xkbOptions in tty. - }; - services.openssh = { - # Configure keymap in X11 - # services.xserver.xkbOptions = { - # "caps:swapescape" # map caps to escape. - # }; - enable = true; - startWhenNeeded = true; - settings.AllowUsers = [ "jalil" ]; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "22.11"; # Did you read the comment? -} diff --git a/machines/gemini/hardware-configuration.nix b/machines/gemini/hardware-configuration.nix deleted file mode 100644 index cbfc246..0000000 --- a/machines/gemini/hardware-configuration.nix +++ /dev/null @@ -1,69 +0,0 @@ -# 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, - modulesPath, - ... -}: -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot = { - initrd = { - availableKernelModules = [ - "nvme" - "xhci_pci" - "ahci" - "usbhid" - "usb_storage" - "sd_mod" - ]; - kernelModules = [ ]; - }; - kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ ]; - }; - fileSystems = { - "/" = { - # device = "/dev/disk/by-label/NIXOSROOT"; - device = "/dev/disk/by-label/NIXOSHOME"; - fsType = "btrfs"; - options = [ "subvol=root" ]; - }; - - "/steam" = { - device = "/dev/disk/by-label/STEAM"; - fsType = "btrfs"; - }; - - "/home" = { - device = "/dev/disk/by-label/NIXOSHOME"; - fsType = "btrfs"; - options = [ "subvol=home" ]; - }; - - "/nix" = { - device = "/dev/disk/by-label/NIXOSROOT"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; - - "/boot" = { - device = "/dev/disk/by-label/BOOT"; - fsType = "vfat"; - }; - }; - - swapDevices = [ { device = "/dev/disk/by-label/SWAP"; } ]; - - # 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.enp4s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/machines/libra/default.nix b/machines/libra/default.nix deleted file mode 100644 index b896d97..0000000 --- a/machines/libra/default.nix +++ /dev/null @@ -1,79 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ nixos-hardware }: -{ - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - nixos-hardware.nixosModules.tuxedo-pulse-14-gen3 - ]; - - fileSystems = { - "/".options = [ "compress=zstd" ]; - "/home".options = [ "compress=zstd" ]; - "/nix".options = [ - "compress=zstd" - "noatime" - ]; - }; - boot = { - loader = { - # Use the systemd-boot EFI boot loader. - timeout = 0; # Press Space to show the menu - efi.canTouchEfiVariables = true; - systemd-boot.enable = true; - systemd-boot.configurationLimit = 10; - }; - }; - # Fixes graphical issues - hardware = { - opengl.enable = true; - bluetooth.enable = true; - # tuxedo-rs = { - # enable = true; - # tailor-gui.enable = true; - # }; - }; - networking = { - hostName = "libra"; - networkmanager = { - enable = true; # Easiest to use and most distros use this by default. - # networking.networkmanager.wifi.backend = "iwd"; # Seems to cause problems - appendNameservers = [ - "1.1.1.1" - "1.0.0.1" - "8.8.8.8" - "8.4.4.8" - ]; - }; - }; - - # use xkb.options in tty. - console.useXkbConfig = true; - services = { - # Enable CUPS to print documents. - printing.enable = true; - - # Enable the OpenSSH daemon. - openssh.enable = true; - }; - - # This option defines the first version of NixOS you have installed on this particular machine, - # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. - # - # Most users should NEVER change this value after the initial install, for any reason, - # even if you've upgraded your system to a new NixOS release. - # - # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, - # so changing it will NOT upgrade your system. - # - # This value being lower than the current NixOS release does NOT mean your system is - # out of date, out of support, or vulnerable. - # - # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, - # and migrated your data accordingly. - # - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . - system.stateVersion = "23.11"; # Did you read the comment? -} diff --git a/machines/libra/hardware-configuration.nix b/machines/libra/hardware-configuration.nix deleted file mode 100644 index f979efa..0000000 --- a/machines/libra/hardware-configuration.nix +++ /dev/null @@ -1,62 +0,0 @@ -# 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 = [ - "nvme" - "xhci_pci" - "usb_storage" - "sd_mod" - ]; - kernelModules = [ ]; - }; - kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ ]; - }; - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/efbda7f0-c286-4fb1-b780-d3128e4d1a3e"; - fsType = "btrfs"; - options = [ "subvol=root" ]; - }; - - "/home" = { - device = "/dev/disk/by-uuid/efbda7f0-c286-4fb1-b780-d3128e4d1a3e"; - fsType = "btrfs"; - options = [ "subvol=home" ]; - }; - - "/nix" = { - device = "/dev/disk/by-uuid/efbda7f0-c286-4fb1-b780-d3128e4d1a3e"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/4E80-8B60"; - fsType = "vfat"; - }; - }; - - 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.wlp2s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/machines/vm/default.nix b/machines/vm/default.nix index e9c6397..ced0faa 100644 --- a/machines/vm/default.nix +++ b/machines/vm/default.nix @@ -1,4 +1,4 @@ -_: { +{ services.qemuGuest.enable = true; boot.initrd.availableKernelModules = [ -- 2.47.0