From 4b473b6a7116c0e2098bddd6c8251ea8b77a7d91 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Tue, 3 May 2022 10:30:53 -0400 Subject: [PATCH] Move nki-home to sway --- flake.lock | 8 ++++---- flake.nix | 1 + home/kagami-pc-home.nix | 16 ++++++++++++--- home/modules/programs/my-sway/default.nix | 17 ++++++++++++---- nki-home/configuration.nix | 24 +++++++++-------------- 5 files changed, 40 insertions(+), 26 deletions(-) diff --git a/flake.lock b/flake.lock index 711ade8..64328a5 100644 --- a/flake.lock +++ b/flake.lock @@ -329,11 +329,11 @@ }, "secrets": { "locked": { - "lastModified": 1635971132, - "narHash": "sha256-w5QAlp+RmVFh3E9Kb79eX+QvcV/jTGPy/y4REGswzy8=", + "lastModified": 1651588062, + "narHash": "sha256-4AQqNsc2vTkpJZJOFW7nuVD7hV1w+ZRLAhiJhRQEiSE=", "ref": "master", - "rev": "9183da438dffec97148a1a7e6ec3462fa372ffe8", - "revCount": 1, + "rev": "f8320c88e4c073f18e49abeb60091c1c73dd0d9a", + "revCount": 2, "type": "git", "url": "ssh://git@github.com/natsukagami/nix-deploy-secrets" }, diff --git a/flake.nix b/flake.nix index 507cd1f..f790798 100644 --- a/flake.nix +++ b/flake.nix @@ -91,6 +91,7 @@ home-manager.useUserPackages = true; home-manager.users.nki = import ./home/kagami-pc-home.nix; } + inputs.secrets.nixosModules.x86_64-linux.common (overlayForSystem "x86_64-linux") ]; }; diff --git a/home/kagami-pc-home.nix b/home/kagami-pc-home.nix index 8b4640a..3622c52 100644 --- a/home/kagami-pc-home.nix +++ b/home/kagami-pc-home.nix @@ -29,10 +29,20 @@ ]); # Enable X11 configuration - linux.graphical.type = "x11"; + linux.graphical.type = "wayland"; linux.graphical.wallpaper = ./images/wallpaper_1.png; - linux.graphical.x11.hidpi = true; - linux.graphical.x11.enablei3 = true; + programs.my-sway.enable = true; + programs.my-sway.fontSize = 13.0; + programs.my-sway.enableLaptopBars = false; + # Keyboard options + wayland.windowManager.sway.config.input."type:keyboard".xkb_layout = "jp"; + # 144hz adaptive refresh ON! + wayland.windowManager.sway.config.output."ViewSonic Corporation XG2402 SERIES V4K182501054" = { + mode = "1920x1080@144Hz"; + adaptive_sync = "on"; + }; + # linux.graphical.x11.hidpi = true; + # linux.graphical.x11.enablei3 = true; # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage diff --git a/home/modules/programs/my-sway/default.nix b/home/modules/programs/my-sway/default.nix index 5fb4372..9726029 100644 --- a/home/modules/programs/my-sway/default.nix +++ b/home/modules/programs/my-sway/default.nix @@ -54,6 +54,12 @@ in description = "The command to the terminal emulator to be used"; default = "${pkgs.alacritty}/bin/alacritty"; }; + + enableLaptopBars = mkOption { + type = types.bool; + description = "Whether to enable laptop-specific bars (battery)"; + default = true; + }; }; config.wayland.windowManager.sway = mkIf cfg.enable { @@ -225,8 +231,11 @@ in "memory" "temperature" "backlight" - "battery" - "battery#bat2" + ] ++ ( + if cfg.enableLaptopBars + then [ "battery" "battery#bat2" ] + else [ ] + ) ++ [ "clock" ]; @@ -261,7 +270,7 @@ in states = [ 0 50 ]; format-icons = [ "" "" ]; }; - "battery" = { + "battery" = mkIf cfg.enableLaptopBars { states = { good = 95; warning = 30; @@ -272,7 +281,7 @@ in # format-full = ""; format-icons = [ "" "" "" "" "" ]; }; - "battery#bat2" = { + "battery#bat2" = mkIf cfg.enableLaptopBars { bat = "BAT2"; }; "network" = { diff --git a/nki-home/configuration.nix b/nki-home/configuration.nix index 5c60fe4..fd17523 100644 --- a/nki-home/configuration.nix +++ b/nki-home/configuration.nix @@ -73,11 +73,14 @@ # keyMap = "us"; # }; - # Enable the X11 windowing system. - services.xserver.enable = true; - + # Enable sway on login. + environment.loginShellInit = '' + if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then + exec sway + fi + ''; # Configure keymap in X11 - services.xserver.layout = "jp"; + # services.xserver.layout = "jp"; # services.xserver.xkbOptions = ""; # Enable CUPS to print documents. @@ -154,9 +157,9 @@ # Enable Desktop Environment. services.xserver.displayManager = { - lightdm.enable = true; + # lightdm.enable = true; }; - services.xserver.desktopManager.cinnamon.enable = true; + # services.xserver.desktopManager.cinnamon.enable = true; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. @@ -229,15 +232,6 @@ bindPort = 6565; }; - # extra host for my personal server - sops.secrets.hosts = { - mode = "0755"; - }; - services.dnsmasq.enable = true; - services.dnsmasq.extraConfig = '' - addn-hosts=${config.sops.secrets.hosts.path} - ''; - # Gaming! programs.steam.enable = true; hardware.opengl.driSupport = true;