diff --git a/hm-modules/shell/nu/default.nix b/hm-modules/shell/nu/default.nix index 3909450..108862a 100644 --- a/hm-modules/shell/nu/default.nix +++ b/hm-modules/shell/nu/default.nix @@ -11,16 +11,46 @@ in { type = types.attrs; default = {}; }; + carapace = { + enable = mkEnableOption "carapace external completions"; + }; }; - config = mkIf cfg.enable { - programs.nushell = { - enable = true; + config = mkIf cfg.enable (mkMerge [ + { + programs.nushell = { + enable = true; - settings = { - }; - } // (lib.optionalAttrs (cfg.shellAliases != null) { - shellAliases = cfg.shellAliases; - }); - }; + settings = { + }; + } // (lib.optionalAttrs (cfg.shellAliases != null) { + shellAliases = cfg.shellAliases; + }); + } + + (mkIf cfg.carapace.enable { + home.packages = [ pkgs.carapace ]; + + programs.nushell.extraConfig = '' + let carapace_completer = {|spans: list| + # if the current command is an alias, get the aliased command + let expanded_alias = (scope aliases | where name == $spans.0 | get value.0?.0?) + # overwrite + let spans = (if $expanded_alias != null { + $spans + | skip 1 + | prepend ($expanded_alias | split row " " | take 1) + } else { $spans }) + carapace $spans.0 nushell ...$spans + | from json + } + + $env.config.completions.external = { + enable: true + max_results: 100 + completer: $carapace_completer + } + ''; + }) + ]); } diff --git a/machines/fujin/main/default.nix b/machines/fujin/main/default.nix index a304235..31f9a38 100644 --- a/machines/fujin/main/default.nix +++ b/machines/fujin/main/default.nix @@ -114,6 +114,7 @@ development.emacs.enable = true; virtualisation.docker.enable = true; + virtualisation.incus.enable = true; window-manager.hypr.enable = true; diff --git a/machines/fujin/main/home.nix b/machines/fujin/main/home.nix index 0b5d699..6e25d2f 100644 --- a/machines/fujin/main/home.nix +++ b/machines/fujin/main/home.nix @@ -25,6 +25,7 @@ nu = { enable = true; + carapace.enable = true; shellAliases = { ll = "eza -al"; cp = "rsync -ah --progress"; @@ -146,6 +147,7 @@ #qmk google-chrome unzip + proton-vpn #libreoffice grim @@ -159,9 +161,6 @@ #mpd #mpv #mpc-cli - - # gaming - prismlauncher ] ++ [ inputs.thefuck.packages.${pkgs.system}.default ]; stylix = { diff --git a/modules/gaming/default.nix b/modules/gaming/default.nix index 6c8b569..f513f8d 100644 --- a/modules/gaming/default.nix +++ b/modules/gaming/default.nix @@ -1,10 +1,17 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + username, + ... +}: with lib; let cfg = config.dov.gaming; -in { +in +{ options.dov.gaming = { enable = mkEnableOption "gaming config"; }; @@ -15,5 +22,30 @@ in { protontricks.enable = true; extraCompatPackages = with pkgs; [ proton-ge-bin ]; }; + + home-manager.users.${username}.config = { + programs.lutris = { + enable = true; + extraPackages = with pkgs; [ + umu-launcher + winetricks + ]; + protonPackages = [ pkgs.proton-ge-bin ]; + }; + + home.packages = with pkgs; [ + umu-launcher + ]; + + home.file.".local/share/Steam/compatibilitytools.d/GE-Proton" = { + source = "${pkgs.proton-ge-bin.steamcompattool}"; + }; + }; + + users.users."${username}" = { + packages = with pkgs; [ + prismlauncher + ]; + }; }; } diff --git a/modules/virtualisation/default.nix b/modules/virtualisation/default.nix index 1e011dd..6eb04bf 100644 --- a/modules/virtualisation/default.nix +++ b/modules/virtualisation/default.nix @@ -4,5 +4,6 @@ imports = [ ./podman ./docker + ./incus ]; } diff --git a/modules/virtualisation/incus/default.nix b/modules/virtualisation/incus/default.nix new file mode 100644 index 0000000..3541468 --- /dev/null +++ b/modules/virtualisation/incus/default.nix @@ -0,0 +1,72 @@ +{ + config, + lib, + pkgs, + username, + ... +}: + +with lib; + +let + cfg = config.dov.virtualisation.incus; +in +{ + options.dov.virtualisation.incus = { + enable = mkEnableOption "incus config"; + }; + + config = mkIf cfg.enable { + networking.nftables.enable = true; + networking.firewall.interfaces.incusbr0.allowedTCPPorts = [ + 53 + 67 + ]; + networking.firewall.interfaces.incusbr0.allowedUDPPorts = [ + 53 + 67 + ]; + + virtualisation.incus = { + enable = true; + + preseed = { + storage_pools = [ + { + name = "default"; + driver = "dir"; + } + ]; + networks = [ + { + name = "incusbr0"; + type = "bridge"; + config = { + "ipv4.address" = "auto"; + "ipv4.nat" = "true"; + }; + } + ]; + profiles = [ + { + name = "default"; + devices = { + eth0 = { + name = "eth0"; + network = "incusbr0"; + type = "nic"; + }; + root = { + path = "/"; + pool = "default"; + type = "disk"; + }; + }; + } + ]; + }; + }; + + users.users.${username}.extraGroups = [ "incus-admin" ]; + }; +} diff --git a/modules/window-manager/hypr/default.nix b/modules/window-manager/hypr/default.nix index e88001c..dcf3ed3 100644 --- a/modules/window-manager/hypr/default.nix +++ b/modules/window-manager/hypr/default.nix @@ -46,7 +46,7 @@ in { }; }; - home-manager.users.fujin.config = { + home-manager.users.${username}.config = { home.packages = with pkgs; [ awww pipewire