mirror of
https://github.com/Unkn0wnCat/dotfiles.git
synced 2025-06-25 18:36:58 +02:00
Switch to flake-based configuration
This commit is contained in:
parent
fad1c56a56
commit
f17713236d
25 changed files with 578 additions and 216 deletions
6
nixos/legacy/modules/default.nix
Normal file
6
nixos/legacy/modules/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./kevin/default.nix
|
||||
];
|
||||
}
|
157
nixos/legacy/modules/kevin/default.nix
Normal file
157
nixos/legacy/modules/kevin/default.nix
Normal file
|
@ -0,0 +1,157 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let cfg = config.kevin;
|
||||
in {
|
||||
imports = [
|
||||
./power.nix
|
||||
./networking.nix
|
||||
./audio.nix
|
||||
./desktop.nix
|
||||
./yubikey.nix
|
||||
./ssh.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";
|
||||
kevin.ssh.server.enable = true;
|
||||
|
||||
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.networking.firewall.kdeConnect = true;
|
||||
kevin.audio.enable = true;
|
||||
kevin.desktop.enable = true;
|
||||
kevin.desktop.type = "gnome";
|
||||
#kevin.yubikey.enable = true;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
firefox
|
||||
league-of-moveable-type
|
||||
hunspell
|
||||
hunspellDicts.de_DE
|
||||
];
|
||||
|
||||
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" "networkmanager" "floppy" "audio" "lp" "cdrom" "tape" "video" "render" ];
|
||||
};
|
||||
kevin.ssh.authorized.kevin.users = ["kevin" "root"];
|
||||
})
|
||||
(mkIf (cfg.defaults == "desktop") {
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.opengl.enable = true;
|
||||
|
||||
services.clamav.daemon.enable = true;
|
||||
services.clamav.updater.enable = true;
|
||||
#services.opensnitch.enable = true;
|
||||
networking.hostName = "kevin-PC";
|
||||
|
||||
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||
})
|
||||
(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
|
||||
];
|
||||
|
||||
|
||||
#specialisation.xmonad.configuration = {
|
||||
# kevin.desktop.type = mkForce "xmonad";
|
||||
#};
|
||||
|
||||
|
||||
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"];
|
||||
})
|
||||
]);
|
||||
}
|
138
nixos/legacy/modules/kevin/desktop.nix
Normal file
138
nixos/legacy/modules/kevin/desktop.nix
Normal file
|
@ -0,0 +1,138 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.kevin.desktop;
|
||||
in {
|
||||
options.kevin.desktop = {
|
||||
enable = mkEnableOption "kevins desktop";
|
||||
type = mkOption {
|
||||
type = types.enum [ "gnome" "xmonad" ];
|
||||
default = "gnome";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf (cfg.type == "gnome") {
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
services.flatpak.enable = true;
|
||||
})
|
||||
(mkIf (cfg.type == "xmonad") {
|
||||
services = {
|
||||
gnome.gnome-keyring.enable = true;
|
||||
upower.enable = true;
|
||||
|
||||
dbus = {
|
||||
enable = true;
|
||||
#socketActivated = true;
|
||||
# packages = [ pkgs.gnome3.dconf ];
|
||||
};
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
# startDbusSession = true;
|
||||
layout = "de";
|
||||
|
||||
libinput = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
displayManager.defaultSession = "none+xmonad";
|
||||
|
||||
windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
extraPackages = hp: [
|
||||
hp.dbus
|
||||
hp.monad-logger
|
||||
hp.xmonad-contrib
|
||||
];
|
||||
};
|
||||
|
||||
xkbOptions = "caps:ctrl_modifier";
|
||||
}; # /xserver
|
||||
}; # /services
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
services.blueman.enable = true;
|
||||
|
||||
systemd.services.upower.enable = true;
|
||||
|
||||
|
||||
home-manager.users.kevin = {
|
||||
home.packages = with pkgs; [
|
||||
nitrogen
|
||||
polybar
|
||||
];
|
||||
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
terminal = "${pkgs.xterm}/bin/xterm";
|
||||
# theme = ./theme.rafi;
|
||||
};
|
||||
|
||||
services.dunst = {
|
||||
enable = true;
|
||||
iconTheme = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome3.adwaita-icon-theme;
|
||||
size = "16x16";
|
||||
};
|
||||
settings = {
|
||||
global = {
|
||||
monitor = 0;
|
||||
geometry = "600x50-50+65";
|
||||
shrink = "yes";
|
||||
transparency = 10;
|
||||
padding = 16;
|
||||
horizontal_padding = 16;
|
||||
font = "JetBrainsMono Nerd Font 10";
|
||||
line_height = 4;
|
||||
format = ''<b>%s</b>\n%b'';
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
services.picom = {
|
||||
enable = true;
|
||||
activeOpacity = 1.0;
|
||||
inactiveOpacity = 0.8;
|
||||
backend = "glx";
|
||||
fade = true;
|
||||
fadeDelta = 5;
|
||||
#opacityRule = [ "100:name *= 'i3lock'" ];
|
||||
shadow = false;
|
||||
settings = {
|
||||
corner-radius = 10;
|
||||
blur-background = true;
|
||||
blur-background-fixed = true;
|
||||
blur = {
|
||||
method = "gaussian";
|
||||
size = 100;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.screen-locker = {
|
||||
enable = true;
|
||||
inactiveInterval = 30;
|
||||
lockCmd = "${pkgs.betterlockscreen}/bin/betterlockscreen -l dim";
|
||||
xautolockExtraOptions = [
|
||||
"Xautolock.killer: systemctl suspend"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
services.udiskie = {
|
||||
enable = true;
|
||||
tray = "always";
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
})
|
||||
]);
|
||||
}
|
107
nixos/legacy/modules/kevin/xmonad/polybar/config.ini
Normal file
107
nixos/legacy/modules/kevin/xmonad/polybar/config.ini
Normal file
|
@ -0,0 +1,107 @@
|
|||
[colors]
|
||||
background = #282A2E
|
||||
background-alt = #373B41
|
||||
foreground = #C5C8C6
|
||||
primary = #F0C674
|
||||
secondary = #8ABEB7
|
||||
alert = #A54242
|
||||
disabled = #707880
|
||||
|
||||
[global/wm]
|
||||
margin-top = 0
|
||||
margin-bottom = 0
|
||||
|
||||
[bar/main]
|
||||
width = 100%
|
||||
height = 48
|
||||
radius = 6.0
|
||||
fixed-center = true
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
line-size = 3pt
|
||||
border-size = 4pt
|
||||
border-color = #00000000
|
||||
padding-left = 10px
|
||||
padding-right = 10px
|
||||
|
||||
module-margin = 1
|
||||
separator = |
|
||||
separator-foreground = ${colors.disabled}
|
||||
|
||||
font-0 = monospace;2
|
||||
|
||||
[bar/top]
|
||||
inherit = bar/main
|
||||
modules-left = clock
|
||||
modules-center =
|
||||
modules-right = filesystem xkeyboard memory cpu wlan eth
|
||||
|
||||
enable-ipc = true
|
||||
|
||||
[module/filesystem]
|
||||
type = internal/fs
|
||||
interval = 25
|
||||
|
||||
mount-0 = /
|
||||
|
||||
label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
|
||||
|
||||
label-unmounted = %mountpoint% not mounted
|
||||
label-unmounted-foreground = ${colors.disabled}
|
||||
|
||||
[module/xkeyboard]
|
||||
type = internal/xkeyboard
|
||||
blacklist-0 = num lock
|
||||
|
||||
label-layout = %layout%
|
||||
label-layout-foreground = ${colors.primary}
|
||||
|
||||
label-indicator-padding = 2
|
||||
label-indicator-margin = 1
|
||||
label-indicator-foreground = ${colors.background}
|
||||
label-indicator-background = ${colors.secondary}
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 2
|
||||
format-prefix = "RAM "
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
label = %percentage_used:2%%
|
||||
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
interval = 2
|
||||
format-prefix = "CPU "
|
||||
format-prefix-foreground = ${colors.primary}
|
||||
label = %percentage:2%%
|
||||
|
||||
[network-base]
|
||||
type = internal/network
|
||||
interval = 5
|
||||
format-connected = <label-connected>
|
||||
format-disconnected = <label-disconnected>
|
||||
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
|
||||
|
||||
[module/wlan]
|
||||
inherit = network-base
|
||||
interface-type = wireless
|
||||
label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip%
|
||||
|
||||
[module/eth]
|
||||
inherit = network-base
|
||||
interface-type = wired
|
||||
label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%
|
||||
|
||||
[module/clock]
|
||||
type = internal/date
|
||||
interval = 1.0
|
||||
date = %Y-%m-%d%
|
||||
time = %H:%H:%S
|
||||
|
||||
label = %date% %time%
|
||||
label-foreground = ${colors.primary}
|
||||
|
||||
[settings]
|
||||
screenchange-reload = true
|
||||
pseudo-transparency = true
|
Loading…
Add table
Add a link
Reference in a new issue