diff --git a/configurations/citrix.nix b/configurations/citrix.nix index 57737aff..2fb8c5c6 100644 --- a/configurations/citrix.nix +++ b/configurations/citrix.nix @@ -1,7 +1,10 @@ { ... }: { - chvp.zfs.homeLinks = [ - { path = ".ICAClient"; type = "data"; } - ]; + chvp = { + nix.unfreePackages = [ "citrix-workspace" ]; + zfs.homeLinks = [ + { path = ".ICAClient"; type = "data"; } + ]; + }; home-manager.users.charlotte = { pkgs, ... }: { home.packages = with pkgs; [ citrix_workspace ]; }; diff --git a/configurations/dropbox.nix b/configurations/dropbox.nix index 64b08af7..4069634c 100644 --- a/configurations/dropbox.nix +++ b/configurations/dropbox.nix @@ -27,4 +27,5 @@ }; }; }; + chvp.nix.unfreePackages = [ "dropbox" ]; } diff --git a/configurations/teams.nix b/configurations/teams.nix index 78c25a63..cfc3466b 100644 --- a/configurations/teams.nix +++ b/configurations/teams.nix @@ -5,7 +5,10 @@ home.packages = with pkgs; [ teams ]; }; - chvp.zfs.homeLinks = [ - { path = ".config/Microsoft"; type = "data"; } - ]; + chvp = { + nix.unfreePackages = [ "teams" ]; + zfs.homeLinks = [ + { path = ".config/Microsoft"; type = "data"; } + ]; + }; } diff --git a/machines/kharbranth/default.nix b/machines/kharbranth/default.nix index ab4adc9b..686a2294 100644 --- a/machines/kharbranth/default.nix +++ b/machines/kharbranth/default.nix @@ -24,7 +24,6 @@ eid.enable = true; git.email = "charlotte.vanpetegem@ugent.be"; gomuks.enable = true; - nix.enableUnfree = true; zfs = { enable = true; encrypted = true; diff --git a/machines/kholinar/default.nix b/machines/kholinar/default.nix index 2dbd4dc5..fed6f0e8 100644 --- a/machines/kholinar/default.nix +++ b/machines/kholinar/default.nix @@ -24,7 +24,7 @@ eid.enable = true; git.email = "charlotte@vanpetegem.me"; gomuks.enable = true; - nix.enableUnfree = true; + minecraft.client = true; zeroad.enable = true; zfs = { enable = true; diff --git a/machines/urithiru/secret.nix b/machines/urithiru/secret.nix index 866727b0..74910c03 100644 Binary files a/machines/urithiru/secret.nix and b/machines/urithiru/secret.nix differ diff --git a/modules/default.nix b/modules/default.nix index f0e84b2d..6dea3ca6 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -10,6 +10,7 @@ ./git.nix ./global-mailer.nix ./gomuks.nix + ./minecraft.nix ./neovim.nix ./nix.nix ./nginx.nix diff --git a/modules/minecraft.nix b/modules/minecraft.nix new file mode 100644 index 00000000..56e2b866 --- /dev/null +++ b/modules/minecraft.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.minecraft = { + client = lib.mkOption { + default = false; + example = true; + }; + server = lib.mkOption { + default = false; + example = true; + }; + }; + + config = lib.mkIf (config.chvp.minecraft.client || config.chvp.minecraft.server) { + home-manager.users.charlotte = lib.mkIf config.chvp.minecraft.client ({ ... }: { + home.packages = [ pkgs.minecraft ]; + }); + chvp.zfs.homeLinks = lib.optional config.chvp.minecraft.client { path = ".minecraft"; type = "cache"; }; + services.minecraft-server = lib.mkIf config.chvp.minecraft.server { + enable = true; + dataDir = "${config.chvp.dataPrefix}/var/lib/minecraft-server"; + eula = true; + openFirewall = true; + }; + chvp.nix.unfreePackages = + (lib.optional config.chvp.minecraft.client "minecraft-launcher") ++ + (lib.optional config.chvp.minecraft.server "minecraft-server"); + }; +} diff --git a/modules/nix.nix b/modules/nix.nix index 8b0d5ab2..90d0f353 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -47,9 +47,9 @@ in default = true; example = false; }; - enableUnfree = lib.mkOption { - default = false; - example = true; + unfreePackages = lib.mkOption { + default = [ ]; + example = [ "teams" ]; }; # Note that this is only enabled for charlotte, until https://github.com/bennofs/nix-index/issues/143 is resolved. enableNixIndex = lib.mkOption { @@ -84,14 +84,7 @@ in ''); }; - nixpkgs.config = lib.mkIf config.chvp.nix.enableUnfree { - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "citrix-workspace" - "dropbox" - "teams" - "google-chrome" - ]; - }; + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.chvp.nix.unfreePackages; nixpkgs.overlays = lib.mkIf config.chvp.nix.enableFlakes [ (self: super: { nix = super.nixUnstable; diff --git a/profiles/graphical.nix b/profiles/graphical.nix index e330d564..c8c10b9d 100644 --- a/profiles/graphical.nix +++ b/profiles/graphical.nix @@ -59,5 +59,8 @@ services.fwupd.enable = true; - chvp.gnupg.pinentryFlavor = "qt"; + chvp = { + gnupg.pinentryFlavor = "qt"; + nix.unfreePackages = [ "google-chrome" ]; + }; }