From c364015d0840fbcf9981d1f958a2a947262206ee Mon Sep 17 00:00:00 2001 From: Alejandro Angulo Date: Sun, 18 Sep 2022 15:41:17 -0700 Subject: [PATCH] Ran formatter --- flake.nix | 2 +- system/gospel/configuration.nix | 32 +++++---- system/gospel/hardware-configuration.nix | 87 +++++++++++++----------- system/gospel/zfs.nix | 63 +++++++++-------- 4 files changed, 99 insertions(+), 85 deletions(-) diff --git a/flake.nix b/flake.nix index 8f21716..360fe45 100644 --- a/flake.nix +++ b/flake.nix @@ -53,7 +53,7 @@ ./system/carbon/configuration.nix ]; }; - + gospel = lib.nixosSystem { inherit system; diff --git a/system/gospel/configuration.nix b/system/gospel/configuration.nix index 9ea4253..ec45238 100644 --- a/system/gospel/configuration.nix +++ b/system/gospel/configuration.nix @@ -1,14 +1,17 @@ # 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’). - -{ config, pkgs, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix ./zfs.nix ./vpn.nix - ]; + config, + pkgs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ./zfs.nix + ./vpn.nix + ]; hardware.opengl = { enable = true; @@ -16,7 +19,7 @@ driSupport32Bit = true; }; - nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfree = true; # Make ready for nix flakes nix.package = pkgs.nixFlakes; @@ -46,9 +49,6 @@ # Enable the X11 windowing system. - - - # Configure keymap in X11 # "eurosign:e"; # "caps:escape" # map caps to escape. @@ -73,7 +73,7 @@ programs.sway = { enable = true; wrapperFeatures.gtk = true; # so that gtk works properly - extraPackages = with pkgs; [ swaylock ]; + extraPackages = with pkgs; [swaylock]; }; programs.steam = { @@ -109,7 +109,11 @@ # List services that you want to enable: # Enable the OpenSSH daemon. - services.openssh.enable = true; + services.openssh = { + enable = true; + passwordAuthentication = false; + permitRootLogin = "no"; + }; security.rtkit.enable = true; services.pipewire = { @@ -137,6 +141,4 @@ # 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/gospel/hardware-configuration.nix b/system/gospel/hardware-configuration.nix index b9dd936..c08d8de 100644 --- a/system/gospel/hardware-configuration.nix +++ b/system/gospel/hardware-configuration.nix @@ -1,55 +1,64 @@ # 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" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "rpool/nixos/root"; - fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; - }; + fileSystems."/" = { + device = "rpool/nixos/root"; + fsType = "zfs"; + options = ["zfsutil" "X-mount.mkdir"]; + }; - fileSystems."/home" = - { device = "rpool/nixos/home"; - fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; - }; + fileSystems."/home" = { + device = "rpool/nixos/home"; + fsType = "zfs"; + options = ["zfsutil" "X-mount.mkdir"]; + }; - fileSystems."/var/lib" = - { device = "rpool/nixos/var/lib"; - fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; - }; + fileSystems."/var/lib" = { + device = "rpool/nixos/var/lib"; + fsType = "zfs"; + options = ["zfsutil" "X-mount.mkdir"]; + }; - fileSystems."/var/log" = - { device = "rpool/nixos/var/log"; - fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; - }; + fileSystems."/var/log" = { + device = "rpool/nixos/var/log"; + fsType = "zfs"; + options = ["zfsutil" "X-mount.mkdir"]; + }; - fileSystems."/boot" = - { device = "bpool/nixos/root"; - fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; - }; + fileSystems."/boot" = { + device = "bpool/nixos/root"; + fsType = "zfs"; + options = ["zfsutil" "X-mount.mkdir"]; + }; - fileSystems."/boot/efis/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086-part1" = - { device = "/dev/disk/by-uuid/1443-371C"; - fsType = "vfat"; - }; + fileSystems."/boot/efis/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086-part1" = { + device = "/dev/disk/by-uuid/1443-371C"; + fsType = "vfat"; + }; - fileSystems."/boot/efi" = - { device = "/boot/efis/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086-part1"; - fsType = "none"; - options = [ "bind" ]; - }; + fileSystems."/boot/efi" = { + device = "/boot/efis/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086-part1"; + fsType = "none"; + options = ["bind"]; + }; - 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/system/gospel/zfs.nix b/system/gospel/zfs.nix index e2f11a2..97f1759 100644 --- a/system/gospel/zfs.nix +++ b/system/gospel/zfs.nix @@ -1,34 +1,37 @@ -{ config, pkgs, ... }: - -{ boot.supportedFilesystems = [ "zfs" ]; +{ + config, + pkgs, + ... +}: { + boot.supportedFilesystems = ["zfs"]; networking.hostId = "f8616592"; boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; -boot.loader.efi.efiSysMountPoint = "/boot/efi"; -boot.loader.efi.canTouchEfiVariables = false; -boot.loader.generationsDir.copyKernels = true; -boot.loader.grub.efiInstallAsRemovable = true; -boot.loader.grub.enable = true; -boot.loader.grub.version = 2; -boot.loader.grub.copyKernels = true; -boot.loader.grub.efiSupport = true; -boot.loader.grub.zfsSupport = true; -boot.loader.grub.extraPrepareConfig = '' - mkdir -p /boot/efis - for i in /boot/efis/*; do mount $i ; done + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + boot.loader.efi.canTouchEfiVariables = false; + boot.loader.generationsDir.copyKernels = true; + boot.loader.grub.efiInstallAsRemovable = true; + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.copyKernels = true; + boot.loader.grub.efiSupport = true; + boot.loader.grub.zfsSupport = true; + boot.loader.grub.extraPrepareConfig = '' + mkdir -p /boot/efis + for i in /boot/efis/*; do mount $i ; done - mkdir -p /boot/efi - mount /boot/efi -''; -boot.loader.grub.extraInstallCommands = '' -ESP_MIRROR=$(mktemp -d) -cp -r /boot/efi/EFI $ESP_MIRROR -for i in /boot/efis/*; do - cp -r $ESP_MIRROR/EFI $i -done -rm -rf $ESP_MIRROR -''; -boot.loader.grub.devices = [ - "/dev/disk/by-id/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086" - ]; -users.users.root.initialHashedPassword = "$6$3Ps2Vmff.gUBkiCv$FCeCQjDvNTdWynQU81qtCXFHQht86w4unWNalUgkcyq7lkkI2klzRyTK3dZiQUjIrn8qPKtwJcY9SNdyE8v1L/"; + mkdir -p /boot/efi + mount /boot/efi + ''; + boot.loader.grub.extraInstallCommands = '' + ESP_MIRROR=$(mktemp -d) + cp -r /boot/efi/EFI $ESP_MIRROR + for i in /boot/efis/*; do + cp -r $ESP_MIRROR/EFI $i + done + rm -rf $ESP_MIRROR + ''; + boot.loader.grub.devices = [ + "/dev/disk/by-id/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086" + ]; + users.users.root.initialHashedPassword = "$6$3Ps2Vmff.gUBkiCv$FCeCQjDvNTdWynQU81qtCXFHQht86w4unWNalUgkcyq7lkkI2klzRyTK3dZiQUjIrn8qPKtwJcY9SNdyE8v1L/"; }