diff options
| author | seth <[email protected]> | 2023-01-26 06:08:41 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-01-26 06:08:41 -0500 |
| commit | 08895833e51bdfd760f2b4915a3997c13fe65b13 (patch) | |
| tree | 76e0ec29dea51c9a0aa0502cf8e87eadc71dd3ec /hosts/common | |
| parent | 43bf016d0fb5b3b2db796fdc37abf243f1223df1 (diff) | |
more refactoring
Diffstat (limited to 'hosts/common')
| -rw-r--r-- | hosts/common/default.nix | 5 | ||||
| -rw-r--r-- | hosts/common/desktop/default.nix | 6 | ||||
| -rw-r--r-- | hosts/common/desktop/gnome.nix | 6 | ||||
| -rw-r--r-- | hosts/common/documentation.nix | 6 | ||||
| -rw-r--r-- | hosts/common/fonts.nix | 36 | ||||
| -rw-r--r-- | hosts/common/hardware/default.nix | 1 | ||||
| -rw-r--r-- | hosts/common/options.nix | 14 | ||||
| -rw-r--r-- | hosts/common/packages.nix | 19 | ||||
| -rw-r--r-- | hosts/common/security.nix | 10 | ||||
| -rw-r--r-- | hosts/common/systemd.nix | 6 |
10 files changed, 63 insertions, 46 deletions
diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 2923ae0..5448bbb 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,9 +1,10 @@ -{lib, ...}: { +{config, ...}: { imports = [ - ./options.nix ./documentation.nix ./fonts.nix ./locale.nix + ./options.nix + ./packages.nix ./security.nix ./systemd.nix ./users.nix diff --git a/hosts/common/desktop/default.nix b/hosts/common/desktop/default.nix index d5cc99f..74faa77 100644 --- a/hosts/common/desktop/default.nix +++ b/hosts/common/desktop/default.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: { +{lib, ...}: { programs.xwayland.enable = true; xdg.portal.enable = true; environment.noXlibs = lib.mkForce false; diff --git a/hosts/common/desktop/gnome.nix b/hosts/common/desktop/gnome.nix index 76e02cb..e05a0cd 100644 --- a/hosts/common/desktop/gnome.nix +++ b/hosts/common/desktop/gnome.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { imports = [ ./. ]; diff --git a/hosts/common/documentation.nix b/hosts/common/documentation.nix index 85de6f9..ad7300d 100644 --- a/hosts/common/documentation.nix +++ b/hosts/common/documentation.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [man-pages man-pages-posix]; documentation = { dev.enable = true; diff --git a/hosts/common/fonts.nix b/hosts/common/fonts.nix index 9cec045..c49f99c 100644 --- a/hosts/common/fonts.nix +++ b/hosts/common/fonts.nix @@ -2,11 +2,11 @@ config, pkgs, ... -}: { - fonts = { - fonts = with pkgs; - if config.system.gui-stuff - then [ +}: let + guiFonts = + if config.sys.gui.enable + then + with pkgs; [ noto-fonts noto-fonts-extra noto-fonts-emoji @@ -14,15 +14,21 @@ fira-code (nerdfonts.override {fonts = ["FiraCode"];}) ] - else []; - fontconfig.defaultFonts = - if config.system.gui-stuff - then { - serif = ["Noto Serif"]; - sansSerif = ["Noto Sans"]; - emoji = ["Noto Color Emoji"]; - monospace = ["Fira Code"]; - } - else {}; + else []; + + guiDefaultFonts = + if config.sys.gui.enable + then { + serif = ["Noto Serif"]; + sansSerif = ["Noto Sans"]; + emoji = ["Noto Color Emoji"]; + monospace = ["Fira Code"]; + } + else {}; +in { + fonts = { + enableDefaultFonts = true; + fonts = guiFonts; + fontconfig.defaultFonts = guiDefaultFonts; }; } diff --git a/hosts/common/hardware/default.nix b/hosts/common/hardware/default.nix index e7e6350..4d54961 100644 --- a/hosts/common/hardware/default.nix +++ b/hosts/common/hardware/default.nix @@ -1,6 +1,5 @@ _: { imports = [ ./nvidia.nix - ./zfs.nix ]; } diff --git a/hosts/common/options.nix b/hosts/common/options.nix index 2d532ed..8d4bf5b 100644 --- a/hosts/common/options.nix +++ b/hosts/common/options.nix @@ -1,14 +1,14 @@ {lib, ...}: { - options.system = with lib.types; { - devel-packages = lib.mkOption { - type = bool; + options.sys = with lib; { + gui.enable = mkOption { + type = types.bool; default = false; - description = "install development packages for neovim lsp"; + description = "install gui-related packages"; }; - gui-stuff = lib.mkOption { - type = bool; + wsl.enable = mkOption { + type = types.bool; default = false; - description = "install gui-related packages"; + description = "signifies that the flake is being installed in wsl"; }; }; } diff --git a/hosts/common/packages.nix b/hosts/common/packages.nix new file mode 100644 index 0000000..dbb0091 --- /dev/null +++ b/hosts/common/packages.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + git + neofetch + nixos-option + pinentry-curses + python310 + vim + ]; + + programs = { + gnupg = { + agent = { + enable = true; + pinentryFlavor = "curses"; + }; + }; + }; +} diff --git a/hosts/common/security.nix b/hosts/common/security.nix index 32c2ff5..04ae595 100644 --- a/hosts/common/security.nix +++ b/hosts/common/security.nix @@ -1,8 +1,10 @@ -_: { +{config, ...}: let + value = config.sys.wsl.enable; +in { security = { - apparmor.enable = true; - audit.enable = true; - auditd.enable = true; + apparmor.enable = value; + audit.enable = value; + auditd.enable = value; rtkit.enable = true; sudo = { configFile = '' diff --git a/hosts/common/systemd.nix b/hosts/common/systemd.nix index 1c71cfc..9d44da4 100644 --- a/hosts/common/systemd.nix +++ b/hosts/common/systemd.nix @@ -1,10 +1,12 @@ -{config, ...}: { +{config, ...}: let + value = config.sys.wsl.enable; +in { services = { journald.extraConfig = '' MaxRetentionSec=1w ''; resolved = { - enable = true; + enable = value; dnssec = "allow-downgrade"; extraConfig = '' [Resolve] |
