diff --git a/hosts/common.nix b/hosts/common.nix index bc1a17b..87a063b 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -21,6 +21,11 @@ type = types.str; description = "Link to dotfiles repository."; }; + unfreePackages = mkOption { + type = types.listOf types.str; + description = "List of unfree packages to allow."; + default = [ ]; + }; }; config = { @@ -35,9 +40,13 @@ home-manager.useGlobalPkgs = true; # Install packages to /etc/profiles instead of ~/.nix-profile, useful when - # using multiple profiles + # using multiple profiles for one user home-manager.useUserPackages = true; + # Allow specified unfree packages (identified elsewhere) + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) config.unfreePackages; + # Set a variable for dotfiles repo, not necessary but convenient home-manager.users.${config.user} = { home.sessionVariables = { DOTS = config.dotfilesPath; }; diff --git a/modules/applications/1password.nix b/modules/applications/1password.nix index 64b7b48..51e533a 100644 --- a/modules/applications/1password.nix +++ b/modules/applications/1password.nix @@ -1,7 +1,7 @@ { config, pkgs, lib, ... }: { config = lib.mkIf config.gui.enable { - nixpkgs.config.allowUnfree = true; + unfreePackages = [ "1password" "_1password-gui" ]; home-manager.users.${config.user} = { home.packages = with pkgs; [ _1password-gui ]; }; diff --git a/modules/applications/discord.nix b/modules/applications/discord.nix index 8cdfe00..6a3fcb3 100644 --- a/modules/applications/discord.nix +++ b/modules/applications/discord.nix @@ -1,8 +1,8 @@ { config, pkgs, lib, ... }: { config = lib.mkIf config.gui.enable { + unfreePackages = [ "discord" ]; home-manager.users.${config.user} = { - nixpkgs.config.allowUnfree = true; home.packages = with pkgs; [ discord ]; }; }; diff --git a/modules/applications/firefox.nix b/modules/applications/firefox.nix index 14d4066..1f62c37 100644 --- a/modules/applications/firefox.nix +++ b/modules/applications/firefox.nix @@ -2,6 +2,14 @@ { config = lib.mkIf config.gui.enable { + + # nixpkgs.config.allowUnfreePredicate = pkg: + # builtins.elem (lib.getName pkg) [ "onepassword-password-manager" ]; + nixpkgs.config.allowlistedLicenses = [ + pkgs.nur.repos.rycee.firefox-addons.onepassword-password-manager.meta.license + pkgs.nur.repos.rycee.firefox-addons.okta-browser-plugin.meta.license + ]; + home-manager.users.${config.user} = { programs.firefox = { diff --git a/modules/editor/neovim/keybinds.lua b/modules/editor/neovim/keybinds.lua index 7326834..f430972 100644 --- a/modules/editor/neovim/keybinds.lua +++ b/modules/editor/neovim/keybinds.lua @@ -57,6 +57,12 @@ key("n", "gb", ":Telescope git_branches") key("n", "gs", ":Telescope git_status") key("n", "", "lua choose_project()") +-- Buffer tabs (tmux interferes) +-- key("n", "", "gt") +-- key("i", "", "gt") +-- key("n", "", "gT") +-- key("i", "", "gT") + -- LSP key("n", "gd", "lua vim.lsp.buf.definition()", { silent = true }) key("n", "gT", "lua vim.lsp.buf.type_definition()", { silent = true }) diff --git a/modules/gaming/leagueoflegends.nix b/modules/gaming/leagueoflegends.nix index abc8d38..3121923 100644 --- a/modules/gaming/leagueoflegends.nix +++ b/modules/gaming/leagueoflegends.nix @@ -4,8 +4,6 @@ config = lib.mkIf config.gaming.leagueoflegends { - nixpkgs.config.allowUnfree = true; - # League of Legends anti-cheat requirement boot.kernel.sysctl = { "abi.vsyscall32" = 0; }; diff --git a/modules/gaming/legendary.nix b/modules/gaming/legendary.nix index 1dd838c..4daba2f 100644 --- a/modules/gaming/legendary.nix +++ b/modules/gaming/legendary.nix @@ -42,12 +42,10 @@ in { epic-games = { body = '' set game (legendary list 2>/dev/null \ - | tail -n +3 \ - | head -n -2 \ + | awk '/^ \* / { print $0; }' \ | sed -e 's/ (.*)$//' -e 's/ \* //' \ - | awk '!/^ / { print $0; }' \ | fzf) - and legendary launch "$game" 2>/dev/null + and legendary launch "$game" &> /dev/null ''; }; }; diff --git a/modules/gaming/steam.nix b/modules/gaming/steam.nix index f77d5ef..b23bd7c 100644 --- a/modules/gaming/steam.nix +++ b/modules/gaming/steam.nix @@ -4,7 +4,7 @@ config = lib.mkIf config.gaming.steam { hardware.steam-hardware.enable = true; - nixpkgs.config.allowUnfree = true; + unfreePackages = [ "steam" "steam-original" "steamcmd" ]; environment.systemPackages = with pkgs; [ steam