move graphical.nix into profiles.nix

This commit is contained in:
Sean Buckley 2021-06-09 19:38:26 -04:00
parent eef8136258
commit 6a01c1c95a
2 changed files with 77 additions and 75 deletions

View file

@ -1,61 +0,0 @@
{ pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [
brave
gimp
ffmpeg
mpv
tdesktop
element-desktop
pavucontrol
gnome3.dconf-editor
glxinfo
steam-run
(vscode-with-extensions.override {
vscode = vscodium;
vscodeExtensions = with pkgs.vscode-extensions; [
bbenoist.Nix
ms-python.python
ms-vscode.cpptools
ms-azuretools.vscode-docker
];
})
(wrapFirefox firefox-unwrapped {
extraPolicies = {
CaptivePortal = false;
DisablePocket = true;
DisableFirefoxStudies = true;
OfferToSaveLogins = false;
DisableFormHistory = true;
SearchSuggestEnabled = false;
Preferences = {
"extensions.formautofill.available" = { Status = "locked"; Value = "off"; };
"browser.contentblocking.category" = { Status = "locked"; Value = "strict"; };
"network.IDN_show_punycode" = { Status = "locked"; Value = true; };
"browser.zoom.siteSpecific" = { Status = "locked"; Value = false; };
};
};
})
];
services.xserver.deviceSection = ''
Option "VariableRefresh" "true"
'';
programs.steam.enable = true;
virtualisation.docker = { enable = true; enableOnBoot = false; };
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
};
boot.loader.timeout = null;
}

View file

@ -2,24 +2,87 @@
with lib;
let
cfg = config.sconfig.profile;
in
{
options.sconfig.profile = mkOption {
type = types.enum [ "server" "desktop" ];
desktop-config = {
environment.systemPackages = with pkgs; [
brave
gimp
ffmpeg
mpv
tdesktop
element-desktop
pavucontrol
gnome3.dconf-editor
glxinfo
steam-run
(vscode-with-extensions.override {
vscode = vscodium;
vscodeExtensions = with pkgs.vscode-extensions; [
bbenoist.Nix
ms-python.python
ms-vscode.cpptools
ms-azuretools.vscode-docker
];
})
(wrapFirefox firefox-unwrapped {
extraPolicies = {
CaptivePortal = false;
DisablePocket = true;
DisableFirefoxStudies = true;
OfferToSaveLogins = false;
DisableFormHistory = true;
SearchSuggestEnabled = false;
Preferences = {
"extensions.formautofill.available" = { Status = "locked"; Value = "off"; };
"browser.contentblocking.category" = { Status = "locked"; Value = "strict"; };
"network.IDN_show_punycode" = { Status = "locked"; Value = true; };
"browser.zoom.siteSpecific" = { Status = "locked"; Value = false; };
};
};
})
];
services.xserver.deviceSection = ''
Option "VariableRefresh" "true"
'';
programs.steam.enable = true;
virtualisation.docker = { enable = true; enableOnBoot = false; };
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
};
config = mkMerge [
boot.loader.timeout =
if config.boot.loader.systemd-boot.enable
then null else lib.mkOverride 9999 99;
};
(mkIf (cfg == "server") {
server-config = {
services.openssh.enable = true;
documentation.nixos.enable = false;
nix.gc = {
automatic = true;
options = "--delete-older-than 30d";
};
})
};
(mkIf (cfg == "desktop") (import ./graphical.nix { inherit pkgs config; }))
];
in
{
options.sconfig.profile = mkOption {
type = types.enum [ "server" "desktop" ];
};
config = { inherit desktop server; }."${cfg}-config";
}