From 0e4c6841cfdc312ab72ff252eefc8450994759c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bori?= Date: Sun, 17 Nov 2024 02:26:33 +0100 Subject: [PATCH] :sparkles: Added games, greeting, more up-to-date nixpkgs versions --- flake.lock | 16 +++++++++++++++ flake.nix | 4 ++++ .../x86_64-linux/theobori@laptop/default.nix | 1 + modules/home/cli/programs/krabby/default.nix | 20 +++++++++++++++++++ modules/home/cli/programs/tldr/default.nix | 20 +++++++++++++++++++ modules/home/cli/shells/fish/default.nix | 18 ++++++----------- modules/home/games/vkquake/default.nix | 20 +++++++++++++++++++ modules/home/roles/development/default.nix | 2 ++ modules/home/roles/gaming/default.nix | 1 + 9 files changed, 90 insertions(+), 12 deletions(-) create mode 100644 modules/home/cli/programs/krabby/default.nix create mode 100644 modules/home/cli/programs/tldr/default.nix create mode 100644 modules/home/games/vkquake/default.nix diff --git a/flake.lock b/flake.lock index 11a7b86..ad62b82 100644 --- a/flake.lock +++ b/flake.lock @@ -657,6 +657,21 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1731799881, + "narHash": "sha256-GRlDXqmwJoW3F0Ymn0ETLsxujLD5idvdaDEzIjF5EEs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "cd43d6867192ddfb98ba106065a89790e2722b3f", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1729665710, @@ -848,6 +863,7 @@ "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_5", "nixpkgs-85f7e66": "nixpkgs-85f7e66", + "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", "plasma-manager": "plasma-manager", "pre-commit-hooks-nix": "pre-commit-hooks-nix", diff --git a/flake.nix b/flake.nix index 2c22773..94a51b7 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,10 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs"; + + # We assume this version of nixpkgs is more updated than the `nixpkgs` input. + # Will be used within overlay to get the latest version of specific packages. + nixpkgs-unstable.url = "github:nixos/nixpkgs"; nixpkgs-85f7e66.url = "github:nixos/nixpkgs/85f7e662eda4fa3a995556527c87b2524b691933"; home-manager = { diff --git a/homes/x86_64-linux/theobori@laptop/default.nix b/homes/x86_64-linux/theobori@laptop/default.nix index 943c72e..6932321 100644 --- a/homes/x86_64-linux/theobori@laptop/default.nix +++ b/homes/x86_64-linux/theobori@laptop/default.nix @@ -31,4 +31,5 @@ in }; home.stateVersion = "24.11"; + home.enableNixpkgsReleaseCheck = false; } diff --git a/modules/home/cli/programs/krabby/default.nix b/modules/home/cli/programs/krabby/default.nix new file mode 100644 index 0000000..e71929d --- /dev/null +++ b/modules/home/cli/programs/krabby/default.nix @@ -0,0 +1,20 @@ +{ + pkgs, + config, + lib, + namespace, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + + cfg = config.${namespace}.cli.programs.krabby; +in +{ + options.${namespace}.cli.programs.krabby = { + enable = mkBoolOpt false "Whether or not to enable krabby."; + }; + + config = mkIf cfg.enable { home.packages = with pkgs; [ krabby ]; }; +} diff --git a/modules/home/cli/programs/tldr/default.nix b/modules/home/cli/programs/tldr/default.nix new file mode 100644 index 0000000..ce4dadb --- /dev/null +++ b/modules/home/cli/programs/tldr/default.nix @@ -0,0 +1,20 @@ +{ + pkgs, + config, + lib, + namespace, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + + cfg = config.${namespace}.cli.programs.tldr; +in +{ + options.${namespace}.cli.programs.tldr = { + enable = mkBoolOpt false "Whether or not to enable tldr."; + }; + + config = mkIf cfg.enable { home.packages = with pkgs; [ tldr ]; }; +} diff --git a/modules/home/cli/shells/fish/default.nix b/modules/home/cli/shells/fish/default.nix index 124f0f4..285ffdb 100644 --- a/modules/home/cli/shells/fish/default.nix +++ b/modules/home/cli/shells/fish/default.nix @@ -6,7 +6,7 @@ ... }: let - inherit (lib) mkIf; + inherit (lib) mkIf getExe; inherit (lib.${namespace}) mkBoolOpt; cfg = config.${namespace}.cli.shells.fish; @@ -21,7 +21,7 @@ in enable = true; interactiveShellInit = '' # There are fish intregration from home-manager module - ${pkgs.nix-your-shell}/bin/nix-your-shell --nom fish | source + ${getExe pkgs.nix-your-shell} --nom fish | source set -gx GOPATH $XDG_DATA_HOME/go set -gx PATH /usr/local/bin /usr/bin ~/.local/bin $GOPATH/bin/ $PATH $HOME/.cargo/bin @@ -42,18 +42,12 @@ in cdi = "zi"; curl = "curlie"; tree = "eza --tree"; - - # nix - nhh = "nh home switch"; - nho = "nh os switch"; - nhu = "nh os --update"; - - nd = "nix develop"; - nfu = "nix flake update"; }; functions = { - fish_greeting = ''''; + fish_greeting = '' + ${getExe pkgs.krabby} name gengar --no-title + ''; hmg = '' set current_gen (home-manager generations | head -n 1 | awk '{print $7}') @@ -64,7 +58,7 @@ in # If you run the command with comma, running the same command # will not prompt for confirmation for the rest of the session if contains $argv[1] $__command_not_found_confirmed_commands - or ${pkgs.gum}/bin/gum confirm --selected.background=2 "Run using comma?" + or ${getExe pkgs.gum} confirm --selected.background=2 "Run using comma?" # Not bothering with capturing the status of the command, just run it again if not contains $argv[1] $__command_not_found_confirmed_commands diff --git a/modules/home/games/vkquake/default.nix b/modules/home/games/vkquake/default.nix new file mode 100644 index 0000000..776a88e --- /dev/null +++ b/modules/home/games/vkquake/default.nix @@ -0,0 +1,20 @@ +{ + pkgs, + config, + lib, + namespace, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkBoolOpt; + + cfg = config.${namespace}.games.vkquake; +in +{ + options.${namespace}.games.vkquake = { + enable = mkBoolOpt false "Enable vkquake."; + }; + + config = mkIf cfg.enable { home.packages = with pkgs; [ vkquake ]; }; +} diff --git a/modules/home/roles/development/default.nix b/modules/home/roles/development/default.nix index ddd719f..5e5b78f 100644 --- a/modules/home/roles/development/default.nix +++ b/modules/home/roles/development/default.nix @@ -48,6 +48,8 @@ in zoxide = enabled; thefuck = enabled; lazygit = enabled; + tldr = enabled; + krabby = enabled; }; }; }; diff --git a/modules/home/roles/gaming/default.nix b/modules/home/roles/gaming/default.nix index 2cbe168..cc6b065 100644 --- a/modules/home/roles/gaming/default.nix +++ b/modules/home/roles/gaming/default.nix @@ -21,6 +21,7 @@ in teeworlds = enabled; taterclient-ddnet = enabled; supermariowar = enabled; + vkquake = enabled; }; }; };