From 9ad890a27bd8cb38d90f9999e9d45fbf9918bfff Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sat, 11 Jul 2020 04:08:58 +0200 Subject: [PATCH] create gui and game profiles --- machines/desktop.nix | 1 + machines/laptop.nix | 2 ++ profiles/base/default.nix | 60 +++++++++++++++-------------------- profiles/default.nix | 2 +- profiles/games/default.nix | 32 +++++++++++++++++++ profiles/gui.nix | 11 +++++++ profiles/xsession/audio.nix | 2 ++ profiles/xsession/default.nix | 3 +- profiles/xsession/polybar.nix | 26 ++++++++------- 9 files changed, 92 insertions(+), 47 deletions(-) create mode 100644 profiles/games/default.nix create mode 100644 profiles/gui.nix diff --git a/machines/desktop.nix b/machines/desktop.nix index 14b23cd..fb1d6e3 100644 --- a/machines/desktop.nix +++ b/machines/desktop.nix @@ -10,6 +10,7 @@ profiles.xsession.enable = true; profiles.zsh.enable = true; + profiles.games.enable = true; programs.home-manager = { enable = true; diff --git a/machines/laptop.nix b/machines/laptop.nix index f5eb85a..4d59a43 100644 --- a/machines/laptop.nix +++ b/machines/laptop.nix @@ -7,9 +7,11 @@ eth = "enp0s25"; }; profiles.base.enable = true; + profiles.gui.enable = true; profiles.xsession.enable = true; profiles.zsh.enable = true; + profiles.games.enable = true; programs.home-manager = { enable = true; diff --git a/profiles/base/default.nix b/profiles/base/default.nix index a34f35c..8973025 100644 --- a/profiles/base/default.nix +++ b/profiles/base/default.nix @@ -19,27 +19,36 @@ in { home.packages = with pkgs; [ #libguestfs - #virtmanager - #virt-viewer #ansible - nixops + #nixops ldns + lsof + htop file tmux - -# danstable.mangohud - - steam -# dolphinEmuMaster - #dwarf-fortress-packages.dwarf-fortress-full - multimc - #superTuxKart -# warsow -# minetest + unzip + p7zip + parallel + sshfs + jq + + ncdu + + bat + ripgrep + + mkvtoolnix +# unstable.youtubeDL + ffmpeg-full + + ] ++ lib.optionals config.profiles.gui.enable [ +# virtmanager +# virt-viewer + mpv sxiv spotify @@ -54,24 +63,11 @@ in { kdeFrameworks.kded kdeFrameworks.kio kdeApplications.kio-extras - - unzip - p7zip - parallel - sshfs - jq - ncdu - - bat - ripgrep - dan.rank_photos # ***REMOVED*** -# dan.photini - gnome3.gedit unstable.vscode # texlive.combined.scheme-full @@ -85,26 +81,22 @@ in { # godot # blender # audacity - #mixxx +# mixxx # ardour kdenlive frei0r - - mkvtoolnix -# unstable.youtubeDL - ffmpeg-full - + geogebra ]; programs.firefox = { - enable = true; + enable = config.profiles.gui.enable; package = pkgs.firefox.override { extraNativeMessagingHosts = [ pkgs.dan.radical-native ]; }; }; programs.obs-studio = { - enable = true; + enable = config.profiles.gui.enable; }; diff --git a/profiles/default.nix b/profiles/default.nix index 1fa84ae..957953d 100644 --- a/profiles/default.nix +++ b/profiles/default.nix @@ -1 +1 @@ -{ imports = [ ./base ./xsession ./zsh ]; } +{ imports = [ ./base ./xsession ./zsh ./gui.nix ./games ]; } diff --git a/profiles/games/default.nix b/profiles/games/default.nix new file mode 100644 index 0000000..59082b2 --- /dev/null +++ b/profiles/games/default.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.profiles.games; + gui = config.profiles.gui; +in { + + options.profiles.games = { + enable = lib.mkEnableOption "Whether or not to install video game software"; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + fortune + lolcat + neofetch + pipes + ] ++ lib.optionals config.profiles.gui.enable [ + steam + + multimc +# minetest +# dwarf-fortress-packages.dwarf-fortress-full +# superTuxKart +# warsow + xonotic + zeroad + +# dolphinEmuMaster + ]; + }; +} diff --git a/profiles/gui.nix b/profiles/gui.nix new file mode 100644 index 0000000..dd25bd9 --- /dev/null +++ b/profiles/gui.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.profiles.base; +in { + + options.profiles.gui = { + enable = lib.mkEnableOption "Whether or not to install programs with user-interfaces"; + }; + +} diff --git a/profiles/xsession/audio.nix b/profiles/xsession/audio.nix index 107141c..86d4b09 100644 --- a/profiles/xsession/audio.nix +++ b/profiles/xsession/audio.nix @@ -4,6 +4,8 @@ config = lib.mkIf config.profiles.xsession.enable { home.packages = [ pkgs.jack2 + ] ++ lib.optionals config.profiles.gui.enable [ + pkgs.pavucontrol pkgs.qjackctl ]; diff --git a/profiles/xsession/default.nix b/profiles/xsession/default.nix index 51b0376..165ad77 100644 --- a/profiles/xsession/default.nix +++ b/profiles/xsession/default.nix @@ -12,6 +12,8 @@ in config = lib.mkIf cfg.enable { + profiles.gui.enable = true; + home.keyboard = { layout = "no-latin1"; }; @@ -102,7 +104,6 @@ in home.packages = [ pkgs.brightnessctl - pkgs.pavucontrol pkgs.xorg.xkill pkgs.arandr diff --git a/profiles/xsession/polybar.nix b/profiles/xsession/polybar.nix index 28355dc..95ea30d 100644 --- a/profiles/xsession/polybar.nix +++ b/profiles/xsession/polybar.nix @@ -95,19 +95,23 @@ in ramp-signal-3 = ""; ramp-signal-4 = ""; ramp-signal-foreground = "\${colors.foreground-alt}"; - }; - "module/eth" = { - type = "internal/network"; - interface = "${config.machine.eth}"; - interval = "3.0"; + }; + "module/eth" = if config.machine.eth != null + then + { + type = "internal/network"; + interface = "${config.machine.eth}"; + interval = "3.0"; - format-connected-underline = "#55aa55"; - format-connected-prefix = " "; - format-connected-prefix-foreground = "\${colors.foreground-alt}"; - label-connected = "%local_ip%"; + format-connected-underline = "#55aa55"; + format-connected-prefix = " "; + format-connected-prefix-foreground = "\${colors.foreground-alt}"; + label-connected = "%local_ip%"; - format-disconnected = ""; - }; + format-disconnected = ""; + } + else + null; "module/filesystem" = { type = "internal/fs"; interval = 25;