mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +00:00
move profiles into module
This commit is contained in:
parent
1498eee0c1
commit
debb505816
2 changed files with 29 additions and 26 deletions
28
default.nix
28
default.nix
|
@ -1,30 +1,5 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ ... }:
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.sconfig;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.sconfig.profile = mkOption {
|
|
||||||
type = types.enum [ "server" "desktop-gnome" "desktop-sway" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkMerge [
|
|
||||||
|
|
||||||
(mkIf (cfg.profile == "server") (mkMerge [
|
|
||||||
{ services.openssh.enable = true; }
|
|
||||||
(import ./modules/auto-update.nix { })
|
|
||||||
]))
|
|
||||||
|
|
||||||
(mkIf (cfg.profile == "desktop-sway") (import ./modules/sway.nix { inherit pkgs; }))
|
|
||||||
(mkIf (cfg.profile == "desktop-gnome") (import ./modules/gnome.nix { inherit pkgs; }))
|
|
||||||
|
|
||||||
(mkIf ("desktop-" == builtins.substring 0 8 cfg.profile) (mkMerge [
|
|
||||||
(import ./modules/security-tools.nix { inherit pkgs; })
|
|
||||||
(import ./modules/graphical.nix { inherit pkgs; })
|
|
||||||
]))
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./modules/alacritty.nix
|
./modules/alacritty.nix
|
||||||
./modules/backports.nix
|
./modules/backports.nix
|
||||||
|
@ -32,6 +7,7 @@ in
|
||||||
./modules/cli.nix
|
./modules/cli.nix
|
||||||
./modules/flakes.nix
|
./modules/flakes.nix
|
||||||
./modules/phpipam.nix
|
./modules/phpipam.nix
|
||||||
|
./modules/profiles.nix
|
||||||
./modules/scansnap_s1300.nix
|
./modules/scansnap_s1300.nix
|
||||||
./modules/scroll-boost
|
./modules/scroll-boost
|
||||||
./modules/status-on-console.nix
|
./modules/status-on-console.nix
|
||||||
|
|
27
modules/profiles.nix
Normal file
27
modules/profiles.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.sconfig.profile;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.sconfig.profile = mkOption {
|
||||||
|
type = types.enum [ "server" "desktop-gnome" "desktop-sway" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
|
||||||
|
(mkIf (cfg == "server") (mkMerge [
|
||||||
|
{ services.openssh.enable = true; }
|
||||||
|
(import ./auto-update.nix { })
|
||||||
|
]))
|
||||||
|
|
||||||
|
(mkIf (cfg == "desktop-sway") (import ./sway.nix { inherit pkgs; }))
|
||||||
|
(mkIf (cfg == "desktop-gnome") (import ./gnome.nix { inherit pkgs; }))
|
||||||
|
|
||||||
|
(mkIf ("desktop-" == builtins.substring 0 8 cfg) (mkMerge [
|
||||||
|
(import ./security-tools.nix { inherit pkgs; })
|
||||||
|
(import ./graphical.nix { inherit pkgs; })
|
||||||
|
]))
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
Loading…
Reference in a new issue