From fcf47ae3266badf691fe85b894f7faffa87c489c Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Fri, 11 Nov 2022 17:07:24 +0100 Subject: [PATCH] Fixes Pt. II --- flake.nix | 9 +-- home-manager/modules/alacritty/default.nix | 75 +++------------------- home-manager/modules/i3/default.nix | 3 +- machines/mimir/configuration.nix | 17 ++++- machines/mimir/hardware-configuration.nix | 5 +- modules/greetd/default.nix | 3 +- modules/lightdm/default.nix | 26 ++++++++ modules/nix-common/default.nix | 6 +- users/erwin/home.nix | 2 +- users/erwin/work.nix | 15 ++++- 10 files changed, 79 insertions(+), 82 deletions(-) create mode 100644 modules/lightdm/default.nix diff --git a/flake.nix b/flake.nix index 3e3112e..e031230 100644 --- a/flake.nix +++ b/flake.nix @@ -100,6 +100,7 @@ super.makeModulesClosure (x // { allowMissing = true; }); }); + config.allowUnfree = true; }; } @@ -158,10 +159,10 @@ ha-now-playing.overlays.${system} pamedia.overlays.${system} ]; - config = { - allowUnsupportedSystem = true; - allowUnfree = true; - }; + # config = { + # allowUnsupportedSystem = true; + # allowUnfree = true; + # }; }; in rec { diff --git a/home-manager/modules/alacritty/default.nix b/home-manager/modules/alacritty/default.nix index 52c55f4..ba82123 100644 --- a/home-manager/modules/alacritty/default.nix +++ b/home-manager/modules/alacritty/default.nix @@ -5,14 +5,14 @@ }: with lib; let cfg = config.eboskma.programs.alacritty; - importYAML = name: yamlFile: (lib.importJSON ((pkgs.runCommand name { } '' + importYAML = name: yamlFile: (lib.importJSON ((pkgs.runCommandNoCC name { } '' mkdir -p $out ${pkgs.yaml2json}/bin/yaml2json < ${yamlFile} | ${pkgs.jq}/bin/jq -a '.' > $out/tmp.json '').outPath + "/tmp.json")); theme = importYAML "theme" (builtins.fetchurl { - url = "https://raw.githubusercontent.com/dracula/alacritty/05faff15c0158712be87d200081633d9f4850a7d/dracula.yml"; - sha256 = "1366rvvni2shbqlcrbypjv4f7p7ccdr6bvr685jnj8ipwqjjb6rn"; + url = "https://raw.githubusercontent.com/dracula/alacritty/77aff04b9f2651eac10e5cfa80a3d85ce43e7985/dracula.yml"; + sha256 = "NoEBy8cUs6KDfougzAIcuX9oSAltO7y9OOeXJbSQKrY="; }); in { @@ -21,10 +21,15 @@ in config = mkIf cfg.enable { programs.alacritty = { enable = true; + package = pkgs.hello; + settings = { + inherit (theme) colors; + window = { decorations = "full"; startup_mode = "Maximized"; + opacity = 0.9; }; scrolling = { @@ -35,69 +40,9 @@ in family = "Iosevka Nerd Font"; style = "Medium"; }; - size = 10.0; + size = 12.0; }; - inherit (theme) colors; - # colors = { - # primary = { - # background = "#2e3440"; - # foreground = "#d8dee9"; - # dim_foreground = "#a5abb6"; - # }; - # cursor = { - # text = "#2e3440"; - # cursor = "#d8dee9"; - # }; - # vi_mode_cursor = { - # text = "#2e3440"; - # cursor = "#d8dee9"; - # }; - # selection = { - # text = "CellForeground"; - # background = "#4c566a"; - # }; - # search = { - # matches = { - # foreground = "CellBackground"; - # background = "#88c0d0"; - # }; - # bar = { - # background = "#434c5e"; - # foreground = "#d8dee9"; - # }; - # }; - # normal = { - # black = "#3b4252"; - # red = "#bf616a"; - # green = "#a3be8c"; - # yellow = "#ebcb8b"; - # blue = "#81a1c1"; - # magenta = "#b48ead"; - # cyan = "#88c0d0"; - # white = "#e5e9f0"; - # }; - # bright = { - # black = "#4c566a"; - # red = "#bf616a"; - # green = "#a3be8c"; - # yellow = "#ebcb8b"; - # blue = "#81a1c1"; - # magenta = "#b48ead"; - # cyan = "#8fbcbb"; - # white = "#eceff4"; - # }; - # dim = { - # black = "#373e4d"; - # red = "#94545d"; - # green = "#809575"; - # yellow = "#b29e75"; - # blue = "#68809a"; - # magenta = "#8c738c"; - # cyan = "#6d96a5"; - # white = "#aeb3bb"; - # }; - # }; - background_opacity = 0.9; + live_config_reload = true; mouse = { hide_when_typing = true; diff --git a/home-manager/modules/i3/default.nix b/home-manager/modules/i3/default.nix index 260712c..07dae9d 100644 --- a/home-manager/modules/i3/default.nix +++ b/home-manager/modules/i3/default.nix @@ -204,8 +204,7 @@ in }; }; - # terminal = "${pkgs.alacritty}/bin/alacritty"; - terminal = "/usr/bin/alacritty"; + terminal = "${pkgs.alacritty}/bin/alacritty"; window = { border = 1; diff --git a/machines/mimir/configuration.nix b/machines/mimir/configuration.nix index 3e22df4..929f23a 100644 --- a/machines/mimir/configuration.nix +++ b/machines/mimir/configuration.nix @@ -20,7 +20,7 @@ in ../../users/root ]; - nixpkgs.config.allowUnfree = true; + # nixpkgs.config.allowUnfree = true; eboskma = { users = { @@ -44,7 +44,8 @@ in docker.enable = true; fonts.enable = true; gnome.enable = true; - greetd.enable = true; + # greetd.enable = true; + lightdm.enable = true; networking.enable = true; nix-common.enable = true; sound.enable = true; @@ -62,10 +63,12 @@ in time.timeZone = "Europe/Amsterdam"; + console.useXkbConfig = true; + networking = { hostName = "mimir"; useDHCP = false; - networkmanager.enable = true; + networkmanager.enable = false; useNetworkd = true; firewall = { @@ -83,10 +86,18 @@ in systemd.network = { enable = true; + wait-online.anyInterface = true; + networks = { "40-enp4s0" = { DHCP = "yes"; }; + + "40-enp5s0f1" = { + linkConfig = { + RequiredForOnline = false; + }; + }; }; }; diff --git a/machines/mimir/hardware-configuration.nix b/machines/mimir/hardware-configuration.nix index 417c346..60cfe8f 100644 --- a/machines/mimir/hardware-configuration.nix +++ b/machines/mimir/hardware-configuration.nix @@ -16,7 +16,7 @@ fileSystems."/" = { - device = "/dev/disk/by-label/root"; + device = "/dev/disk/by-label/nixos"; fsType = "ext4"; }; @@ -37,8 +37,9 @@ powerManagement.cpuFreqGovernor = "ondemand"; hardware = { - video.hidpi.enable = true; + video.hidpi.enable = false; enableAllFirmware = true; + nvidia.modesetting.enable = true; opengl = { extraPackages = with pkgs; [ diff --git a/modules/greetd/default.nix b/modules/greetd/default.nix index 78b63d6..47911dd 100644 --- a/modules/greetd/default.nix +++ b/modules/greetd/default.nix @@ -24,7 +24,7 @@ in restart = true; settings = { default_session = { - command = "${pkgs.sway}/bin/sway --config /etc/greetd/sway-config"; + command = "${pkgs.sway}/bin/sway --unsupported-gpu --config /etc/greetd/sway-config"; }; }; }; @@ -47,6 +47,7 @@ in }; "greetd/environments" = { text = '' + ${pkgs.i3}/bin/i3 ${pkgs.sway}/bin/sway ${hyprland}/bin/Hyprland ${pkgs.bash}/bin/bash diff --git a/modules/lightdm/default.nix b/modules/lightdm/default.nix new file mode 100644 index 0000000..73765bb --- /dev/null +++ b/modules/lightdm/default.nix @@ -0,0 +1,26 @@ +{ pkgs, config, lib, ... }: +with lib; +let + cfg = config.eboskma.lightdm; +in +{ + options.eboskma.lightdm = { + enable = mkEnableOption "lightdm"; + }; + + config = mkIf cfg.enable { + services.xserver = { + enable = true; + + displayManager = { + defaultSession = "none+i3"; + lightdm = { + enable = true; + greeters.gtk = { + enable = true; + }; + }; + }; + }; + }; +} diff --git a/modules/nix-common/default.nix b/modules/nix-common/default.nix index cd86dda..b3e8165 100644 --- a/modules/nix-common/default.nix +++ b/modules/nix-common/default.nix @@ -23,9 +23,9 @@ in ]; config = mkIf cfg.enable { - nixpkgs = { - config.allowUnfree = true; - }; + # nixpkgs = { + # config.allowUnfree = true; + # }; nix = { package = pkgs.nixVersions.stable; diff --git a/users/erwin/home.nix b/users/erwin/home.nix index fe920c5..ac586af 100644 --- a/users/erwin/home.nix +++ b/users/erwin/home.nix @@ -35,7 +35,7 @@ in EDITOR = "${pkgs.neovim}/bin/nvim"; }; - nixpkgs.config = { allowUnfree = true; }; + # nixpkgs.config = { allowUnfree = true; }; home.stateVersion = "21.11"; diff --git a/users/erwin/work.nix b/users/erwin/work.nix index 82fdb2b..a7504db 100644 --- a/users/erwin/work.nix +++ b/users/erwin/work.nix @@ -21,7 +21,7 @@ in EDITOR = "${config.home-manager.users.erwin.eboskma.programs.emacs.package}/bin/emacsclient -c"; }; - nixpkgs.config = { allowUnfree = true; }; + nixpkgs.config.allowUnfree = true; eboskma = { programs = { @@ -186,6 +186,19 @@ in home.stateVersion = "22.11"; }; + services.xserver = { + layout = "us,us"; + xkbVariant = "colemak,"; + xkbModel = "pc105"; + xkbOptions = "ctrl:nocaps,eurosign:5,lv5:ralt_switch,lv3:rwin_switch,grp:shifts_toggle"; + + windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + extraPackages = with pkgs; [ i3lock-fancy ]; + }; + }; + programs.wireshark = { enable = true; package = pkgs.wireshark;