From 7043ef2d2c740b4679f7c99ddfec50d9ced6b33f Mon Sep 17 00:00:00 2001 From: atagen Date: Sat, 20 Aug 2022 12:36:08 +1000 Subject: [PATCH] refactor system into only 3 files --- system/adrift.nix | 23 ++++++++++++- system/adrifthw.nix | 30 ----------------- system/configuration.nix | 55 +++---------------------------- system/hardware-configuration.nix | 13 -------- system/wollomi.nix | 47 ++++++++++++++++++++------ 5 files changed, 64 insertions(+), 104 deletions(-) delete mode 100644 system/adrifthw.nix delete mode 100644 system/hardware-configuration.nix diff --git a/system/adrift.nix b/system/adrift.nix index b5e3fa9..a8fc533 100644 --- a/system/adrift.nix +++ b/system/adrift.nix @@ -1,6 +1,26 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, modulesPath, ... }: { + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1C5C-8FF4"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; networking.hostName = "adrift"; # Define your hostname. services.xserver.videoDrivers = [ "i915" ]; services.tlp.enable = true; @@ -9,6 +29,7 @@ isNormalUser = true; extraGroups = [ "wheel" ]; }; + fileSystems."/" = { device = "/dev/mapper/nix-os"; fsType = "ext4"; diff --git a/system/adrifthw.nix b/system/adrifthw.nix deleted file mode 100644 index b9c490b..0000000 --- a/system/adrifthw.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/1C5C-8FF4"; - 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.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/system/configuration.nix b/system/configuration.nix index ab68d37..1245189 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -5,38 +5,27 @@ imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - + [ # where are we ? # ./wollomi.nix # ./adrift.nix ]; - # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.configurationLimit = 2; boot.loader.systemd-boot.consoleMode = "max"; boot.loader.timeout = 3; boot.loader.efi.canTouchEfiVariables = true; - boot.plymouth.enable = true; + #boot.plymouth.enable = true; - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - # Set your time zone. time.timeZone = "Australia/Sydney"; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; console = { font = "Lat2-Terminus16"; - # keyMap = "us"; useXkbConfig = true; # use xkbOptions in tty. }; @@ -46,6 +35,7 @@ hardware.opengl.driSupport32Bit = true; #input stuff + services.xserver.libinput.enable = true; # services.xserver.xkbOptions = { # "eurosign:e"; # "caps:escape" # map caps to escape. @@ -68,62 +58,27 @@ jack.enable = true; }; - # Enable touchpad support (enabled default in most desktopManager). - services.xserver.libinput.enable = true; - # gtk compatibility qt5.enable = true; qt5.platformTheme = "gtk2"; qt5.style = "gtk2"; - # Define a user account. Don't forget to set a password with ‘passwd’. - programs.zsh.enable = true; users.defaultUserShell = pkgs.zsh; # List packages installed in system profile. To search, run: - # $ nix search wget environment.systemPackages = with pkgs; [ helix rnix-lsp + curl + home-manager git zsh ]; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ 8200 ]; - # networking.firewall.allowedUDPPorts = [ 1900 ]; - # Or disable the firewall altogether. - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = 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.05"; # Did you read the comment? } diff --git a/system/hardware-configuration.nix b/system/hardware-configuration.nix deleted file mode 100644 index 66031aa..0000000 --- a/system/hardware-configuration.nix +++ /dev/null @@ -1,13 +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"), - # ./adrifthw.nix - # ./wollomihw.nix - ]; - -} diff --git a/system/wollomi.nix b/system/wollomi.nix index 3a466aa..98f29e0 100644 --- a/system/wollomi.nix +++ b/system/wollomi.nix @@ -1,7 +1,28 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, modulesPath, ... }: { - networking.hostName = "wollomi"; # Define your hostname. + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_generic" "ehci_pci" "ahci" "isci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + boot.supportedFilesystems = [ "ntfs" ]; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/5008-1946"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # dlna services.minidlna = { enable = true; @@ -9,29 +30,35 @@ friendlyName = "PC"; mediaDirs = [ "A,/data/Music/Slsk" ]; }; + services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; hardware.ckb-next.enable = true; + environment.systemPackages = with pkgs; [ + ckb-next + ]; + + networking.hostName = "wollomi"; # Define your hostname. users.users.fossil = { isNormalUser = true; extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. }; - environment.systemPackages = with pkgs; [ - ckb-next - ]; + fileSystems."/" = { - device = "/dev/mapper/linux-nix"; + device = "/dev/mapper/nix-os"; fsType = "ext4"; }; fileSystems."/home" = { - device = "/dev/mapper/linux-home"; - fsType = "btrfs"; + device = "/dev/mapper/nix-home"; + fsType = "ext4"; }; fileSystems."/data" = { - device = "/dev/sdb1"; - fsType = "ntfs"; + device = "/dev/disk/by-uuid/39D4F78C658E8B56"; + fsType = "ntfs"; + options = [ "rw" "uid=1001" ]; }; + networking.firewall.enable = false; }