Add new machine Marid.

This commit is contained in:
Kevin Baensch 2021-11-25 22:03:04 +01:00
parent e8f26ac86e
commit 47500b78e3
Signed by: derped
GPG key ID: C0F1D326C7626543
6 changed files with 175 additions and 3 deletions

View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
services.cron.enable = false;
networking.dhcpcd.extraConfig = "noarp";
system.stateVersion = "21.05";
}

View file

@ -0,0 +1,79 @@
{ config, pkgs, modulesPath, ... }:
let
cfg = config.machine;
in {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
loader.systemd-boot = {
enable = true;
};
loader.efi.canTouchEfiVariables = true;
tmpOnTmpfs = true;
cleanTmpDir = true;
kernelPackages = pkgs.linuxPackages_latest;
initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
kernelModules = [ "kvm-amd" ];
kernelParams = [
# get backlight service to work part one (fixes systemd backlight service)
"acpi_backlight=native"
];
kernel.sysctl = {
"kernel.nmi_watchdog" = 0;
"fs.inotify.max_user_watches" = 524288;
"vm.dirty_writeback_centisecs" = 1500;
};
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/cf8db7d5-5da7-4fb9-818d-ed5dd2815f0d";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/96E4-9DF3";
fsType = "vfat";
};
hardware = {
firmware = with pkgs; [ firmwareLinuxNonfree ];
enableAllFirmware = true;
ksm.enable = true;
opengl = {
driSupport = true;
driSupport32Bit = true;
};
pulseaudio = {
enable = true;
support32Bit = true;
package = pkgs.pulseaudioFull;
zeroconf.discovery.enable = false;
extraClientConf = ''
autospawn = no
'';
};
bluetooth = {
enable = true;
powerOnBoot = true;
};
};
powerManagement = {
enable = true;
cpuFreqGovernor = "powersave";
};
services = {
upower.enable = true;
# Fix Backlight Part 2 (allows acpilight to modify brightness)
udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod 664 /sys/class/backlight/%k/brightness"
'';
};
time.timeZone = "Europe/Berlin";
}

View file

@ -0,0 +1,67 @@
{ pkgs, lib, ... }:
with lib;
{
imports = [
../../options/copySysConf.nix
];
config.machine = {
allowUnfree = true;
hostName = "Marid";
administrators = [ { name = "derped"; id = 1337; } ];
conffiles = [
"etcfiles"
"etcvars"
"fonts"
"zsh"
];
pkgs = [
"base"
"dict"
"nodejs"
"emacs"
"emacs::company"
"emacs::docker"
"emacs::doom-modeline"
"emacs::doom-themes"
"emacs::elpy"
"emacs::fcitx"
"emacs::flycheck"
"emacs::flyspell"
"emacs::undo-tree"
"emacs::lsp"
"emacs::magit"
"emacs::mu4e"
"emacs::nix-mode"
"emacs::org"
"emacs::php-mode"
"emacs::web-mode"
"emacs::yasnippet"
"extra"
"mail_utils"
"python3"
"xpkgs"
];
services = [
"docker"
"desktop"
"udev"
"fprintd"
];
firewall = {
enable = true;
allowPing = true;
allowedUDPPorts = [ ];
allowedTCPPorts = [ ];
allowedUDPPortRanges = [ ];
allowedTCPPortRanges = [ ];
};
desktop.wms = [ "none+i3" "i3" ];
};
config.system.copySysConf = {
enable = false;
addToNixPath = false;
};
}

View file

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{
let
cfg = config.machine;
in {
config.machine.pkgsets.xpkgs.pkgs = with pkgs; [
feh
scrot
@ -15,7 +17,7 @@
pavucontrol
xclip
xlibs.xkill
xorg.xbacklight
(if (cfg.hostName == "Marid") then xbacklight else xorg.xbacklight)
xdiskusage
];
}

View file

@ -39,7 +39,6 @@ in mkIf (elem "desktop" cfg.services) {
services.xserver = {
enable = !(elem "sway" cfg.desktop.wms);
layout = "de";
videoDrivers = [ "intel" ];
displayManager.defaultSession = ifelse (cfg.desktop.wms != []) (elemAt cfg.desktop.wms 0) null;
windowManager = mkIf (cfg.desktop.wms != []) {
i3 = mkIf (elem "i3" cfg.desktop.wms) (import ./desktop/i3.nix { inherit pkgs; });

18
services/fprintd.nix Normal file
View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
with lib;
mkIf (elem "fprintd" config.machine.services) {
security.pam.services = let
unlock = [
"sudo"
"i3lock"
"login"
"lightdm"
];
in listToAttrs (forEach unlock (n: {name = n; value = { fprintAuth = true; }; }));
services.fprintd = {
enable = true;
};
}