Add usb-persist config

This commit is contained in:
Alexander Bantyev 2021-11-23 11:33:00 +03:00
parent 55252de50a
commit 832cd29f91
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
9 changed files with 120 additions and 27 deletions

View File

@ -0,0 +1,57 @@
{ lib, inputs, pkgs, config, ... }: {
imports = with inputs.self.nixosModules; with inputs.self.nixosProfiles; [
./hardware-configuration.nix
inputs.self.nixosRoles.base
themes
fonts
gtk
sway
i3blocks
himalaya
bluetooth
simple-osd-daemons
alacritty
firefox
emacs
];
deviceSpecific.devInfo = {
cpu = {
vendor = "intel";
clock = 2000;
cores = 2;
};
drive = {
type = "ssd";
speed = 6000;
size = 16;
};
bigScreen = false;
ram = 2;
};
networking.wireless.enable = lib.mkForce false;
services.openssh.permitRootLogin = lib.mkForce "no";
services.getty.autologinUser = lib.mkForce "balsoft";
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
boot.supportedFilesystems = lib.mkForce [ "ext4" "vfat" ];
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.loader.grub = {
enable = lib.mkForce true;
devices = [ "/dev/sdc" ];
};
persist = {
enable = true;
};
defaultApplications = {
monitor.cmd = "${pkgs.alacritty}/bin/alacritty -e top";
};
startupApplications = [ config.defaultApplications.browser.cmd ];
}

View File

@ -0,0 +1,31 @@
# 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" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/persist" =
{ device = "/dev/disk/by-uuid/315c1e94-7395-4a7e-ada8-40e3409f1a2b";
fsType = "ext4";
neededForBoot = true;
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/08B0-2766";
fsType = "vfat";
};
swapDevices = [ ];
# high-resolution display
hardware.video.hidpi.enable = lib.mkDefault false;
}

View File

@ -0,0 +1 @@
x86_64-linux

13
profiles/bluetooth.nix Normal file
View File

@ -0,0 +1,13 @@
{ pkgs, lib, ... }: {
hardware.bluetooth = {
enable = true;
package = pkgs.bluezFull;
};
systemd.services.bluetooth.serviceConfig.ExecStart = lib.mkForce [
""
"${pkgs.bluezFull}/libexec/bluetooth/bluetoothd -f /etc/bluetooth/main.conf -E"
];
persist.state.directories = [ "/var/lib/bluetooth" ];
}

View File

@ -2,7 +2,7 @@
boot = {
loader = {
timeout = lib.mkForce 4;
grub.enable = lib.mkForce false;
grub.enable = false;
systemd-boot.enable = pkgs.system == "x86_64-linux";
};
kernelParams = [ "quiet" "scsi_mod.use_blk_mq=1" "modeset" "nofb" ]

View File

@ -1,31 +1,6 @@
{ pkgs, config, lib, inputs, ... }:
with rec { inherit (config) device deviceSpecific; };
with deviceSpecific; {
{
hardware.enableRedistributableFirmware = true; # For some unfree drivers
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true; # For steam
hardware.opengl.package = pkgs.mesa_drivers;
hardware.bluetooth = {
enable = true;
package = pkgs.bluezFull;
};
systemd.services.bluetooth.serviceConfig.ExecStart = lib.mkForce [ "" "${pkgs.bluezFull}/libexec/bluetooth/bluetoothd -f /etc/bluetooth/main.conf -E" ];
persist.state.directories = [ "/var/lib/bluetooth" ];
systemd.services.systemd-udev-settle.enable = false;
services.upower = { enable = true; };
services.logind.lidSwitchExternalPower = "ignore";
services.logind.extraConfig = "HandlePowerKey=suspend";
services.fwupd.enable = true;
# sound.enable = true;
}

6
profiles/opengl.nix Normal file
View File

@ -0,0 +1,6 @@
{ pkgs, ... }: {
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true; # For steam
hardware.opengl.package = pkgs.mesa_drivers;
}

7
profiles/power.nix Normal file
View File

@ -0,0 +1,7 @@
{
services.upower = { enable = true; };
services.logind.lidSwitchExternalPower = "ignore";
services.logind.extraConfig = "HandlePowerKey=suspend";
}

View File

@ -9,6 +9,9 @@
# PROFILES
applications-setup
bluetooth
power
opengl
hardware
sound
virtualisation