Skip to content

Commit

Permalink
refactor: many things
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsgirao committed Jun 8, 2024
1 parent ef72356 commit d6ce134
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 27 deletions.
54 changes: 30 additions & 24 deletions hosts/sazed/machine.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ lib, pkgs, ... }:

let
RNLCert = builtins.fetchurl {
Expand All @@ -11,7 +11,7 @@ in
boot.binfmt.emulatedSystems = [ "aarch64-linux" "i686-linux" ];

imports = [
../../modules/systemd-initrd.nix
# ../../modules/systemd-initrd.nix
#Firefox through flatpak (testing)
# Not using flatpaked firefox while this isn't solved:
# https://github.com/flatpak/flatpak/issues/4525
Expand All @@ -22,6 +22,7 @@ in

../../modules/hardware/uefi.nix
../../modules/hardware/zfs.nix
../../modules/hardware/zfs-unlock.nix

../../modules/core/lanzaboote.nix
# ../../modules/core/hardening.nix
Expand All @@ -30,6 +31,7 @@ in
../../modules/docker.nix
];

boot.kernelParams = [ "ip=193.136.164.205::193.136.164.222:255.255.255.224::eth0:none" ];
services.zfs.expandOnBoot = "all";
security.pki.certificateFiles = [ "${RNLCert}" ];
users.users.rg.extraGroups = [ "docker" ];
Expand Down Expand Up @@ -85,28 +87,32 @@ in
};


boot.initrd.systemd.emergencyAccess = true;
boot.initrd.systemd.services.rollback = {
description = "Rollback root filesystem to a pristine state on boot";
wantedBy = [
# "zfs.target"
"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 << <<"
'';
};
# boot.initrd.systemd.emergencyAccess = true;
# boot.initrd.systemd.services.rollback = {
# description = "Rollback root filesystem to a pristine state on boot";
# wantedBy = [
# # "zfs.target"
# "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 << <<"
# '';
# };

boot.initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r neonheavypool/local/root@blank
'';

environment.variables = {
QEMU_OPTS =
Expand Down
4 changes: 3 additions & 1 deletion hosts/scout/machine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
../../modules/dei.nix
];

programs.gamemode.enable = true;

services.zfs.expandOnBoot = "all";

users.users.rg.extraGroups = [ "docker" ];
users.users.rg.extraGroups = [ "docker" "gamemode" ];

rg = {
ip = "192.168.10.1";
Expand Down
2 changes: 1 addition & 1 deletion hosts/spy/machine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ in
../../modules/hardware/uefi.nix
../../modules/hardware/zfs.nix
../../modules/hardware/zfs-unlock.nix
../../modules/core/lanzaboote.nix
# ../../modules/core/lanzaboote.nix
# ../../modules/systemd-initrd.nix
# ./library.nix
# ../../modules/library/bitmagnet.nix
Expand Down
1 change: 1 addition & 0 deletions modules/hardware/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ in
{

hardware.cpu.intel.updateMicrocode = isIntel;
programs.cpu-energy-meter.enable = isIntel;

services.fwupd.enable = !isVirt;

Expand Down
2 changes: 1 addition & 1 deletion modules/nextcloud.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ in
dbname = "nextcloud";
adminpassFile = config.age.secrets.NC-adminpass.path;
adminuser = "rg";
extraTrustedDomains = [ altHost ];
};
#Use system's sendmail utility for e-mails
settings = {
trusted_domains = [ altHost ];
trusted_proxies = [ config.rg.ip "127.0.0.1" "192.168.10.9" ];
overwriteprotocol = "https";
default_phone_region = "PT";
Expand Down

0 comments on commit d6ce134

Please sign in to comment.