refactoring for iServer and isWorkstation: part 3
This commit is contained in:
parent
021ab24e79
commit
6addea64c4
36 changed files with 236 additions and 227 deletions
|
|
@ -2,11 +2,7 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
# Host-common imports
|
||||
../common
|
||||
# Server-common imports
|
||||
./common
|
||||
# Host-specific imports
|
||||
./modules
|
||||
./alexandria
|
||||
];
|
||||
|
||||
|
|
@ -33,8 +33,6 @@
|
|||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
cml-ucm-conf = pkgs.alsa-ucm-conf.overrideAttrs {
|
||||
wttsrc = pkgs.fetchFromGitHub {
|
||||
owner = "WeirdTreeThing";
|
||||
repo = "chromebook-ucm-conf";
|
||||
rev = "b6ce2a7";
|
||||
hash = "sha256-QRUKHd3RQmg1tnZU8KCW0AmDtfw/daOJ/H3XU5qWTCc=";
|
||||
};
|
||||
postInstall = ''
|
||||
echo "v0.4.1" > $out/chromebook.patched
|
||||
cp -R $wttsrc/{common,codecs,platforms} $out/share/alsa/ucm2
|
||||
cp -R $wttsrc/{cml,sof-rt5682} $out/share/alsa/ucm2/conf.d
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../modules
|
||||
# Host-specific imports
|
||||
./io
|
||||
];
|
||||
|
||||
networking.hostName = "io";
|
||||
|
||||
nix.nixPath = [ "nixos-config=${./io.nix}" ];
|
||||
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
memoryPercent = 100;
|
||||
};
|
||||
|
||||
boot = {
|
||||
# TODO check if future kernel versions fix boot issue with systemd initrd with tpm
|
||||
initrd.systemd.tpm2.enable = false;
|
||||
kernelParams = [
|
||||
"nosgx"
|
||||
"i915.fastboot=1"
|
||||
"mem_sleep_default=deep"
|
||||
];
|
||||
extraModprobeConfig = ''
|
||||
options snd-intel-dspcfg dsp_driver=3
|
||||
'';
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
maliit-keyboard
|
||||
sof-firmware
|
||||
];
|
||||
sessionVariables.ALSA_CONFIG_UCM2 = "${cml-ucm-conf}/share/alsa/ucm2";
|
||||
};
|
||||
|
||||
# TODO: remove once gmodena/nix-flatpak/issues/45 fixed
|
||||
systemd.services."flatpak-managed-install" = {
|
||||
serviceConfig = {
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/sleep 5";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
keyd = {
|
||||
enable = true;
|
||||
keyboards.main = {
|
||||
ids = [ "0001:0001" ];
|
||||
settings = {
|
||||
main = {
|
||||
meta = "overload(meta, esc)";
|
||||
f1 = "back";
|
||||
f2 = "forward";
|
||||
f3 = "refresh";
|
||||
f4 = "M-f11";
|
||||
f5 = "M-w";
|
||||
f6 = "brightnessdown";
|
||||
f7 = "brightnessup";
|
||||
f8 = "timeout(mute, 200, micmute)";
|
||||
f9 = "play";
|
||||
f10 = "timeout(nextsong, 200, previoussong)";
|
||||
f13 = "delete";
|
||||
"102nd" = "layer(function)";
|
||||
};
|
||||
shift = {
|
||||
leftshift = "capslock";
|
||||
rightshift = "capslock";
|
||||
};
|
||||
function = {
|
||||
escape = "f1";
|
||||
f1 = "f2";
|
||||
f2 = "f3";
|
||||
f3 = "f4";
|
||||
f4 = "f5";
|
||||
f5 = "f6";
|
||||
f6 = "f7";
|
||||
f7 = "f8";
|
||||
f8 = "f9";
|
||||
f9 = "f10";
|
||||
f10 = "f11";
|
||||
f13 = "f12";
|
||||
y = "sysrq";
|
||||
k = "home";
|
||||
l = "pageup";
|
||||
"," = "end";
|
||||
"." = "pagedown";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
qubesnsh = pkgs.writeTextFile {
|
||||
name = "qubes.nsh";
|
||||
text = "HD1f65535a1:EFI\\qubes\\grubx64.efi";
|
||||
};
|
||||
|
||||
reboot-into-qubes = pkgs.makeDesktopItem {
|
||||
name = "reboot-into-qubes";
|
||||
icon = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/vinceliuice/Qogir-icon-theme/31f267e1f5fd4e9596bfd78dfb41a03d3a9f33ee/src/scalable/apps/distributor-logo-qubes.svg";
|
||||
sha256 = "sha256-QbHr7s5Wcs7uFtfqZctMyS0iDbMfiiZOKy2nHhDOfn0=";
|
||||
};
|
||||
desktopName = "Qubes OS";
|
||||
genericName = "Reboot into Qubes OS";
|
||||
categories = [ "System" ];
|
||||
startupNotify = true;
|
||||
exec = pkgs.writeShellScript "reboot-into-qubes" ''
|
||||
${pkgs.yad}/bin/yad --form \
|
||||
--title="Qubes OS" \
|
||||
--image distributor-logo-qubes \
|
||||
--text "Are you sure you want to reboot into Qubes OS?" \
|
||||
--button="Yes:0" --button="Cancel:1"
|
||||
if [ $? -eq 0 ]; then
|
||||
systemctl reboot --boot-loader-entry=qubes.conf
|
||||
fi
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./rotterdam
|
||||
../modules
|
||||
];
|
||||
|
||||
networking.hostName = "rotterdam";
|
||||
|
||||
services = {
|
||||
flatpak.packages = [ "net.retrodeck.retrodeck" ];
|
||||
keyd = {
|
||||
enable = true;
|
||||
keyboards.main = {
|
||||
ids = [ "5653:0001" ];
|
||||
settings.main = {
|
||||
esc = "overload(meta, esc)";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [ reboot-into-qubes ];
|
||||
|
||||
hardware = {
|
||||
amdgpu = {
|
||||
opencl.enable = true;
|
||||
amdvlk.enable = true;
|
||||
};
|
||||
graphics.extraPackages = with pkgs; [ rocmPackages.clr.icd ];
|
||||
};
|
||||
|
||||
systemd.targets.hibernate.enable = false; # disable non-functional hibernate
|
||||
|
||||
nix.nixPath = [ "nixos-config=${./rotterdam.nix}" ];
|
||||
|
||||
boot = {
|
||||
kernelParams = [
|
||||
"processor.max_cstate=1" # Fixes bug where ryzen cpus freeze when in highest C state
|
||||
"clearcpuid=514"
|
||||
# Fixes amdgpu freezing
|
||||
"amdgpu.noretry=0"
|
||||
"amdgpu.ppfeaturemask=0xfffd3fff"
|
||||
"amdgpu.gpu_recovery=1"
|
||||
"amdgpu.lockup_timeout=1000"
|
||||
];
|
||||
# QubesOS boot entry
|
||||
loader.systemd-boot = {
|
||||
extraFiles = {
|
||||
"efi/edk2-shell/shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi";
|
||||
"qubes.nsh" = qubesnsh;
|
||||
};
|
||||
extraEntries."qubes.conf" = ''
|
||||
title Qubes OS
|
||||
efi /efi/edk2-shell/shell.efi
|
||||
options -nointerrupt qubes.nsh
|
||||
sort-key ab
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
programs.steam.dedicatedServer.openFirewall = true;
|
||||
}
|
||||
12
hosts/io.nix
Normal file
12
hosts/io.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "io";
|
||||
|
||||
imports = [
|
||||
./modules
|
||||
./io
|
||||
];
|
||||
|
||||
nix.nixPath = [ "nixos-config=${./io.nix}" ];
|
||||
}
|
||||
16
hosts/io/boot.nix
Normal file
16
hosts/io/boot.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
boot = {
|
||||
# TODO check if future kernel versions fix boot issue with systemd initrd with tpm
|
||||
initrd.systemd.tpm2.enable = false;
|
||||
kernelParams = [
|
||||
"nosgx"
|
||||
"i915.fastboot=1"
|
||||
"mem_sleep_default=deep"
|
||||
];
|
||||
extraModprobeConfig = ''
|
||||
options snd-intel-dspcfg dsp_driver=3
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./boot
|
||||
./ephermal.nix
|
||||
./hardware-configuration.nix
|
||||
./programs.nix
|
||||
./services.nix
|
||||
];
|
||||
}
|
||||
34
hosts/io/programs.nix
Normal file
34
hosts/io/programs.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
cml-ucm-conf = pkgs.alsa-ucm-conf.overrideAttrs {
|
||||
wttsrc = pkgs.fetchFromGitHub {
|
||||
owner = "WeirdTreeThing";
|
||||
repo = "chromebook-ucm-conf";
|
||||
rev = "b6ce2a7";
|
||||
hash = "sha256-QRUKHd3RQmg1tnZU8KCW0AmDtfw/daOJ/H3XU5qWTCc=";
|
||||
};
|
||||
postInstall = ''
|
||||
echo "v0.4.1" > $out/chromebook.patched
|
||||
cp -R $wttsrc/{common,codecs,platforms} $out/share/alsa/ucm2
|
||||
cp -R $wttsrc/{cml,sof-rt5682} $out/share/alsa/ucm2/conf.d
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
maliit-keyboard
|
||||
sof-firmware
|
||||
];
|
||||
sessionVariables.ALSA_CONFIG_UCM2 = "${cml-ucm-conf}/share/alsa/ucm2";
|
||||
};
|
||||
|
||||
# TODO: remove once gmodena/nix-flatpak/issues/45 fixed
|
||||
systemd.services."flatpak-managed-install" = {
|
||||
serviceConfig = {
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/sleep 5";
|
||||
};
|
||||
};
|
||||
}
|
||||
52
hosts/io/services.nix
Normal file
52
hosts/io/services.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services = {
|
||||
keyd = {
|
||||
enable = true;
|
||||
keyboards.main = {
|
||||
ids = [ "0001:0001" ];
|
||||
settings = {
|
||||
main = {
|
||||
meta = "overload(meta, esc)";
|
||||
f1 = "back";
|
||||
f2 = "forward";
|
||||
f3 = "refresh";
|
||||
f4 = "M-f11";
|
||||
f5 = "M-w";
|
||||
f6 = "brightnessdown";
|
||||
f7 = "brightnessup";
|
||||
f8 = "timeout(mute, 200, micmute)";
|
||||
f9 = "play";
|
||||
f10 = "timeout(nextsong, 200, previoussong)";
|
||||
f13 = "delete";
|
||||
"102nd" = "layer(function)";
|
||||
};
|
||||
shift = {
|
||||
leftshift = "capslock";
|
||||
rightshift = "capslock";
|
||||
};
|
||||
function = {
|
||||
escape = "f1";
|
||||
f1 = "f2";
|
||||
f2 = "f3";
|
||||
f3 = "f4";
|
||||
f4 = "f5";
|
||||
f5 = "f6";
|
||||
f6 = "f7";
|
||||
f7 = "f8";
|
||||
f8 = "f9";
|
||||
f9 = "f10";
|
||||
f10 = "f11";
|
||||
f13 = "f12";
|
||||
y = "sysrq";
|
||||
k = "home";
|
||||
l = "pageup";
|
||||
"," = "end";
|
||||
"." = "pagedown";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -25,13 +25,6 @@
|
|||
compositor = "kwin";
|
||||
};
|
||||
};
|
||||
keyd = {
|
||||
enable = true;
|
||||
keyboards.all = {
|
||||
ids = [ "*" ];
|
||||
settings.main.capslock = "overload(meta, esc)";
|
||||
};
|
||||
};
|
||||
desktopManager.plasma6.enable = true;
|
||||
pipewire = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,13 @@
|
|||
services = {
|
||||
printing.enable = true;
|
||||
udev.packages = with pkgs; [ yubikey-personalization ];
|
||||
keyd = {
|
||||
enable = true;
|
||||
keyboards.all = {
|
||||
ids = [ "*" ];
|
||||
settings.main.capslock = "overload(meta, esc)";
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
|
|
|
|||
12
hosts/rotterdam.nix
Normal file
12
hosts/rotterdam.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "rotterdam";
|
||||
|
||||
imports = [
|
||||
./rotterdam
|
||||
./modules
|
||||
];
|
||||
|
||||
nix.nixPath = [ "nixos-config=${./rotterdam.nix}" ];
|
||||
}
|
||||
35
hosts/rotterdam/boot.nix
Normal file
35
hosts/rotterdam/boot.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
qubesnsh = pkgs.writeTextFile {
|
||||
name = "qubes.nsh";
|
||||
text = "HD1f65535a1:EFI\\qubes\\grubx64.efi";
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
boot = {
|
||||
kernelParams = [
|
||||
"processor.max_cstate=1" # Fixes bug where ryzen cpus freeze when in highest C state
|
||||
"clearcpuid=514"
|
||||
# Fixes amdgpu freezing
|
||||
"amdgpu.noretry=0"
|
||||
"amdgpu.ppfeaturemask=0xfffd3fff"
|
||||
"amdgpu.gpu_recovery=1"
|
||||
"amdgpu.lockup_timeout=1000"
|
||||
];
|
||||
# QubesOS boot entry
|
||||
loader.systemd-boot = {
|
||||
extraFiles = {
|
||||
"efi/edk2-shell/shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi";
|
||||
"qubes.nsh" = qubesnsh;
|
||||
};
|
||||
extraEntries."qubes.conf" = ''
|
||||
title Qubes OS
|
||||
efi /efi/edk2-shell/shell.efi
|
||||
options -nointerrupt qubes.nsh
|
||||
sort-key ab
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -2,7 +2,11 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./boot.nix
|
||||
./ephermal.nix
|
||||
./hardware-configuration.nix
|
||||
./hardware.nix
|
||||
./programs.nix
|
||||
./services.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -72,17 +72,7 @@
|
|||
"compress=zstd"
|
||||
];
|
||||
};
|
||||
"/swap" = {
|
||||
device = "/dev/disk/by-uuid/3287dbc3-c0fa-4096-a0b3-59b017cfecc8";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@swap"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [ { device = "/swap/swapfile"; } ];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
13
hosts/rotterdam/hardware.nix
Normal file
13
hosts/rotterdam/hardware.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
hardware = {
|
||||
amdgpu = {
|
||||
opencl.enable = true;
|
||||
amdvlk.enable = true;
|
||||
};
|
||||
graphics.extraPackages = with pkgs; [ rocmPackages.clr.icd ];
|
||||
};
|
||||
|
||||
systemd.targets.hibernate.enable = false; # disable non-functional hibernate
|
||||
}
|
||||
33
hosts/rotterdam/programs.nix
Normal file
33
hosts/rotterdam/programs.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
reboot-into-qubes = pkgs.makeDesktopItem {
|
||||
name = "reboot-into-qubes";
|
||||
icon = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/vinceliuice/Qogir-icon-theme/31f267e1f5fd4e9596bfd78dfb41a03d3a9f33ee/src/scalable/apps/distributor-logo-qubes.svg";
|
||||
sha256 = "sha256-QbHr7s5Wcs7uFtfqZctMyS0iDbMfiiZOKy2nHhDOfn0=";
|
||||
};
|
||||
desktopName = "Qubes OS";
|
||||
genericName = "Reboot into Qubes OS";
|
||||
categories = [ "System" ];
|
||||
startupNotify = true;
|
||||
exec = pkgs.writeShellScript "reboot-into-qubes" ''
|
||||
${pkgs.yad}/bin/yad --form \
|
||||
--title="Qubes OS" \
|
||||
--image distributor-logo-qubes \
|
||||
--text "Are you sure you want to reboot into Qubes OS?" \
|
||||
--button="Yes:0" --button="Cancel:1"
|
||||
if [ $? -eq 0 ]; then
|
||||
systemctl reboot --boot-loader-entry=qubes.conf
|
||||
fi
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
environment.systemPackages = [ reboot-into-qubes ];
|
||||
|
||||
services.flatpak.packages = [ "net.retrodeck.retrodeck" ];
|
||||
|
||||
programs.steam.dedicatedServer.openFirewall = true;
|
||||
}
|
||||
13
hosts/rotterdam/services.nix
Normal file
13
hosts/rotterdam/services.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.keyd = {
|
||||
enable = true;
|
||||
keyboards.main = {
|
||||
ids = [ "5653:0001" ];
|
||||
settings.main = {
|
||||
esc = "overload(meta, esc)";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue