diff --git a/nix/configuration/hosts/odo/default.nix b/nix/configuration/hosts/odo/default.nix index 9fef9e4..c15c980 100644 --- a/nix/configuration/hosts/odo/default.nix +++ b/nix/configuration/hosts/odo/default.nix @@ -32,6 +32,8 @@ me.alacritty.enable = true; me.ansible.enable = true; me.ares.enable = true; + me.chromecast.enable = true; + me.chromium.enable = true; me.emacs_flavor = "full"; me.graphical = true; me.graphicsCardType = "amd"; diff --git a/nix/configuration/roles/chromecast/default.nix b/nix/configuration/roles/chromecast/default.nix index a762bc0..d84022c 100644 --- a/nix/configuration/roles/chromecast/default.nix +++ b/nix/configuration/roles/chromecast/default.nix @@ -8,7 +8,24 @@ { imports = [ ]; - environment.systemPackages = with pkgs; [ - catt - ]; + options.me = { + chromecast.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install chromecast."; + }; + }; + + config = lib.mkIf config.me.chromecast.enable ( + lib.mkMerge [ + { + environment.systemPackages = with pkgs; [ + catt + ]; + } + (lib.mkIf config.me.graphical { + }) + ] + ); } diff --git a/nix/configuration/roles/chromium/default.nix b/nix/configuration/roles/chromium/default.nix index fcee893..36e56fa 100644 --- a/nix/configuration/roles/chromium/default.nix +++ b/nix/configuration/roles/chromium/default.nix @@ -8,45 +8,58 @@ { imports = [ ]; - # TODO: Read https://bbs.archlinux.org/viewtopic.php?pid=2209507#p2209507 and apply desired settings. - - environment.systemPackages = with pkgs; [ - (chromium.override { enableWideVine = true; }) - ]; - - allowedUnfree = [ - "chromium" - "chromium-unwrapped" - "widevine-cdm" - ]; - - environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) { - hideMounts = true; - users.talexander = { - directories = [ - { - directory = ".config/chromium"; - user = "talexander"; - group = "talexander"; - mode = "0700"; - } - ]; - }; - }; - environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) { - hideMounts = true; - users.talexander = { - directories = [ - { - directory = ".cache/chromium"; - user = "talexander"; - group = "talexander"; - mode = "0700"; - } - ]; + options.me = { + chromium.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install chromium."; }; }; - # Enabling vulkan causes video to render as white - # nixpkgs.config.chromium.commandLineArgs = "--enable-features=Vulkan"; + config = lib.mkIf config.me.chromium.enable ( + lib.mkMerge [ + { } + (lib.mkIf config.me.graphical { + environment.systemPackages = with pkgs; [ + (chromium.override { enableWideVine = true; }) + ]; + allowedUnfree = [ + "chromium" + "chromium-unwrapped" + "widevine-cdm" + ]; + + environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) { + hideMounts = true; + users.talexander = { + directories = [ + { + directory = ".config/chromium"; + user = "talexander"; + group = "talexander"; + mode = "0700"; + } + ]; + }; + }; + environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) { + hideMounts = true; + users.talexander = { + directories = [ + { + directory = ".cache/chromium"; + user = "talexander"; + group = "talexander"; + mode = "0700"; + } + ]; + }; + }; + + # Enabling vulkan causes video to render as white + # nixpkgs.config.chromium.commandLineArgs = "--enable-features=Vulkan"; + }) + ] + ); }