From 4b36a05b9dc7a78ed8d75d15662b373feaea247d Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Thu, 17 Nov 2022 14:06:39 +0100 Subject: [PATCH] Fixes --- home-manager/modules/emacs/default.nix | 4 +-- home-manager/modules/i3/default.nix | 22 ++++++++------- home-manager/modules/mpd/default.nix | 2 ++ home-manager/modules/zellij/default.nix | 11 ++++++-- machines/mimir/configuration.nix | 20 +++++++++---- machines/mimir/hardware-configuration.nix | 34 ++++++++++++----------- modules/desktop/default.nix | 2 +- users/erwin/home.nix | 6 +++- users/erwin/work.nix | 6 +++- 9 files changed, 67 insertions(+), 40 deletions(-) diff --git a/home-manager/modules/emacs/default.nix b/home-manager/modules/emacs/default.nix index 35f4ca4..61a9dba 100644 --- a/home-manager/modules/emacs/default.nix +++ b/home-manager/modules/emacs/default.nix @@ -5,8 +5,6 @@ }: with lib; let 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 { name = "org-protocol"; @@ -37,7 +35,7 @@ in package = mkOption { description = "The emacs package to install"; type = types.package; - default = emacsWayland; + default = pkgs.emacs; }; daemon = mkOption { diff --git a/home-manager/modules/i3/default.nix b/home-manager/modules/i3/default.nix index 07dae9d..d4c2515 100644 --- a/home-manager/modules/i3/default.nix +++ b/home-manager/modules/i3/default.nix @@ -44,6 +44,8 @@ in config = mkIf cfg.enable { xsession = { enable = true; + numlock.enable = true; + windowManager.i3 = { enable = true; package = pkgs.i3-gaps; @@ -249,16 +251,16 @@ in command = "${pkgs.networkmanagerapplet}/bin/nm-applet"; notification = false; } - { - command = ''${pkgs.xorg.xinput}/bin/xinput set-int-prop "Logitech USB Laser Mouse" "libinput Natural Scrolling Enabled" 8 1''; - notification = false; - always = true; - } - { - command = ''${pkgs.xorg.xinput}/bin/xinput set-float-prop "Logitech USB Laser Mouse" "libinput Accel Speed" 1''; - notification = false; - always = true; - } + # { + # command = ''${pkgs.xorg.xinput}/bin/xinput set-int-prop "Logitech USB Laser Mouse" "libinput Natural Scrolling Enabled" 8 1''; + # notification = false; + # always = true; + # } + # { + # command = ''${pkgs.xorg.xinput}/bin/xinput set-float-prop "Logitech USB Laser Mouse" "libinput Accel Speed" 1''; + # notification = false; + # always = true; + # } { command = "${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --primary --left-of DP-4"; notification = false; diff --git a/home-manager/modules/mpd/default.nix b/home-manager/modules/mpd/default.nix index e0fd392..0fbc3a5 100644 --- a/home-manager/modules/mpd/default.nix +++ b/home-manager/modules/mpd/default.nix @@ -21,5 +21,7 @@ in enable = true; notifications = true; }; + + home.packages = with pkgs; [ mpc-cli ]; }; } diff --git a/home-manager/modules/zellij/default.nix b/home-manager/modules/zellij/default.nix index 85efeb6..264065c 100644 --- a/home-manager/modules/zellij/default.nix +++ b/home-manager/modules/zellij/default.nix @@ -4,14 +4,21 @@ let cfg = config.eboskma.programs.zellij; 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) { programs.zellij = { enable = true; settings = { theme = "dracula"; - copy_command = "${pkgs.wl-clipboard}/bin/wl-copy"; + copy_command = cfg.copyCommand; scrollback_editor = "${config.eboskma.programs.emacs.package}/bin/emacsclient"; pane_frames = false; diff --git a/machines/mimir/configuration.nix b/machines/mimir/configuration.nix index 6545729..6df6132 100644 --- a/machines/mimir/configuration.nix +++ b/machines/mimir/configuration.nix @@ -3,9 +3,7 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). { self, nixpkgs, nixos-hardware, ... }: -let - pkgs = nixpkgs.legacyPackages.x86_64-linux; -in +{ pkgs, ... }: { imports = [ @@ -68,7 +66,7 @@ in networking = { hostName = "mimir"; useDHCP = false; - networkmanager.enable = false; + networkmanager.enable = true; useNetworkd = true; firewall = { @@ -86,10 +84,11 @@ in systemd.network = { enable = true; - wait-online.anyInterface = true; + wait-online.extraArgs = [ "--interface=enp4s0" ]; networks = { "40-enp4s0" = { + enable = true; DHCP = "yes"; matchConfig = { @@ -98,8 +97,9 @@ in }; "40-enp5s0f1" = { + enable = true; linkConfig = { - RequiredForOnline = false; + RequiredForOnline = "no"; }; matchConfig = { Name = "enp5s0f1"; @@ -111,6 +111,14 @@ in services.openssh.enable = true; programs.ssh.startAgent = true; + services.xserver.libinput = { + enable = true; + mouse = { + accelSpeed = "1.0"; + naturalScrolling = true; + }; + }; + # sops = { # defaultSopsFile = ./secrets.yaml; diff --git a/machines/mimir/hardware-configuration.nix b/machines/mimir/hardware-configuration.nix index 60cfe8f..995eb74 100644 --- a/machines/mimir/hardware-configuration.nix +++ b/machines/mimir/hardware-configuration.nix @@ -14,26 +14,28 @@ options amd-pstate shared_mem=true ''; - fileSystems."/" = - { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; - fileSystems."/boot/efi" = - { - device = "/dev/disk/by-label/boot"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; - fileSystems."/home" = - { - device = "/dev/disk/by-label/home"; - fsType = "ext4"; - }; + fileSystems."/home" = { + device = "/dev/disk/by-label/home"; + fsType = "ext4"; + }; + + fileSystems."/yocto" = { + device = "/dev/disk/by-label/yocto"; + fsType = "ext4"; + }; swapDevices = - [{ device = "/dev/disk/by-uuid/82969dda-8804-4314-b916-2d4b5db904d5"; }]; + [{ device = "/dev/disk/by-label/swap"; }]; powerManagement.cpuFreqGovernor = "ondemand"; hardware = { diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 5845b34..1c08e64 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -92,7 +92,7 @@ in }; environment = { - sessionVariables = { + sessionVariables = mkIf cfg.wayland { _JAVA_AWT_WM_NONREPARENTING = "1"; MOZ_ENABLE_WAYLAND = "1"; MOZ_DBUS_REMOTE = "1"; diff --git a/users/erwin/home.nix b/users/erwin/home.nix index fe920c5..c923b65 100644 --- a/users/erwin/home.nix +++ b/users/erwin/home.nix @@ -47,6 +47,7 @@ in dunst.enable = false; emacs = { enable = true; + package = with pkgs; ((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ])); daemon = true; }; electron = { @@ -114,7 +115,10 @@ in tmux.enable = true; waybar.enable = true; zathura.enable = true; - zellij.enable = true; + zellij = { + enable = true; + copyCommand = "${pkgs.wl-clipboard}/bin/wl-copy"; + }; }; }; diff --git a/users/erwin/work.nix b/users/erwin/work.nix index a7504db..04a3c5d 100644 --- a/users/erwin/work.nix +++ b/users/erwin/work.nix @@ -31,6 +31,7 @@ in dunst.enable = true; emacs = { enable = true; + package = with pkgs; ((emacsPackagesFor emacsNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ])); daemon = true; }; firefox = { @@ -67,7 +68,10 @@ in }; rofi.enable = true; ssh.enable = true; - zellij.enable = true; + zellij = { + enable = true; + copyCommand = "${pkgs.xsel}/bin/xsel --clipboard"; + }; }; services = { xbanish.enable = true;