From b6c87fd8cebfdd297c29f77d3c82bb30608620c7 Mon Sep 17 00:00:00 2001 From: Lin Yinfeng Date: Fri, 10 Sep 2021 11:02:49 +0800 Subject: [PATCH] Add a draft sway configuration --- flake.nix | 4 +-- profiles/graphical/sway/default.nix | 11 ++++++ profiles/virtualization/podman/default.nix | 2 ++ users/profiles/sway/default.nix | 41 ++++++++++++++++++++++ 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 profiles/graphical/sway/default.nix create mode 100644 users/profiles/sway/default.nix diff --git a/flake.nix b/flake.nix index de7918987..1e18bcc7f 100644 --- a/flake.nix +++ b/flake.nix @@ -191,7 +191,7 @@ network = (with networking; [ resolved tailscale ]) ++ (with security; [ fail2ban firewall ]); networkManager = (with networking; [ network-manager ]); - multimedia = (with graphical; [ gnome fonts ibus-chinese ]) ++ (with services; [ pipewire ]); + multimedia = (with graphical; [ gnome sway fonts ibus-chinese ]) ++ (with services; [ pipewire ]); development = (with profiles.development; [ shells latex ]) ++ (with services; [ adb gnupg ]); multimediaDev = multimedia ++ development ++ (with profiles.development; [ ides ]); virtualization = with profiles.virtualization; [ podman libvirt wine ]; @@ -232,7 +232,7 @@ suites = with profiles; rec { # MAIN base = [ direnv git git-extra shells ]; - multimedia = [ gnome desktop-applications chromium firefox rime fonts ]; + multimedia = [ gnome sway desktop-applications chromium firefox rime fonts ]; development = [ profiles.development emacs tools asciinema tex ]; virtualization = [ ]; multimediaDev = multimedia ++ [ xdg-dirs ] ++ development ++ [ vscode ]; diff --git a/profiles/graphical/sway/default.nix b/profiles/graphical/sway/default.nix new file mode 100644 index 000000000..5b913062e --- /dev/null +++ b/profiles/graphical/sway/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + programs.sway = { + enable = true; + extraPackages = with pkgs; [ + swaylock + swayidle + ]; + }; +} diff --git a/profiles/virtualization/podman/default.nix b/profiles/virtualization/podman/default.nix index 6f6f64e0f..68ecdb571 100644 --- a/profiles/virtualization/podman/default.nix +++ b/profiles/virtualization/podman/default.nix @@ -20,6 +20,8 @@ lib.mkMerge [ ExecStartPost = "${podman} image prune -f"; }; wantedBy = [ "multi-user.target" "default.target" ]; + environment = lib.mkIf (config.networking.fw-proxy.enable) + config.networking.fw-proxy.environment; }; systemd.timers.podman-auto-update = { description = "Podman auto-update timer"; diff --git a/users/profiles/sway/default.nix b/users/profiles/sway/default.nix new file mode 100644 index 000000000..f87b08548 --- /dev/null +++ b/users/profiles/sway/default.nix @@ -0,0 +1,41 @@ +{ ... }: + +# TODO: not finished yet +{ + wayland.windowManager.sway = { + enable = true; + config = { + modifier = "Mod4"; + startup = [ + ]; + terminal = "alacritty"; + }; + }; + services.kanshi = { + enable = true; + }; + programs.waybar = { + enable = true; + settings = [ + { + layer = "bottom"; + position = "top"; + modules-left = [ + "sway/workspaces" + "sway/mode" + ]; + modules-center = [ + "sway/window" + ]; + modules-right = [ + "battery" + "clock" + ]; + modules = { }; + } + ]; + }; + programs.alacritty = { + enable = true; + }; +}