From 30ada231ab2f7f2a615cc0d5dd6fb8de62f13508 Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Mon, 28 Dec 2020 23:10:08 -0500 Subject: [PATCH] add default.nix --- default.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..a80f7d6 --- /dev/null +++ b/default.nix @@ -0,0 +1,40 @@ +{ config, pkgs, lib, ... }: +with lib; +let + cfg = config.sconfig; +in +{ + options.sconfig = { + + profile = mkOption { type = types.str; }; + + scroll-boost = mkEnableOption "Patch libinput scroll speed"; + + status-on-console = mkEnableOption "Display Neofetch on system console"; + + }; + + config = mkMerge [ + + (import ./modules/cli.nix { inherit config pkgs lib; }) + (import ./modules/baseline.nix { inherit config pkgs lib; }) + + (mkIf (cfg.profile == "server") (mkMerge [ + { services.openssh.enable = true; } + (import ./modules/auto-update.nix { }) + ])) + + (mkIf (cfg.profile == "desktop-sway") (import ./modules/sway { inherit pkgs; })) + (mkIf (cfg.profile == "desktop-gnome") (import ./modules/gnome { inherit pkgs; })) + + (mkIf ("desktop-" == builtins.substring 0 8 cfg.profile) (mkMerge [ + (import ./modules/security-tools.nix { inherit pkgs; }) + (import ./modules/graphical.nix { inherit pkgs; }) + ])) + + (mkIf cfg.scroll-boost (import ./modules/scroll-boost { })) + (mkIf cfg.status-on-console (import ./modules/status-on-console { inherit pkgs; })) + + ]; + +}