Compare commits
4 Commits
fe0fe21a12
...
2d3ca78643
Author | SHA1 | Date |
---|---|---|
Kevin Baensch | 2d3ca78643 | |
Kevin Baensch | 47500b78e3 | |
Kevin Baensch | e8f26ac86e | |
Kevin Baensch | 0d97bc51a2 |
|
@ -16,6 +16,7 @@ mkIf (elem "zsh" config.machine.conffiles) {
|
||||||
ustrip = "sed -e '/\.service\|\.timer\|\.target\|\.socket\|\.slice\|\.scope\|\.path\|\.mount\|\.device)/!d' -e 's/loaded.*$//g' -e 's/^ \|^● //g'";
|
ustrip = "sed -e '/\.service\|\.timer\|\.target\|\.socket\|\.slice\|\.scope\|\.path\|\.mount\|\.device)/!d' -e 's/loaded.*$//g' -e 's/^ \|^● //g'";
|
||||||
lsunits = "systemctl list-units | ustrip";
|
lsunits = "systemctl list-units | ustrip";
|
||||||
};
|
};
|
||||||
|
|
||||||
shellInit = ''
|
shellInit = ''
|
||||||
function ll() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" }
|
function ll() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" }
|
||||||
function lln() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" -n }
|
function lln() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" -n }
|
||||||
|
@ -23,8 +24,9 @@ mkIf (elem "zsh" config.machine.conffiles) {
|
||||||
function rwhich() { realpath $(which $@) }
|
function rwhich() { realpath $(which $@) }
|
||||||
function cdf() { cd $(rwhich $@ | sed "s/$@$//") }
|
function cdf() { cd $(rwhich $@ | sed "s/$@$//") }
|
||||||
function sfu() { lsunits | rg -i $@ }
|
function sfu() { lsunits | rg -i $@ }
|
||||||
function map() { for f in "$\{@:2\}"; do; eval $1 $f; done }
|
function map() { for f in "$\{@:2\}"; do; eval $1 \"$f\"; done }
|
||||||
'';
|
'';
|
||||||
|
|
||||||
ohMyZsh = {
|
ohMyZsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = [ "cabal" "docker" "gitfast" "python" "pip" "sudo" "systemd" "man" ];
|
plugins = [ "cabal" "docker" "gitfast" "python" "pip" "sudo" "systemd" "man" ];
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.cron.enable = false;
|
||||||
|
networking.dhcpcd.extraConfig = "noarp";
|
||||||
|
system.stateVersion = "21.05";
|
||||||
|
}
|
|
@ -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";
|
||||||
|
}
|
|
@ -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;
|
||||||
|
};
|
||||||
|
}
|
|
@ -18,6 +18,10 @@ mkIf (elem "emacs::lsp" config.machine.pkgs) {
|
||||||
${optionalString (elem "emacs::rust" config.machine.pkgs) ''
|
${optionalString (elem "emacs::rust" config.machine.pkgs) ''
|
||||||
(setq lsp-rust-clippy-preference "on")
|
(setq lsp-rust-clippy-preference "on")
|
||||||
''}
|
''}
|
||||||
|
${optionalString (elem "emacs::web-mode" config.machine.pkgs) ''
|
||||||
|
(setq lsp-clients-deno-enable-unstable 't)
|
||||||
|
(setq lsp-disabled-clients '(ts-ls))
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
mkIf (elem "emacs::telega" config.machine.pkgs) {
|
||||||
|
programs.emacs.init.usePackage.telegram = {
|
||||||
|
enable = true;
|
||||||
|
defer = true;
|
||||||
|
package = epkgs: [ epkgs.telega epkgs.visual-fill-column ];
|
||||||
|
command = [ "telega" ];
|
||||||
|
config = ''
|
||||||
|
(telega-alert-mode 1)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -28,19 +28,32 @@ mkIf (elem "emacs::web-mode" config.machine.pkgs) {
|
||||||
};
|
};
|
||||||
js2-mode = {
|
js2-mode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
mode = [
|
||||||
tide = {
|
''("\\.js\\'" . js2-mode)''
|
||||||
enable = true;
|
|
||||||
after = [ "typescript-mode" "company" "flycheck" ];
|
|
||||||
hook = [
|
|
||||||
"(typescript-mode . tide-setup)"
|
|
||||||
"(typescript-mode . tide-hl-identifier-mode)"
|
|
||||||
"(before-save . tide-format-before-save)"
|
|
||||||
];
|
];
|
||||||
config = ''
|
|
||||||
(setq company-tooltip-align-annotations t)
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
typescript-mode = {
|
||||||
|
enable = true;
|
||||||
|
hook = lib.optional (elem "emacs::lsp" config.machine.pkgs)
|
||||||
|
''(typescript-mode . (lambda () (lsp)))'';
|
||||||
|
mode = [
|
||||||
|
''("\\.ts\\'" . typescript-mode)''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
# tide = {
|
||||||
|
# enable = true;
|
||||||
|
# after = [ "typescript-mode" "company" "flycheck" ];
|
||||||
|
# hook = [
|
||||||
|
# "(typescript-mode . tide-setup)"
|
||||||
|
# "(typescript-mode . tide-hl-identifier-mode)"
|
||||||
|
# "(before-save . tide-format-before-save)"
|
||||||
|
# ];
|
||||||
|
# config = ''
|
||||||
|
# (flycheck-mode +1)
|
||||||
|
# (setq flycheck-check-syntax-automatically '(save mode-enabled))
|
||||||
|
# (setq company-tooltip-align-annotations t)
|
||||||
|
# '';
|
||||||
|
# };
|
||||||
impatient-mode = {
|
impatient-mode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
let
|
||||||
|
cfg = config.machine;
|
||||||
|
in {
|
||||||
config.machine.pkgsets.xpkgs.pkgs = with pkgs; [
|
config.machine.pkgsets.xpkgs.pkgs = with pkgs; [
|
||||||
feh
|
feh
|
||||||
scrot
|
scrot
|
||||||
|
@ -15,7 +17,7 @@
|
||||||
pavucontrol
|
pavucontrol
|
||||||
xclip
|
xclip
|
||||||
xlibs.xkill
|
xlibs.xkill
|
||||||
xorg.xbacklight
|
(if (cfg.hostName == "Marid") then xbacklight else xorg.xbacklight)
|
||||||
xdiskusage
|
xdiskusage
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,6 @@ in mkIf (elem "desktop" cfg.services) {
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = !(elem "sway" cfg.desktop.wms);
|
enable = !(elem "sway" cfg.desktop.wms);
|
||||||
layout = "de";
|
layout = "de";
|
||||||
videoDrivers = [ "intel" ];
|
|
||||||
displayManager.defaultSession = ifelse (cfg.desktop.wms != []) (elemAt cfg.desktop.wms 0) null;
|
displayManager.defaultSession = ifelse (cfg.desktop.wms != []) (elemAt cfg.desktop.wms 0) null;
|
||||||
windowManager = mkIf (cfg.desktop.wms != []) {
|
windowManager = mkIf (cfg.desktop.wms != []) {
|
||||||
i3 = mkIf (elem "i3" cfg.desktop.wms) (import ./desktop/i3.nix { inherit pkgs; });
|
i3 = mkIf (elem "i3" cfg.desktop.wms) (import ./desktop/i3.nix { inherit pkgs; });
|
||||||
|
|
|
@ -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;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue