From 03e3360fc32a83fe9693ad79e6a0c83468d20ab0 Mon Sep 17 00:00:00 2001 From: Pierre Martin Date: Sat, 3 Sep 2022 07:09:18 +0200 Subject: [PATCH] refactor(config): remove outdated configurations to keep a single laptop --- nixos/.gitignore | 2 - nixos/configuration-override.home-laptop.nix | 16 -------- nixos/hardware-configuration.home-laptop.nix | 31 ---------------- nixos/hardware-configuration.nix | 39 ++++++++++++++++++++ nixos/hardware-configuration.work-laptop.nix | 24 ------------ 5 files changed, 39 insertions(+), 73 deletions(-) delete mode 100644 nixos/.gitignore delete mode 100644 nixos/configuration-override.home-laptop.nix delete mode 100644 nixos/hardware-configuration.home-laptop.nix create mode 100644 nixos/hardware-configuration.nix delete mode 100644 nixos/hardware-configuration.work-laptop.nix diff --git a/nixos/.gitignore b/nixos/.gitignore deleted file mode 100644 index 1b95336..0000000 --- a/nixos/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# This file must be a symlink of the physical machine’s config file -hardware-configuration.nix \ No newline at end of file diff --git a/nixos/configuration-override.home-laptop.nix b/nixos/configuration-override.home-laptop.nix deleted file mode 100644 index 4c085e9..0000000 --- a/nixos/configuration-override.home-laptop.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: - -{ - i18n = { - consoleKeyMap = "fr"; - }; - - users.users.celine = { - isNormalUser = true; - home = "/home/celine"; - shell = pkgs.zsh; - extraGroups = [ "audio" "wheel" "networkmanager" ]; - }; - - services.xserver.desktopManager.gnome3.enable = true; -} \ No newline at end of file diff --git a/nixos/hardware-configuration.home-laptop.nix b/nixos/hardware-configuration.home-laptop.nix deleted file mode 100644 index fd809d9..0000000 --- a/nixos/hardware-configuration.home-laptop.nix +++ /dev/null @@ -1,31 +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, ... }: - -{ - imports = - [ - ./configuration-override.home-laptop.nix - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/3f2c0260-be76-4fbf-9291-4d8778d36757"; - fsType = "ext4"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/1d2acd42-9341-41de-9725-b3b5ece30720"; } - ]; - - nix.settings.max-jobs = lib.mkDefault 4; - - # Conflicts with tlp - # powerManagement.cpuFreqGovernor = "powersave"; - - hardware.pulseaudio.enable = true; -} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..277db7a --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/db660732-f520-4e68-9141-b0899f221e82"; + fsType = "ext4"; + }; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-uuid/D7D6-B4C6"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/da431bdf-cec4-4928-b44b-e6d2c3419063"; } + ]; + + # 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.wlp166s0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hardware-configuration.work-laptop.nix b/nixos/hardware-configuration.work-laptop.nix deleted file mode 100644 index 1d5be81..0000000 --- a/nixos/hardware-configuration.work-laptop.nix +++ /dev/null @@ -1,24 +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, ... }: - -{ - imports = - [ - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/51b9ad68-2755-4939-8735-59e19560d24c"; - fsType = "ext4"; - }; - - swapDevices = [ ]; - - nix.settings.max-jobs = lib.mkDefault 8; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; -}