Modify Lenovo and add iwd to persistence
This commit is contained in:
parent
15ab10152b
commit
f80f0dd53d
|
@ -82,7 +82,7 @@
|
||||||
|
|
||||||
shuttle = mkNix [ ./hosts/shuttleworth/system ]; # Pinebook Pro
|
shuttle = mkNix [ ./hosts/shuttleworth/system ]; # Pinebook Pro
|
||||||
lacros = mkNix [ ./hosts/lacros/system ]; # Dell Chromebook
|
lacros = mkNix [ ./hosts/lacros/system ]; # Dell Chromebook
|
||||||
redmond = mkNix [ ./hosts/redmond/system ]; # Lenovo Laptop
|
redmond = mkNix [ ./hosts/redmond ]; # Lenovo Dual-Boot Laptop
|
||||||
treefruit = mkNix [ ./hosts/treefruit/system ]; # Macbook Pro 14,1
|
treefruit = mkNix [ ./hosts/treefruit/system ]; # Macbook Pro 14,1
|
||||||
|
|
||||||
cyberspark = mkNix [ ./hosts/cyberspark/system ]; # Dell Optiplex 7010
|
cyberspark = mkNix [ ./hosts/cyberspark/system ]; # Dell Optiplex 7010
|
||||||
|
|
40
hosts/redmond/boot/default.nix
Normal file
40
hosts/redmond/boot/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
boot = {
|
||||||
|
kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
kernel.sysctl."vm.max_map_count" = 2147483642;
|
||||||
|
|
||||||
|
initrd = {
|
||||||
|
systemd = {
|
||||||
|
enable = true;
|
||||||
|
services.root-reset = {
|
||||||
|
description = "Reset BTRFS root and snapshot last boot";
|
||||||
|
wantedBy = [ "initrd.target" ];
|
||||||
|
after = [ "dev-nixos-root.device" ];
|
||||||
|
before = [ "sysroot.mount" ];
|
||||||
|
unitConfig.DefaultDependencies = "no";
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
script = ''
|
||||||
|
mkdir -p /mnt
|
||||||
|
mount /dev/nixos/root /mnt
|
||||||
|
|
||||||
|
if [[ -e /mnt/@prev ]]; then
|
||||||
|
btrfs subvolume delete /mnt/@prev
|
||||||
|
fi
|
||||||
|
|
||||||
|
btrfs subvolume snapshot /mnt/@ /mnt/@prev
|
||||||
|
|
||||||
|
btrfs subvolume list -o /mnt/@ | cut -f9 -d' ' | while read subvolume; do
|
||||||
|
btrfs subvolume delete "/mnt/$subvolume"
|
||||||
|
done
|
||||||
|
|
||||||
|
btrfs subvolume delete /mnt/@
|
||||||
|
btrfs subvolume create /mnt/@
|
||||||
|
|
||||||
|
umount /mnt
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
29
hosts/redmond/default.nix
Normal file
29
hosts/redmond/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./boot
|
||||||
|
./disko
|
||||||
|
./hardware
|
||||||
|
|
||||||
|
# Apps and programs
|
||||||
|
../../modules/system
|
||||||
|
../../modules/system/accounts
|
||||||
|
../../modules/system/desktop
|
||||||
|
../../modules/system/programs
|
||||||
|
../../modules/system/services
|
||||||
|
|
||||||
|
# Devices and hardware
|
||||||
|
../../modules/system/devices
|
||||||
|
../../modules/system/devices/boot/systemd
|
||||||
|
../../modules/system/devices/networking/wireless
|
||||||
|
../../modules/system/devices/networking/firewall/pc
|
||||||
|
../../modules/system/devices/networking/wireguard/pc
|
||||||
|
|
||||||
|
# Extras
|
||||||
|
../../overlays
|
||||||
|
../../variables
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.hostName = "redmond";
|
||||||
|
networking.wireguard.interfaces."${config.ips.wgInt}".ips = [ "${config.ips.wgSpan}.20/24" ];
|
||||||
|
}
|
95
hosts/redmond/disko/default.nix
Normal file
95
hosts/redmond/disko/default.nix
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
{ disko, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
disko.nixosModules.disko
|
||||||
|
];
|
||||||
|
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/sda";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "2G";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = [ "fmask=0022" "dmask=0022" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
luks = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "crypt-hdd";
|
||||||
|
settings.allowDiscards = true;
|
||||||
|
#passwordFile = "/tmp/secret.key";
|
||||||
|
content = {
|
||||||
|
type = "lvm_pv";
|
||||||
|
vg = "nixos";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
lvm_vg = {
|
||||||
|
nixos = {
|
||||||
|
type = "lvm_vg";
|
||||||
|
lvs = {
|
||||||
|
root = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = [ "-f" ];
|
||||||
|
subvolumes = {
|
||||||
|
"/@" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
};
|
||||||
|
"/@prev" = {
|
||||||
|
mountpoint = "/prev";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
};
|
||||||
|
"/@nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Impermanence
|
||||||
|
"/@root" = {
|
||||||
|
mountpoint = "/persist";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
};
|
||||||
|
"/@jimbo" = {
|
||||||
|
mountpoint = "/persist/home/jimbo";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
swap = {
|
||||||
|
size = "8G";
|
||||||
|
content = {
|
||||||
|
type = "swap";
|
||||||
|
discardPolicy = "both";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Needed for impermanence
|
||||||
|
fileSystems = {
|
||||||
|
"/persist".neededForBoot = true;
|
||||||
|
"/persist/home/jimbo".neededForBoot = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -16,15 +16,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/" = {
|
|
||||||
device = "/dev/disk/by-uuid/c0fe8419-88f9-48a0-8c5b-acd4c11f8037";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
"/boot" = {
|
|
||||||
device = "/dev/disk/by-uuid/BF2B-9AE0";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [ "fmask=0022" "dmask=0022" ];
|
|
||||||
};
|
|
||||||
"/home/jimbo/JimboNFS" = {
|
"/home/jimbo/JimboNFS" = {
|
||||||
device = "${config.ips.wgSpan}.1:/export/JimboNFS";
|
device = "${config.ips.wgSpan}.1:/export/JimboNFS";
|
||||||
fsType = "nfs4";
|
fsType = "nfs4";
|
|
@ -1,8 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
../../../modules/home
|
|
||||||
../../../modules/home/programs/misc/gaming/launchers
|
|
||||||
../../../modules/home/programs/misc/remote-desktop
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
boot = {
|
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
kernel.sysctl."vm.max_map_count" = 2147483642;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware
|
|
||||||
./boot
|
|
||||||
|
|
||||||
# Apps and programs
|
|
||||||
../../../modules/system
|
|
||||||
../../../modules/system/accounts
|
|
||||||
../../../modules/system/desktop
|
|
||||||
../../../modules/system/programs
|
|
||||||
../../../modules/system/services
|
|
||||||
|
|
||||||
# Devices and hardware
|
|
||||||
../../../modules/system/devices
|
|
||||||
../../../modules/system/devices/boot/systemd
|
|
||||||
../../../modules/system/devices/networking/wireless
|
|
||||||
../../../modules/system/devices/networking/firewall/pc
|
|
||||||
../../../modules/system/devices/networking/wireguard/pc
|
|
||||||
|
|
||||||
# Extras
|
|
||||||
../../../overlays
|
|
||||||
../../../variables
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.hostName = "redmond";
|
|
||||||
networking.wireguard.interfaces."${config.ips.wgInt}".ips = [ "${config.ips.wgSpan}.20/24" ];
|
|
||||||
}
|
|
|
@ -11,6 +11,7 @@
|
||||||
"/var/lib/mpd"
|
"/var/lib/mpd"
|
||||||
"/var/lib/nixos"
|
"/var/lib/nixos"
|
||||||
"/var/lib/fail2ban"
|
"/var/lib/fail2ban"
|
||||||
|
"/var/lib/iwd/"
|
||||||
"/var/lib/systemd/coredump"
|
"/var/lib/systemd/coredump"
|
||||||
];
|
];
|
||||||
files = [
|
files = [
|
||||||
|
|
Loading…
Reference in a new issue