add options
This commit is contained in:
parent
c7d8dcbdf6
commit
f28d3ea99d
|
|
@ -1,4 +1,9 @@
|
||||||
{...}: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
lib.mkIf config.u.has.graphical {
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
alsa.enable = true;
|
alsa.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
environment.pathsToLink = ["/libexec"];
|
environment.pathsToLink = ["/libexec"];
|
||||||
environment.localBinInPath = true;
|
environment.localBinInPath = true;
|
||||||
services.globalprotect.enable = true;
|
|
||||||
|
|
||||||
boot.tmp.useTmpfs = true;
|
boot.tmp.useTmpfs = true;
|
||||||
|
|
||||||
|
|
@ -33,9 +32,10 @@
|
||||||
documentation.dev.enable = true;
|
documentation.dev.enable = true;
|
||||||
|
|
||||||
xdg.terminal-exec = {
|
xdg.terminal-exec = {
|
||||||
enable = true;
|
enable = config.u.has.graphical;
|
||||||
settings.default = ["Alacritty.desktop"];
|
settings.default = ["Alacritty.desktop"];
|
||||||
};
|
};
|
||||||
|
services.globalprotect.enable = config.u.has.graphical;
|
||||||
|
|
||||||
environment.etc."ssh/ssh_config".text = lib.mkAfter "Include /home/*/.local/ssh/config";
|
environment.etc."ssh/ssh_config".text = lib.mkAfter "Include /home/*/.local/ssh/config";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{...}: {
|
{lib, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./audio.nix
|
./audio.nix
|
||||||
./bash.nix
|
./bash.nix
|
||||||
|
|
@ -10,4 +10,28 @@
|
||||||
./security.nix
|
./security.nix
|
||||||
./virt.nix
|
./virt.nix
|
||||||
];
|
];
|
||||||
|
options.u = {
|
||||||
|
has = {
|
||||||
|
graphical = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "enable graphical settings";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
wine = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "enable wine settings";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
virt = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "enable virt settings";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
container = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "enable container settings";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
lib.mkIf config.u.has.graphical {
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autorun = false;
|
autorun = false;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,15 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
i18n.supportedLocales = [
|
i18n.supportedLocales = [
|
||||||
"en_US.UTF-8/UTF-8"
|
"en_US.UTF-8/UTF-8"
|
||||||
"ja_JP.UTF-8/UTF-8"
|
"ja_JP.UTF-8/UTF-8"
|
||||||
];
|
];
|
||||||
i18n.inputMethod = {
|
i18n.inputMethod = lib.mkIf config.u.has.graphical {
|
||||||
enable = true;
|
enable = true;
|
||||||
type = "fcitx5";
|
type = "fcitx5";
|
||||||
fcitx5.addons = with pkgs; [
|
fcitx5.addons = with pkgs; [
|
||||||
|
|
@ -12,7 +17,8 @@
|
||||||
fcitx5-gtk
|
fcitx5-gtk
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
fonts.packages = with pkgs; [
|
fonts.packages = with pkgs;
|
||||||
|
lib.optionals config.u.has.graphical [
|
||||||
noto-fonts
|
noto-fonts
|
||||||
noto-fonts-cjk-sans
|
noto-fonts-cjk-sans
|
||||||
source-han-sans
|
source-han-sans
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
lib.mkIf config.u.has.graphical {
|
||||||
programs.partition-manager = {
|
programs.partition-manager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.libsForQt5.partitionmanager;
|
package = pkgs.libsForQt5.partitionmanager;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
{...}: {
|
{config, ...}: {
|
||||||
virtualisation.containers.enable = true;
|
virtualisation.containers.enable = config.u.has.container;
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
podman = {
|
podman = {
|
||||||
enable = true;
|
enable = config.u.has.container;
|
||||||
dockerCompat = true;
|
dockerCompat = true;
|
||||||
defaultNetwork.settings.dns_enabled = true;
|
defaultNetwork.settings.dns_enabled = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = config.u.has.virt;
|
||||||
programs.virt-manager.enable = true;
|
programs.virt-manager.enable = config.u.has.graphical && config.u.has.virt;
|
||||||
programs.nix-ld.enable = true;
|
programs.nix-ld.enable = true;
|
||||||
hardware.graphics.enable32Bit = true;
|
hardware.graphics.enable32Bit = config.u.has.graphical && config.u.has.wine;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
pkgs-stable,
|
pkgs-stable,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
lib.mkIf config.u.has.graphical {
|
||||||
systemd.user.targets.autostart = {
|
systemd.user.targets.autostart = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Wants = [
|
Wants = [
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,10 @@
|
||||||
./autostart.nix
|
./autostart.nix
|
||||||
./bin
|
./bin
|
||||||
./config
|
./config
|
||||||
|
./fhs.nix
|
||||||
./options.nix
|
./options.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
|
./prog.nix
|
||||||
./share
|
./share
|
||||||
./theme.nix
|
./theme.nix
|
||||||
./xdg.nix
|
./xdg.nix
|
||||||
|
|
|
||||||
18
user/fhs.nix
Normal file
18
user/fhs.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{pkgs, ...}: let
|
||||||
|
base = pkgs.appimageTools.defaultFhsEnvArgs;
|
||||||
|
fhs = {
|
||||||
|
name = "fhs";
|
||||||
|
targetPkgs = pkgs:
|
||||||
|
(base.targetPkgs pkgs)
|
||||||
|
++ [
|
||||||
|
pkgs.pkg-config
|
||||||
|
pkgs.ncurses
|
||||||
|
];
|
||||||
|
profile = "export FHS=1";
|
||||||
|
runScript = "bash";
|
||||||
|
extraOutputsToInstall = ["dev"];
|
||||||
|
};
|
||||||
|
fhsenv = pkgs.buildFHSUserEnv (base // fhs);
|
||||||
|
in {
|
||||||
|
home.packages = [fhsenv];
|
||||||
|
}
|
||||||
|
|
@ -43,6 +43,23 @@
|
||||||
});
|
});
|
||||||
description = "list of file manager bookmarks";
|
description = "list of file manager bookmarks";
|
||||||
};
|
};
|
||||||
|
has = {
|
||||||
|
graphical = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "enable graphical settings";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
wine = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "enable wine settings";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
prog = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "enable prog settings";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
lib = lib.mkOption {
|
lib = lib.mkOption {
|
||||||
type = lib.types.attrs;
|
type = lib.types.attrs;
|
||||||
description = "library";
|
description = "library";
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,35 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
pkgs-stable,
|
pkgs-stable,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs;
|
||||||
|
[
|
||||||
|
lsd
|
||||||
|
bat
|
||||||
|
zoxide
|
||||||
|
fd
|
||||||
|
ripgrep
|
||||||
|
fzf
|
||||||
|
trash-cli
|
||||||
|
tlrc
|
||||||
|
speedtest-cli
|
||||||
|
unixtools.xxd
|
||||||
|
starship
|
||||||
|
killall
|
||||||
|
file
|
||||||
|
nix-tree
|
||||||
|
alejandra
|
||||||
|
ffmpeg
|
||||||
|
ffsubsync
|
||||||
|
unzip
|
||||||
|
unar
|
||||||
|
tmuxPlugins.vim-tmux-navigator
|
||||||
|
tmuxPlugins.sessionist
|
||||||
|
]
|
||||||
|
++ lib.optionals config.u.has.graphical [
|
||||||
(config.u.lib.localHome pkgs.firefox-bin "firefox" "bin/firefox")
|
(config.u.lib.localHome pkgs.firefox-bin "firefox" "bin/firefox")
|
||||||
alacritty
|
alacritty
|
||||||
mpv
|
mpv
|
||||||
|
|
@ -28,74 +53,11 @@
|
||||||
qbittorrent
|
qbittorrent
|
||||||
xournalpp
|
xournalpp
|
||||||
adwaita-icon-theme
|
adwaita-icon-theme
|
||||||
|
|
||||||
lsd
|
|
||||||
bat
|
|
||||||
zoxide
|
|
||||||
fd
|
|
||||||
ripgrep
|
|
||||||
fzf
|
|
||||||
trash-cli
|
|
||||||
tlrc
|
|
||||||
speedtest-cli
|
|
||||||
bluetuith
|
bluetuith
|
||||||
unixtools.xxd
|
|
||||||
starship
|
|
||||||
killall
|
|
||||||
file
|
|
||||||
nix-tree
|
|
||||||
alejandra
|
|
||||||
ffmpeg
|
|
||||||
ffsubsync
|
|
||||||
unzip
|
|
||||||
unar
|
|
||||||
|
|
||||||
(python312.withPackages (python-pkgs: [
|
|
||||||
python-pkgs.pwntools
|
|
||||||
python-pkgs.requests
|
|
||||||
python-pkgs.pyjwt
|
|
||||||
python-pkgs.flask
|
|
||||||
]))
|
|
||||||
nodejs
|
|
||||||
deno
|
|
||||||
gnumake
|
|
||||||
coq
|
|
||||||
coqPackages.coqide
|
|
||||||
gcc
|
|
||||||
sqlitebrowser
|
|
||||||
globalprotect-openconnect
|
globalprotect-openconnect
|
||||||
|
]
|
||||||
tmuxPlugins.vim-tmux-navigator
|
++ lib.optionals config.u.has.wine [
|
||||||
tmuxPlugins.sessionist
|
|
||||||
|
|
||||||
wine
|
wine
|
||||||
winetricks
|
winetricks
|
||||||
|
|
||||||
cage
|
|
||||||
|
|
||||||
gdb
|
|
||||||
pwndbg
|
|
||||||
(pkgs-stable.cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb]))
|
|
||||||
ghidra-bin
|
|
||||||
pwninit
|
|
||||||
patchelf
|
|
||||||
(let
|
|
||||||
base = pkgs.appimageTools.defaultFhsEnvArgs;
|
|
||||||
in
|
|
||||||
pkgs.buildFHSUserEnv (base
|
|
||||||
// {
|
|
||||||
name = "fhs";
|
|
||||||
targetPkgs = pkgs:
|
|
||||||
(base.targetPkgs pkgs)
|
|
||||||
++ (
|
|
||||||
with pkgs; [
|
|
||||||
pkg-config
|
|
||||||
ncurses
|
|
||||||
]
|
|
||||||
);
|
|
||||||
profile = "export FHS=1";
|
|
||||||
runScript = "bash";
|
|
||||||
extraOutputsToInstall = ["dev"];
|
|
||||||
}))
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
32
user/prog.nix
Normal file
32
user/prog.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
lib.mkIf config.u.has.prog {
|
||||||
|
home.packages = with pkgs;
|
||||||
|
[
|
||||||
|
(python312.withPackages (python-pkgs: [
|
||||||
|
python-pkgs.pwntools
|
||||||
|
python-pkgs.requests
|
||||||
|
python-pkgs.pyjwt
|
||||||
|
python-pkgs.flask
|
||||||
|
]))
|
||||||
|
nodejs
|
||||||
|
deno
|
||||||
|
gnumake
|
||||||
|
coq
|
||||||
|
coqPackages.coqide
|
||||||
|
gcc
|
||||||
|
gdb
|
||||||
|
pwndbg
|
||||||
|
pwninit
|
||||||
|
patchelf
|
||||||
|
]
|
||||||
|
++ lib.optionals config.u.has.graphical [
|
||||||
|
(cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb]))
|
||||||
|
ghidra-bin
|
||||||
|
sqlitebrowser
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
{...}: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
lib.mkIf config.u.has.graphical {
|
||||||
xdg.desktopEntries."nsxiv-rifle" = {
|
xdg.desktopEntries."nsxiv-rifle" = {
|
||||||
exec = "nsxiv-rifle %F";
|
exec = "nsxiv-rifle %F";
|
||||||
icon = "nsxiv";
|
icon = "nsxiv";
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
lib.mkIf config.u.has.graphical {
|
||||||
qt = {
|
qt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
platformTheme.name = "qtct";
|
platformTheme.name = "qtct";
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
lib.mkIf config.u.has.graphical {
|
||||||
xdg.mimeApps.enable = true;
|
xdg.mimeApps.enable = true;
|
||||||
xdg.mimeApps.defaultApplications = let
|
xdg.mimeApps.defaultApplications = let
|
||||||
image = "nsxiv-rifle.desktop";
|
image = "nsxiv-rifle.desktop";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue