Merge branch 'main' of git.datarift.nl:erwin/nixos-config

This commit is contained in:
Erwin Boskma 2022-11-19 17:47:57 +01:00
commit c042fe2a77
Signed by: erwin
SSH key fingerprint: SHA256:CyeNoWXd3kjX2Nwu6pDxxdS7OqmPVOy0NavA/KU/ntU
9 changed files with 66 additions and 39 deletions

View file

@ -5,8 +5,6 @@
}: }:
with lib; let with lib; let
cfg = config.eboskma.programs.emacs; cfg = config.eboskma.programs.emacs;
emacsX11 = with pkgs; ((emacsPackagesFor emacsNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ]));
emacsWayland = with pkgs; ((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ]));
orgProtocolDesktop = pkgs.makeDesktopItem { orgProtocolDesktop = pkgs.makeDesktopItem {
name = "org-protocol"; name = "org-protocol";
@ -37,7 +35,7 @@ in
package = mkOption { package = mkOption {
description = "The emacs package to install"; description = "The emacs package to install";
type = types.package; type = types.package;
default = emacsWayland; default = pkgs.emacs;
}; };
daemon = mkOption { daemon = mkOption {

View file

@ -44,6 +44,8 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
xsession = { xsession = {
enable = true; enable = true;
numlock.enable = true;
windowManager.i3 = { windowManager.i3 = {
enable = true; enable = true;
package = pkgs.i3-gaps; package = pkgs.i3-gaps;
@ -249,16 +251,16 @@ in
command = "${pkgs.networkmanagerapplet}/bin/nm-applet"; command = "${pkgs.networkmanagerapplet}/bin/nm-applet";
notification = false; notification = false;
} }
{ # {
command = ''${pkgs.xorg.xinput}/bin/xinput set-int-prop "Logitech USB Laser Mouse" "libinput Natural Scrolling Enabled" 8 1''; # command = ''${pkgs.xorg.xinput}/bin/xinput set-int-prop "Logitech USB Laser Mouse" "libinput Natural Scrolling Enabled" 8 1'';
notification = false; # notification = false;
always = true; # always = true;
} # }
{ # {
command = ''${pkgs.xorg.xinput}/bin/xinput set-float-prop "Logitech USB Laser Mouse" "libinput Accel Speed" 1''; # command = ''${pkgs.xorg.xinput}/bin/xinput set-float-prop "Logitech USB Laser Mouse" "libinput Accel Speed" 1'';
notification = false; # notification = false;
always = true; # always = true;
} # }
{ {
command = "${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --primary --left-of DP-4"; command = "${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --primary --left-of DP-4";
notification = false; notification = false;

View file

@ -21,5 +21,7 @@ in
enable = true; enable = true;
notifications = true; notifications = true;
}; };
home.packages = with pkgs; [ mpc-cli ];
}; };
} }

View file

@ -4,14 +4,21 @@ let
cfg = config.eboskma.programs.zellij; cfg = config.eboskma.programs.zellij;
in in
{ {
options.eboskma.programs.zellij = { enable = mkEnableOption "zellij"; }; options.eboskma.programs.zellij = {
enable = mkEnableOption "zellij";
copyCommand = mkOption {
description = "Command used to copy a selection";
type = types.str;
example = literalExpression ''"''${pkgs.wl-clipboard}/bin/wl-copy"'';
};
};
config = mkIf (cfg.enable) { config = mkIf (cfg.enable) {
programs.zellij = { programs.zellij = {
enable = true; enable = true;
settings = { settings = {
theme = "dracula"; theme = "dracula";
copy_command = "${pkgs.wl-clipboard}/bin/wl-copy"; copy_command = cfg.copyCommand;
scrollback_editor = "${config.eboskma.programs.emacs.package}/bin/emacsclient"; scrollback_editor = "${config.eboskma.programs.emacs.package}/bin/emacsclient";
pane_frames = false; pane_frames = false;

View file

@ -3,9 +3,7 @@
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ self, nixpkgs, nixos-hardware, ... }: { self, nixpkgs, nixos-hardware, ... }:
let { pkgs, ... }:
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in
{ {
imports = imports =
[ [
@ -87,10 +85,11 @@ in
systemd.network = { systemd.network = {
enable = true; enable = true;
wait-online.anyInterface = true; wait-online.extraArgs = [ "--interface=enp4s0" ];
networks = { networks = {
"40-enp4s0" = { "40-enp4s0" = {
enable = true;
DHCP = "yes"; DHCP = "yes";
matchConfig = { matchConfig = {
@ -99,8 +98,9 @@ in
}; };
"40-enp5s0f1" = { "40-enp5s0f1" = {
enable = true;
linkConfig = { linkConfig = {
RequiredForOnline = false; RequiredForOnline = "no";
}; };
matchConfig = { matchConfig = {
Name = "enp5s0f1"; Name = "enp5s0f1";
@ -112,6 +112,14 @@ in
services.openssh.enable = true; services.openssh.enable = true;
programs.ssh.startAgent = true; programs.ssh.startAgent = true;
services.xserver.libinput = {
enable = true;
mouse = {
accelSpeed = "1.0";
naturalScrolling = true;
};
};
# sops = { # sops = {
# defaultSopsFile = ./secrets.yaml; # defaultSopsFile = ./secrets.yaml;

View file

@ -14,26 +14,28 @@
options amd-pstate shared_mem=true options amd-pstate shared_mem=true
''; '';
fileSystems."/" = fileSystems."/" = {
{
device = "/dev/disk/by-label/nixos"; device = "/dev/disk/by-label/nixos";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot/efi" = fileSystems."/boot" = {
{
device = "/dev/disk/by-label/boot"; device = "/dev/disk/by-label/boot";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/home" = fileSystems."/home" = {
{
device = "/dev/disk/by-label/home"; device = "/dev/disk/by-label/home";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/yocto" = {
device = "/dev/disk/by-label/yocto";
fsType = "ext4";
};
swapDevices = swapDevices =
[{ device = "/dev/disk/by-uuid/82969dda-8804-4314-b916-2d4b5db904d5"; }]; [{ device = "/dev/disk/by-label/swap"; }];
powerManagement.cpuFreqGovernor = "ondemand"; powerManagement.cpuFreqGovernor = "ondemand";
hardware = { hardware = {

View file

@ -92,7 +92,7 @@ in
}; };
environment = { environment = {
sessionVariables = { sessionVariables = mkIf cfg.wayland {
_JAVA_AWT_WM_NONREPARENTING = "1"; _JAVA_AWT_WM_NONREPARENTING = "1";
MOZ_ENABLE_WAYLAND = "1"; MOZ_ENABLE_WAYLAND = "1";
MOZ_DBUS_REMOTE = "1"; MOZ_DBUS_REMOTE = "1";

View file

@ -47,6 +47,7 @@ in
dunst.enable = false; dunst.enable = false;
emacs = { emacs = {
enable = true; enable = true;
package = with pkgs; ((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ]));
daemon = true; daemon = true;
}; };
electron = { electron = {
@ -114,7 +115,10 @@ in
tmux.enable = true; tmux.enable = true;
waybar.enable = true; waybar.enable = true;
zathura.enable = true; zathura.enable = true;
zellij.enable = true; zellij = {
enable = true;
copyCommand = "${pkgs.wl-clipboard}/bin/wl-copy";
};
}; };
}; };

View file

@ -32,6 +32,7 @@ in
dunst.enable = true; dunst.enable = true;
emacs = { emacs = {
enable = true; enable = true;
package = with pkgs; ((emacsPackagesFor emacsNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ]));
daemon = true; daemon = true;
}; };
firefox = { firefox = {
@ -68,7 +69,10 @@ in
}; };
rofi.enable = true; rofi.enable = true;
ssh.enable = true; ssh.enable = true;
zellij.enable = true; zellij = {
enable = true;
copyCommand = "${pkgs.xsel}/bin/xsel --clipboard";
};
}; };
services = { services = {
xbanish.enable = true; xbanish.enable = true;