cleanup common configs + disable CONFIG_VT if kmscon is enabled
This commit is contained in:
@@ -21,7 +21,7 @@ flake.nix # 3 hosts, 2 channels
|
|||||||
deploy.sh # wrapper: current-host rebuild or `muffin` deploy-rs
|
deploy.sh # wrapper: current-host rebuild or `muffin` deploy-rs
|
||||||
hosts/<host>/ # host entrypoints (default.nix, home.nix, disk.nix, …)
|
hosts/<host>/ # host entrypoints (default.nix, home.nix, disk.nix, …)
|
||||||
modules/ # flat namespace; see module naming below
|
modules/ # flat namespace; see module naming below
|
||||||
common-*.nix # imported by ALL hosts (nix settings, doas, fish shim)
|
common.nix # imported by ALL hosts (nix settings, doas, fish shim)
|
||||||
desktop-*.nix # imported by mreow/yarn only
|
desktop-*.nix # imported by mreow/yarn only
|
||||||
server-*.nix # imported by muffin only
|
server-*.nix # imported by muffin only
|
||||||
<bare>.nix # scoped by filename (age-secrets, zfs, no-rgb, …)
|
<bare>.nix # scoped by filename (age-secrets, zfs, no-rgb, …)
|
||||||
|
|||||||
@@ -12,9 +12,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# common across all hosts
|
# common across all hosts
|
||||||
../../modules/common-doas.nix
|
../../modules/common.nix
|
||||||
../../modules/common-shell-fish.nix
|
|
||||||
../../modules/common-nix.nix
|
|
||||||
|
|
||||||
# muffin-only system modules
|
# muffin-only system modules
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
@@ -95,8 +93,6 @@
|
|||||||
|
|
||||||
services.deployGuard.enable = true;
|
services.deployGuard.enable = true;
|
||||||
|
|
||||||
services.kmscon.enable = true;
|
|
||||||
|
|
||||||
# Disable serial getty on ttyS0 to prevent dmesg warnings
|
# Disable serial getty on ttyS0 to prevent dmesg warnings
|
||||||
systemd.services."serial-getty@ttyS0".enable = false;
|
systemd.services."serial-getty@ttyS0".enable = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
{ username, ... }:
|
|
||||||
{
|
|
||||||
# doas replaces sudo on every host
|
|
||||||
security = {
|
|
||||||
doas.enable = true;
|
|
||||||
sudo.enable = false;
|
|
||||||
doas.extraRules = [
|
|
||||||
{
|
|
||||||
users = [ username ];
|
|
||||||
keepEnv = true;
|
|
||||||
persist = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
# Common Nix daemon settings. Host-specific overrides (binary cache substituters,
|
|
||||||
# gc retention) live in the host's default.nix.
|
|
||||||
nix = {
|
|
||||||
optimise.automatic = true;
|
|
||||||
|
|
||||||
gc = {
|
|
||||||
automatic = true;
|
|
||||||
dates = "weekly";
|
|
||||||
# Default retention: override per-host via lib.mkForce if different.
|
|
||||||
options = lib.mkDefault "--delete-older-than 30d";
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
experimental-features = [
|
|
||||||
"nix-command"
|
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{ pkgs, lib, ... }:
|
|
||||||
{
|
|
||||||
# https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
|
|
||||||
# Login shells stay bash but immediately `exec fish` so fish is the effective shell
|
|
||||||
# without breaking scripts that hardcode #!/bin/bash.
|
|
||||||
programs.fish.enable = true;
|
|
||||||
programs.bash = {
|
|
||||||
interactiveShellInit = ''
|
|
||||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
|
||||||
then
|
|
||||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
|
||||||
exec ${lib.getExe pkgs.fish} $LOGIN_OPTION
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
57
modules/common.nix
Normal file
57
modules/common.nix
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
# Common Nix daemon settings. Host-specific overrides (binary cache substituters,
|
||||||
|
# gc retention) live in the host's default.nix.
|
||||||
|
nix = {
|
||||||
|
optimise.automatic = true;
|
||||||
|
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "weekly";
|
||||||
|
# Default retention: override per-host via lib.mkForce if different.
|
||||||
|
options = lib.mkDefault "--delete-older-than 30d";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# doas replaces sudo on every host
|
||||||
|
security = {
|
||||||
|
doas.enable = true;
|
||||||
|
sudo.enable = false;
|
||||||
|
doas.extraRules = [
|
||||||
|
{
|
||||||
|
users = [ username ];
|
||||||
|
keepEnv = true;
|
||||||
|
persist = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
|
||||||
|
# Login shells stay bash but immediately `exec fish` so fish is the effective shell
|
||||||
|
# without breaking scripts that hardcode #!/bin/bash.
|
||||||
|
programs.fish.enable = true;
|
||||||
|
programs.bash = {
|
||||||
|
interactiveShellInit = ''
|
||||||
|
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||||
|
then
|
||||||
|
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||||
|
exec ${lib.getExe pkgs.fish} $LOGIN_OPTION
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.kmscon.enable = true;
|
||||||
|
}
|
||||||
@@ -10,10 +10,7 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# shared across all hosts
|
./common.nix
|
||||||
./common-doas.nix
|
|
||||||
./common-shell-fish.nix
|
|
||||||
./common-nix.nix
|
|
||||||
|
|
||||||
# desktop-only modules
|
# desktop-only modules
|
||||||
./desktop-vm.nix
|
./desktop-vm.nix
|
||||||
@@ -34,8 +31,6 @@
|
|||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
hardware.cpu.amd.updateMicrocode = true;
|
hardware.cpu.amd.updateMicrocode = true;
|
||||||
|
|
||||||
services.kmscon.enable = true;
|
|
||||||
|
|
||||||
# Add niri to display manager session packages
|
# Add niri to display manager session packages
|
||||||
services.displayManager.sessionPackages = [ niri-package ];
|
services.displayManager.sessionPackages = [ niri-package ];
|
||||||
|
|
||||||
@@ -255,6 +250,8 @@
|
|||||||
SGETMASK_SYSCALL = lib.mkForce no;
|
SGETMASK_SYSCALL = lib.mkForce no;
|
||||||
UID16 = lib.mkForce no;
|
UID16 = lib.mkForce no;
|
||||||
X86_X32_ABI = lib.mkForce no;
|
X86_X32_ABI = lib.mkForce no;
|
||||||
|
|
||||||
|
VT = lib.mkForce (!config.services.kmscon.enable);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user