mirror of
https://github.com/Unkn0wnCat/dotfiles.git
synced 2025-06-05 09:41:36 +02:00
Initial commit
This commit is contained in:
commit
a46d297fc7
8 changed files with 356 additions and 0 deletions
132
nixos/modules/default.nix
Normal file
132
nixos/modules/default.nix
Normal file
|
@ -0,0 +1,132 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let cfg = config.kevin;
|
||||
in {
|
||||
imports = [
|
||||
./power.nix
|
||||
./networking.nix
|
||||
./audio.nix
|
||||
./desktop.nix
|
||||
./yubikey.nix
|
||||
];
|
||||
|
||||
options.kevin = {
|
||||
defaults = mkOption {
|
||||
type = types.enum [ "none" "laptop" "desktop" ];
|
||||
default = "none";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.defaults != "none") (mkMerge [
|
||||
({
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "de";
|
||||
};
|
||||
|
||||
services.xserver.layout = "de";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
wget
|
||||
curl
|
||||
tmux
|
||||
];
|
||||
})
|
||||
(mkIf (cfg.defaults == "laptop" || cfg.defaults == "desktop") {
|
||||
kevin.networking.enable = true;
|
||||
kevin.networking.avahi.enable = true;
|
||||
kevin.networking.firewall.wireguard = true;
|
||||
kevin.audio.enable = true;
|
||||
kevin.desktop.enable = true;
|
||||
kevin.desktop.type = "gnome";
|
||||
kevin.yubikey.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
firefox
|
||||
league-of-moveable-type
|
||||
];
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
# enableSSHSupport = true;
|
||||
};
|
||||
|
||||
kevin.networking.firewall.syncthing = true;
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
user = "kevin";
|
||||
dataDir = "/home/kevin/Syncthing";
|
||||
configDir = "/home/kevin/Syncthing/.config/syncthing";
|
||||
};
|
||||
|
||||
services.fwupd.enable = true;
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
boot.supportedFilesystems = [ "ntfs" ];
|
||||
|
||||
services.printing.enable = true;
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
users.users.kevin = {
|
||||
isNormalUser = true;
|
||||
description = "Kevin Kandlbinder";
|
||||
extraGroups = [ "wheel" "docker" "dialout" ];
|
||||
};
|
||||
})
|
||||
(mkIf (cfg.defaults == "laptop") {
|
||||
kevin.power.mode = "laptop";
|
||||
networking.hostName = "kevin-tp-l580";
|
||||
|
||||
services.xserver.libinput.enable = true;
|
||||
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
vaapiIntel
|
||||
libvdpau-va-gl
|
||||
intel-media-driver
|
||||
];
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"vm.swappiness" = 1;
|
||||
"vm.vfs_cache_pressure" = 50;
|
||||
"vm.dirty_background_ratio" = 20;
|
||||
"vm.dirty_ratio" = 50;
|
||||
# these are the zen-kernel tweaks to CFS defaults (mostly)
|
||||
"kernel.sched_latency_ns" = 4000000;
|
||||
# should be one-eighth of sched_latency (this ratio is not
|
||||
# configurable, apparently -- so while zen changes that to
|
||||
# one-tenth, we cannot):
|
||||
"kernel.sched_min_granularity_ns" = 500000;
|
||||
"kernel.sched_wakeup_granularity_ns" = 50000;
|
||||
"kernel.sched_migration_cost_ns" = 250000;
|
||||
"kernel.sched_cfs_bandwidth_slice_us" = 3000;
|
||||
"kernel.sched_nr_migrate" = 128;
|
||||
};
|
||||
|
||||
systemd = {
|
||||
extraConfig = ''
|
||||
DefaultCPUAccounting=yes
|
||||
DefaultMemoryAccounting=yes
|
||||
DefaultIOAccounting=yes
|
||||
'';
|
||||
user.extraConfig = ''
|
||||
DefaultCPUAccounting=yes
|
||||
DefaultMemoryAccounting=yes
|
||||
DefaultIOAccounting=yes
|
||||
'';
|
||||
services."user@".serviceConfig.Delegate = true;
|
||||
};
|
||||
|
||||
systemd.services.nix-daemon.serviceConfig = {
|
||||
CPUWeight = 20;
|
||||
IOWeight = 20;
|
||||
};
|
||||
|
||||
boot.kernelParams = ["cgroup_no_v1=all" "systemd.unified_cgroup_hierarchy=yes"];
|
||||
})
|
||||
]);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue