nixos-config/default.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

2020-12-29 04:10:08 +00:00
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.sconfig;
in
{
options.sconfig = {
2020-12-29 06:18:46 +00:00
profile = mkOption {
type = types.enum [ "server" "desktop-gnome" "desktop-sway" ];
};
2020-12-29 04:10:08 +00:00
scroll-boost = mkEnableOption "Patch libinput scroll speed";
status-on-console = mkEnableOption "Display Neofetch on system console";
};
config = mkMerge [
(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; }))
];
2020-12-29 04:50:52 +00:00
imports = [
./modules/alacritty.nix
2020-12-29 18:58:59 +00:00
./modules/baseline.nix
./modules/cli.nix
2020-12-29 04:50:52 +00:00
];
2020-12-29 04:10:08 +00:00
}