Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Fix statix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosuavio committed Feb 4, 2024
1 parent 7b6f92b commit 50331d7
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 86 deletions.
59 changes: 32 additions & 27 deletions module/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,39 @@ in
];

config = {
boot.loader.systemd-boot.enable = lib.mkForce false;
boot = {
supportedFilesystems = [ "zfs" ];

boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot/";
};
loader = {
# Needed to enable lanzaboote
systemd-boot.enable = lib.mkForce false;

nixpkgs.config.allowUnfree = true;
# TODO 2020.01.24 (RP) - Find a way to change the esp to "/esp"
efi = {
# efiSysMountPoint = "/boot/efi";
canTouchEfiVariables = true;
};

boot = {
supportedFilesystems = [ "zfs" ];
initrd.supportedFilesystems = [ "zfs" ];
timeout = null;
};

initrd = {
supportedFilesystems = [ "zfs" ];
systemd.enable = true;
};

lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot/";
};

# Broken: Shows a spinner when asking for encryption password
# Can still input the password but there is no visual inducation or feedback
# boot.plymouth.enable = true;
# plymouth.enable = true;
};

nixpkgs.config.allowUnfree = true;

hardware = {
enableAllFirmware = true;
enableRedistributableFirmware = true;
Expand All @@ -75,12 +90,14 @@ in
pulseaudio.enable = false;
};

security.polkit.enable = true;
security.pam.services.swaylock = { };
security = {
tpm2 = {
enable = true;
tctiEnvironment.enable = true;
};

security.tpm2 = {
enable = true;
tctiEnvironment.enable = true;
pam.services.swaylock = { };
polkit.enable = true;
};

environment.persistence."/persist" = {
Expand Down Expand Up @@ -225,18 +242,6 @@ in

services.dbus.packages = [ pkgs.dconf ];

# TODO 2020.01.24 (RP) - Find a way to change the esp to "/esp"
boot.loader = {
efi = {
# efiSysMountPoint = "/boot/efi";
canTouchEfiVariables = true;
};

timeout = null;
};

boot.initrd.systemd.enable = true;

networking.networkmanager.enable = true;

services.avahi = {
Expand Down
72 changes: 37 additions & 35 deletions module/polaris.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,65 +18,67 @@ in
./default.nix
];

boot.kernelModules = [ "kvm-amd" ];
boot = {
initrd = {
availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ];

systemd.services.rollback = {
description = "Rollback ZFS datasets to a pristine state";
wantedBy = [
"initrd.target"
];
after = [
"zfs-import-mainpool.service"
];
before = [
"sysroot.mount"
];
path = with pkgs; [
zfs
];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
zfs rollback -r mainpool/local/root@blank && echo "rollback complete"
'';
};
};

kernelModules = [ "kvm-amd" ];
plymouth.enable = true;
zfs.forceImportRoot = false;
};


boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ];

fileSystems."/" =
{
fileSystems = {
"/" = {
device = "mainpool/local/root";
fsType = "zfs";
};

fileSystems."/nix" =
{
"/nix" = {
device = "mainpool/local/nix";
fsType = "zfs";
};

fileSystems."/home" =
{
"/home" = {
device = "mainpool/safe/home";
fsType = "zfs";
};

fileSystems."/persist" =
{
"/persist" = {
device = "mainpool/safe/persist";
fsType = "zfs";
neededForBoot = true;
};

fileSystems."/boot" =
{
"/boot" = {
device = "/dev/disk/by-uuid/7825-1D31";
fsType = "vfat";
};

boot.initrd.systemd.services.rollback = {
description = "Rollback ZFS datasets to a pristine state";
wantedBy = [
"initrd.target"
];
after = [
"zfs-import-mainpool.service"
];
before = [
"sysroot.mount"
];
path = with pkgs; [
zfs
];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
zfs rollback -r mainpool/local/root@blank && echo "rollback complete"
'';
};

boot.plymouth.enable = true;
boot.zfs.forceImportRoot = false;

hardware = {
openrazer = {
enable = true;
Expand Down
52 changes: 28 additions & 24 deletions module/pulsar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,34 @@ in
./default.nix
];

boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "kvm-intel" ];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];

systemd.services.rollback = {
description = "Rollback ZFS datasets to a pristine state";
wantedBy = [
"initrd.target"
];
after = [
"zfs-import-zpool.service"
];
before = [
"sysroot.mount"
];
path = with pkgs; [
zfs
];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
zfs rollback -r zpool/local/root@blank && echo "rollback complete"
'';
};

kernelModules = [ "kvm-intel" ];
};
};

fileSystems = {
"/" = {
Expand All @@ -39,28 +65,6 @@ in
};
};

boot.initrd.systemd.services.rollback = {
description = "Rollback ZFS datasets to a pristine state";
wantedBy = [
"initrd.target"
];
after = [
"zfs-import-zpool.service"
];
before = [
"sysroot.mount"
];
path = with pkgs; [
zfs
];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
zfs rollback -r zpool/local/root@blank && echo "rollback complete"
'';
};


powerManagement.cpuFreqGovernor = "powersave";

# TODO: Validate I want the effects of this.
Expand Down

0 comments on commit 50331d7

Please sign in to comment.