Add incus, add completions for nushell
This commit is contained in:
@@ -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<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;
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.incus.enable = true;
|
||||
|
||||
window-manager.hypr.enable = true;
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
imports = [
|
||||
./podman
|
||||
./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; [
|
||||
awww
|
||||
pipewire
|
||||
|
||||
Reference in New Issue
Block a user