diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/default.nix | 1 | ||||
| -rw-r--r-- | modules/desktop/akonadi.nix | 9 | ||||
| -rw-r--r-- | modules/desktop/default.nix | 1 | ||||
| -rw-r--r-- | modules/desktop/wms/cosmic.nix | 20 | ||||
| -rw-r--r-- | modules/desktop/wms/default.nix | 1 | ||||
| -rw-r--r-- | modules/desktop/wms/hyprland.nix | 14 | ||||
| -rw-r--r-- | modules/motd.nix | 89 |
7 files changed, 128 insertions, 7 deletions
diff --git a/modules/default.nix b/modules/default.nix index 4b433c8..3c1dc71 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -12,6 +12,7 @@ ./vpn.nix ./remote-builder.nix ./nh.nix + ./motd.nix ]; nixpkgs.overlays = [ diff --git a/modules/desktop/akonadi.nix b/modules/desktop/akonadi.nix new file mode 100644 index 0000000..abdb5a2 --- /dev/null +++ b/modules/desktop/akonadi.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + programs.kde-pim = { + enable = true; + kmail = true; + merkuro = true; + kontact = true; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 2cfe5bf..de32b42 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -22,6 +22,7 @@ in ./wayland.nix ./wms ./steam.nix + ./akonadi.nix ]; options.addons.desktop = with types; { wmMeta = mkOption { diff --git a/modules/desktop/wms/cosmic.nix b/modules/desktop/wms/cosmic.nix new file mode 100644 index 0000000..d2929f1 --- /dev/null +++ b/modules/desktop/wms/cosmic.nix @@ -0,0 +1,20 @@ +{ config, lib, ... }: +let + cfg = config.addons.desktop.cosmic; +in +{ + options.addons.desktop.cosmic = { + enable = lib.mkEnableOption "Enable Cosmic WM"; + enableScheduler = lib.mkEnableOption "Enable the special scheduler from system76"; + }; + + config = lib.mkIf cfg.enable ( + lib.mkMerge [ + (import ../../../utils/makeWm.nix "Cosmic WM" "wayland") + { + services.desktopManager.cosmic.enable = true; + services.system76-scheduler.enable = cfg.enableScheduler; + } + ] + ); +} diff --git a/modules/desktop/wms/default.nix b/modules/desktop/wms/default.nix index 9f7a18d..ea6b61e 100644 --- a/modules/desktop/wms/default.nix +++ b/modules/desktop/wms/default.nix @@ -3,5 +3,6 @@ imports = [ ./hyprland.nix ./xfce.nix + ./cosmic.nix ]; } diff --git a/modules/desktop/wms/hyprland.nix b/modules/desktop/wms/hyprland.nix index d339f98..5beda89 100644 --- a/modules/desktop/wms/hyprland.nix +++ b/modules/desktop/wms/hyprland.nix @@ -20,13 +20,13 @@ in programs.hyprland.withUWSM = true; programs.uwsm = { enable = true; - waylandCompositors = { - hyprland = { - prettyName = "Hyprland"; - comment = "Hyprland compositor managed by UWSM"; - binPath = "/run/current-system/sw/bin/Hyprland"; - }; - }; + # waylandCompositors = { + # hyprland = { + # prettyName = "Hyprland"; + # comment = "Hyprland compositor managed by UWSM"; + # # binPath = "/run/current-system/sw/bin/Hyprland"; + # }; + # }; }; environment.systemPackages = with pkgs; [ diff --git a/modules/motd.nix b/modules/motd.nix new file mode 100644 index 0000000..f9f572c --- /dev/null +++ b/modules/motd.nix @@ -0,0 +1,89 @@ +{ pkgs, config, ... }: +let + banner_script = pkgs.writeShellScript "motd_banner.sh" '' + echo "This is a nice banner, property of wilkuu (wilkuu.xyz)" + echo -e "\n\tTODO: Put a banner here\t\n" + echo "Current hostname: ${config.networking.hostName}" + ''; + + # Code stolen from the nix store so I can finish motd_shell + motdConf = + pkgs.runCommand "motd.toml" + { + __structuredAttrs = true; + inherit (config.programs.rust-motd) order settings; + nativeBuildInputs = [ + pkgs.remarshal + pkgs.jq + ]; + } + '' + cat "$NIX_ATTRS_JSON_FILE" \ + | jq '.settings as $settings + | .order + | map({ key: ., value: $settings."\(.)" }) + | from_entries' -r \ + | json2toml /dev/stdin "$out" + ''; + + motd_shell = pkgs.writeShellScriptBin "motd_shell" '' + if [[ -n "$SHOW_MOTD" && -x /run/current-system/sw/bin/rust-motd ]]; then + unset SHOW_MOTD + ${pkgs.rust-motd}/bin/rust-motd ${motdConf} + fi + $1 + ''; +in +{ + environment.systemPackages = with pkgs; [ + rust-motd + motd_shell + ]; + programs.rust-motd = { + enable = true; + order = [ + "banner" + "uptime" + "load_avg" + "filesystems" + "memory" + "last_run" + "global" + ]; + settings = { + banner = { + color = "light_magenta"; + # TODO: Make this nice + command = "bash ${banner_script}"; + }; + uptime = { + prefix = "Uptime: "; + }; + load_avg = { + format = '' + Load: [1m] [5m] [15m] + {one:.02} , {five:.02} , {fifteen:.02} + ''; + }; + filesystems = { + root = "/"; + store = "/store2"; + ntfs = "/win_games"; + }; + memory = { + swap_pos = "beside"; + }; + last_run = { }; + }; + }; + security.pam.services.kitty = { + showMotd = true; + }; + security.pam.services.kitty-wrapper = { + showMotd = true; + }; + security.pam.services.login = { + showMotd = true; + }; + +} |
