Add incus, add completions for nushell
This commit is contained in:
@@ -11,16 +11,46 @@ in {
|
|||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
|
carapace = {
|
||||||
|
enable = mkEnableOption "carapace external completions";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable (mkMerge [
|
||||||
programs.nushell = {
|
{
|
||||||
enable = true;
|
programs.nushell = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
};
|
};
|
||||||
} // (lib.optionalAttrs (cfg.shellAliases != null) {
|
} // (lib.optionalAttrs (cfg.shellAliases != null) {
|
||||||
shellAliases = cfg.shellAliases;
|
shellAliases = cfg.shellAliases;
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
|
(mkIf cfg.carapace.enable {
|
||||||
|
home.packages = [ pkgs.carapace ];
|
||||||
|
|
||||||
|
programs.nushell.extraConfig = ''
|
||||||
|
let carapace_completer = {|spans: list<string>|
|
||||||
|
# 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
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,6 +114,7 @@
|
|||||||
development.emacs.enable = true;
|
development.emacs.enable = true;
|
||||||
|
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
|
virtualisation.incus.enable = true;
|
||||||
|
|
||||||
window-manager.hypr.enable = true;
|
window-manager.hypr.enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
nu = {
|
nu = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
carapace.enable = true;
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
ll = "eza -al";
|
ll = "eza -al";
|
||||||
cp = "rsync -ah --progress";
|
cp = "rsync -ah --progress";
|
||||||
@@ -146,6 +147,7 @@
|
|||||||
#qmk
|
#qmk
|
||||||
google-chrome
|
google-chrome
|
||||||
unzip
|
unzip
|
||||||
|
proton-vpn
|
||||||
|
|
||||||
#libreoffice
|
#libreoffice
|
||||||
grim
|
grim
|
||||||
@@ -159,9 +161,6 @@
|
|||||||
#mpd
|
#mpd
|
||||||
#mpv
|
#mpv
|
||||||
#mpc-cli
|
#mpc-cli
|
||||||
|
|
||||||
# gaming
|
|
||||||
prismlauncher
|
|
||||||
] ++ [ inputs.thefuck.packages.${pkgs.system}.default ];
|
] ++ [ inputs.thefuck.packages.${pkgs.system}.default ];
|
||||||
|
|
||||||
stylix = {
|
stylix = {
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.dov.gaming;
|
cfg = config.dov.gaming;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.dov.gaming = {
|
options.dov.gaming = {
|
||||||
enable = mkEnableOption "gaming config";
|
enable = mkEnableOption "gaming config";
|
||||||
};
|
};
|
||||||
@@ -15,5 +22,30 @@ in {
|
|||||||
protontricks.enable = true;
|
protontricks.enable = true;
|
||||||
extraCompatPackages = with pkgs; [ proton-ge-bin ];
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,5 +4,6 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./podman
|
./podman
|
||||||
./docker
|
./docker
|
||||||
|
./incus
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -46,7 +46,7 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.fujin.config = {
|
home-manager.users.${username}.config = {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
awww
|
awww
|
||||||
pipewire
|
pipewire
|
||||||
|
|||||||
Reference in New Issue
Block a user