mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 01:09:24 +08:00
完成分割(home manager 除外)
This commit is contained in:
40
flake.nix
40
flake.nix
@@ -80,26 +80,34 @@
|
||||
nix-vscode-extensions = inputs.nix-vscode-extensions.extensions."${prev.system}";
|
||||
} )];
|
||||
})
|
||||
( import ./modules/basic/basic.nix { hostname = "chn-PC"; })
|
||||
|
||||
( import ./modules/basic.nix { hostName = "chn-PC"; })
|
||||
./modules/fonts.nix
|
||||
( import ./modules/i18n.nix { fcitx = true; } )
|
||||
./modules/kde.nix
|
||||
./modules/sops.nix
|
||||
( import ./modules/boot/basic.nix { efi = true; })
|
||||
./modules/boot/chn-PC.nix
|
||||
./modules/display/basic.nix
|
||||
./modules/display/chn-PC.nix
|
||||
./modules/filesystem/chn-PC.nix
|
||||
./modules/fonts/basic.nix
|
||||
./modules/fonts/basic.nix
|
||||
( import ./modules/i18n/basic.nix { fcitx = true; } )
|
||||
./modules/kvm/guest.nix
|
||||
./modules/hardware/bluetooth.nix
|
||||
./modules/hardware/joystick.nix
|
||||
( import ./modules/hardware/nvidia-prime.nix { intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; } )
|
||||
./modules/hardware/printer.nix
|
||||
./modules/hardware/sound.nix
|
||||
./modules/networking/basic.nix
|
||||
./modules/packages/basic.nix
|
||||
./modules/printer/basic.nix
|
||||
./modules/sops/basic.nix
|
||||
./modules/sound/basic.nix
|
||||
./modules/ssh/basic.nix
|
||||
./modules/user/basic.nix
|
||||
./modules/waydroid/basic.nix
|
||||
./modules/zsh/basic.nix
|
||||
./home/basic.nix
|
||||
./modules/networking/ssh.nix
|
||||
./modules/networking/wall_client.nix
|
||||
./modules/networking/xmunet.nix
|
||||
./modules/networking/chn-PC.nix
|
||||
./modules/packages/terminal.nix
|
||||
./modules/packages/gui.nix
|
||||
./modules/packages/gaming.nix
|
||||
./modules/packages/hpc.nix
|
||||
./modules/users/root.nix
|
||||
./modules/users/chn.nix
|
||||
./modules/virtualisation/kvm_guest.nix
|
||||
./modules/virtualisation/kvm_host.nix
|
||||
./modules/virtualisation/waydroid.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
12
modules/basic.nix
Normal file
12
modules/basic.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ hostName }: { pkgs, ... }@inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
networking.hostName = hostName;
|
||||
time.timeZone = "Asia/Shanghai";
|
||||
system.stateVersion = "22.11";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
};
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{ hostname }: { pkgs, ... }@inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
networking.hostName = hostname;
|
||||
time.timeZone = "Asia/Shanghai";
|
||||
system.stateVersion = "22.11";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
|
||||
programs.firejail.enable = true;
|
||||
hardware.xone.enable = true;
|
||||
hardware.xpadneo.enable = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
services.xserver.synaptics.enable = false;
|
||||
services.xserver.libinput.enable = true;
|
||||
virtualisation.libvirtd.enable = true;
|
||||
|
||||
nixpkgs.config.packageOverrides = pkgs: rec {
|
||||
wpa_supplicant = pkgs.wpa_supplicant.overrideAttrs (attrs: {
|
||||
patches = attrs.patches ++ [ ../../patches/xmunet.patch ];
|
||||
});
|
||||
};
|
||||
|
||||
environment.sessionVariables."GTK_USE_PORTAL" = "1";
|
||||
xdg.portal.extraPortals = with inputs.pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
|
||||
virtualisation.spiceUSBRedirection.enable = true;
|
||||
networking.resolvconf.enable = false;
|
||||
environment.etc."resolv.conf".text =
|
||||
''
|
||||
nameserver 127.0.0.1
|
||||
'';
|
||||
programs.xwayland.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -7,7 +7,7 @@ inputs:
|
||||
initrd.availableKernelModules
|
||||
= [ "ahci" "nvme" "sr_mod" "usb_storage" "virtio_blk" "virtio_pci" "xhci_pci" ];
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
extraModulePackages = with inputs.config.boot.kernelPackages; [ cpupower xone xpadneo ];
|
||||
extraModulePackages = with inputs.config.boot.kernelPackages; [ cpupower ];
|
||||
extraModprobeConfig = "options kvm_intel nested=1";
|
||||
};
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
config.services.xserver =
|
||||
{
|
||||
enable = true;
|
||||
displayManager.sddm.enable = true;
|
||||
desktopManager.plasma5.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
config =
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" "intel" "qxl" ];
|
||||
hardware.nvidia.prime =
|
||||
{
|
||||
offload.enable = true;
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
};
|
||||
}
|
||||
1
modules/hardware/bluetooth.nix
Normal file
1
modules/hardware/bluetooth.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ config.hardware.bluetooth.enable = true; }
|
||||
1
modules/hardware/joystick.nix
Normal file
1
modules/hardware/joystick.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ config.hardware = { xone.enable = true; xpadneo.enable = true; }; }
|
||||
24
modules/hardware/nvidia-prime.nix
Normal file
24
modules/hardware/nvidia-prime.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ intelBusId, nvidiaBusId }: { pkgs, ... }@inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" "intel" ];
|
||||
hardware.nvidia.prime =
|
||||
{
|
||||
offload.enable = true;
|
||||
intelBusId = intelBusId;
|
||||
nvidiaBusId = nvidiaBusId;
|
||||
};
|
||||
environment.systemPackages =
|
||||
[(
|
||||
inputs.pkgs.writeShellScriptBin "nvidia-offload"
|
||||
''
|
||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||
exec "$@"
|
||||
''
|
||||
)];
|
||||
};
|
||||
}
|
||||
1
modules/hardware/printer.nix
Normal file
1
modules/hardware/printer.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ config.services.printing.enable = true; }
|
||||
@@ -7,8 +7,7 @@
|
||||
services.pipewire =
|
||||
{
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
alsa = { enable = true; support32Bit = true; };
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
@@ -12,7 +12,7 @@
|
||||
inputMethod =
|
||||
{
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with inputs.pkgs; [fcitx5-rime fcitx5-chinese-addons fcitx5-mozc];
|
||||
fcitx5.addons = with inputs.pkgs; [ fcitx5-rime fcitx5-chinese-addons fcitx5-mozc ];
|
||||
};
|
||||
}
|
||||
else {}
|
||||
19
modules/kde.nix
Normal file
19
modules/kde.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ pkgs, ... }@inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
services.xserver =
|
||||
{
|
||||
enable = true;
|
||||
displayManager.sddm.enable = true;
|
||||
desktopManager.plasma5.enable = true;
|
||||
};
|
||||
environment =
|
||||
{
|
||||
sessionVariables."GTK_USE_PORTAL" = "1";
|
||||
systemPackages = [ inputs.pkgs.libsForQt5.qtstyleplugin-kvantum ];
|
||||
};
|
||||
xdg.portal.extraPortals = with inputs.pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
|
||||
programs.xwayland.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
config.services =
|
||||
{
|
||||
qemuGuest.enable = true;
|
||||
spice-vdagentd.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,48 +1 @@
|
||||
inputs:
|
||||
{
|
||||
config.networking.networkmanager.enable = true;
|
||||
config.services.dnsmasq =
|
||||
{
|
||||
enable = true;
|
||||
settings = {
|
||||
no-poll = true;
|
||||
server = [ "127.0.0.1#10853" ];
|
||||
listen-address = "127.0.0.1";
|
||||
bind-interfaces = true;
|
||||
address = [
|
||||
"/mirism.one/216.24.188.24"
|
||||
"/beta.mirism.one/216.24.188.24"
|
||||
"/ng01.mirism.one/216.24.188.24"
|
||||
"/debug.mirism.one/127.0.0.1"
|
||||
];
|
||||
ipset = [
|
||||
"/developer.download.nvidia.com/noproxy_net"
|
||||
"/yuanshen.com/noproxy_net"
|
||||
"/zoom.us/noproxy_net"
|
||||
];
|
||||
};
|
||||
};
|
||||
config.services.xray = { enable = true; settingsFile = inputs.config.sops.secrets."xray.json".path; };
|
||||
config.sops.secrets."xray.json" =
|
||||
{ mode = "0440"; owner = "v2ray"; group = "v2ray"; restartUnits = [ "xray.service" ]; };
|
||||
config.systemd.services.xray.serviceConfig =
|
||||
{
|
||||
DynamicUser = inputs.lib.mkForce false;
|
||||
User = "v2ray";
|
||||
Group = "v2ray";
|
||||
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
|
||||
AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
|
||||
};
|
||||
config.users.users.v2ray = { isSystemUser = true; group = "v2ray"; };
|
||||
config.users.groups.v2ray = {};
|
||||
config.services.v2ray-forwarder = { enable = true; proxyPort = 10880; xmuPort = 10881; };
|
||||
config.boot.kernel.sysctl =
|
||||
{
|
||||
"net.ipv4.conf.all.route_localnet" = true;
|
||||
"net.ipv4.conf.default.route_localnet" = true;
|
||||
"net.ipv4.conf.all.accept_local" = true;
|
||||
"net.ipv4.conf.default.accept_local" = true;
|
||||
"net.ipv4.ip_forward" = true;
|
||||
"net.ipv4.ip_nonlocal_bind" = true;
|
||||
};
|
||||
}
|
||||
{ config.networking.networkmanager.enable = true; }
|
||||
|
||||
9
modules/networking/chn-PC.nix
Normal file
9
modules/networking/chn-PC.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
config.services.dnsmasq.settings.address =
|
||||
[
|
||||
"/mirism.one/216.24.188.24"
|
||||
"/beta.mirism.one/216.24.188.24"
|
||||
"/ng01.mirism.one/216.24.188.24"
|
||||
"/debug.mirism.one/127.0.0.1"
|
||||
];
|
||||
}
|
||||
1
modules/networking/ssh.nix
Normal file
1
modules/networking/ssh.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ config.services.openssh.enable = true; }
|
||||
49
modules/networking/wall_client.nix
Normal file
49
modules/networking/wall_client.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
services =
|
||||
{
|
||||
dnsmasq =
|
||||
{
|
||||
enable = true;
|
||||
settings =
|
||||
{
|
||||
no-poll = true;
|
||||
server = [ "127.0.0.1#10853" ];
|
||||
listen-address = "127.0.0.1";
|
||||
bind-interfaces = true;
|
||||
ipset =
|
||||
[
|
||||
"/developer.download.nvidia.com/noproxy_net"
|
||||
"/yuanshen.com/noproxy_net"
|
||||
"/zoom.us/noproxy_net"
|
||||
];
|
||||
};
|
||||
};
|
||||
xray = { enable = true; settingsFile = inputs.config.sops.secrets."xray.json".path; };
|
||||
v2ray-forwarder = { enable = true; proxyPort = 10880; xmuPort = 10881; };
|
||||
};
|
||||
sops.secrets."xray.json" =
|
||||
{ mode = "0440"; owner = "v2ray"; group = "v2ray"; restartUnits = [ "xray.service" ]; };
|
||||
systemd.services.xray.serviceConfig =
|
||||
{
|
||||
DynamicUser = inputs.lib.mkForce false;
|
||||
User = "v2ray";
|
||||
Group = "v2ray";
|
||||
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
|
||||
AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
|
||||
};
|
||||
users = { users.v2ray = { isSystemUser = true; group = "v2ray"; }; groups.v2ray = {}; };
|
||||
boot.kernel.sysctl =
|
||||
{
|
||||
"net.ipv4.conf.all.route_localnet" = true;
|
||||
"net.ipv4.conf.default.route_localnet" = true;
|
||||
"net.ipv4.conf.all.accept_local" = true;
|
||||
"net.ipv4.conf.default.accept_local" = true;
|
||||
"net.ipv4.ip_forward" = true;
|
||||
"net.ipv4.ip_nonlocal_bind" = true;
|
||||
};
|
||||
environment.etc."resolv.conf".text = "nameserver 127.0.0.1";
|
||||
};
|
||||
}
|
||||
7
modules/networking/xmunet.nix
Normal file
7
modules/networking/xmunet.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
config.nixpkgs.config.packageOverrides = pkgs:
|
||||
{
|
||||
wpa_supplicant = pkgs.wpa_supplicant.overrideAttrs ( attrs:
|
||||
{ patches = attrs.patches ++ [ ./xmunet.patch ]; });
|
||||
};
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
{ pkgs, ... }@inputs:
|
||||
{
|
||||
config.environment.systemPackages = with inputs.pkgs;
|
||||
[
|
||||
beep neofetch screen dos2unix tldr gnugrep
|
||||
pciutils usbutils lshw powertop
|
||||
zsh ksh zsh-powerlevel10k zsh-autosuggestions zsh-syntax-highlighting
|
||||
vim nano
|
||||
(
|
||||
vscode-with-extensions.override
|
||||
{
|
||||
vscodeExtensions = (with vscode-extensions;
|
||||
[
|
||||
ms-vscode.cpptools
|
||||
llvm-vs-code-extensions.vscode-clangd
|
||||
ms-vscode.cmake-tools
|
||||
ms-ceintl.vscode-language-pack-zh-hans
|
||||
github.copilot
|
||||
github.github-vscode-theme
|
||||
ms-vscode.hexeditor
|
||||
oderwat.indent-rainbow
|
||||
james-yu.latex-workshop
|
||||
pkief.material-icon-theme
|
||||
ms-vscode-remote.remote-ssh
|
||||
])
|
||||
++ (with nix-vscode-extensions.vscode-marketplace;
|
||||
[
|
||||
twxs.cmake
|
||||
ms-vscode.cpptools-themes
|
||||
guyutongxue.cpp-reference
|
||||
]);
|
||||
}
|
||||
)
|
||||
(
|
||||
pkgs.writeShellScriptBin "nvidia-offload"
|
||||
''
|
||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||
exec "$@"
|
||||
''
|
||||
)
|
||||
wget aria2 curl yt-dlp qbittorrent
|
||||
tree git autojump exa
|
||||
nix-output-monitor comma
|
||||
docker docker-compose
|
||||
apacheHttpd certbot-full
|
||||
pigz rar unrar upx unzip zip
|
||||
util-linux snapper gparted snapper-gui
|
||||
firefox google-chrome
|
||||
qemu_full virt-manager
|
||||
zotero ocrmypdf pdfgrep texlive.combined.scheme-full libreoffice-qt
|
||||
ovito paraview gimp # vsim vesta
|
||||
(python3.withPackages (ps: with ps; [ phonopy ]))
|
||||
element-desktop tdesktop discord qq inputs.config.nur.repos.xddxdd.wechat-uos inputs.config.nur.repos.linyinfeng.wemeet
|
||||
remmina
|
||||
bitwarden openssl ssh-to-age gnupg age sops
|
||||
spotify yesplaymusic # netease-cloud-music-gtk inputs.config.nur.repos.eh5.netease-cloud-music
|
||||
crow-translate
|
||||
scrcpy
|
||||
ipset iptables iproute2 wireshark dig nettools
|
||||
touchix.v2ray-forwarder
|
||||
mathematica
|
||||
gcc cudaPackages.cudatoolkit clang-tools
|
||||
inputs.config.nur.repos.ataraxiasjel.proton-ge
|
||||
octave root
|
||||
libsForQt5.qtstyleplugin-kvantum
|
||||
]
|
||||
++ (with inputs.lib; filter isDerivation (attrValues pkgs.plasma5Packages.kdeGear));
|
||||
config.programs =
|
||||
{
|
||||
wireshark.enable = true;
|
||||
anime-game-launcher.enable = true;
|
||||
honkers-railway-launcher.enable = true;
|
||||
nix-index-database.comma.enable = true;
|
||||
nix-index.enable = true;
|
||||
command-not-found.enable = false;
|
||||
steam.enable = true;
|
||||
};
|
||||
config.nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1u" "electron-19.0.7" ];
|
||||
config.nix.settings.substituters = [ "https://xddxdd.cachix.org" ];
|
||||
config.nix.settings.trusted-public-keys = [ "xddxdd.cachix.org-1:ay1HJyNDYmlSwj5NXQG065C8LfoqqKaTNCyzeixGjf8=" ];
|
||||
}
|
||||
13
modules/packages/gaming.nix
Normal file
13
modules/packages/gaming.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ pkgs, ... }@inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
environment.systemPackages = [ inputs.config.nur.repos.ataraxiasjel.proton-ge ];
|
||||
programs =
|
||||
{
|
||||
anime-game-launcher.enable = true;
|
||||
honkers-railway-launcher.enable = true;
|
||||
steam.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
44
modules/packages/gui.nix
Normal file
44
modules/packages/gui.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ pkgs, ... }@inputs:
|
||||
{
|
||||
config.environment.systemPackages = with inputs.pkgs;
|
||||
[
|
||||
( vscode-with-extensions.override
|
||||
{
|
||||
vscodeExtensions = (with vscode-extensions;
|
||||
[
|
||||
ms-vscode.cpptools
|
||||
llvm-vs-code-extensions.vscode-clangd
|
||||
ms-vscode.cmake-tools
|
||||
ms-ceintl.vscode-language-pack-zh-hans
|
||||
github.copilot
|
||||
github.github-vscode-theme
|
||||
ms-vscode.hexeditor
|
||||
oderwat.indent-rainbow
|
||||
james-yu.latex-workshop
|
||||
pkief.material-icon-theme
|
||||
ms-vscode-remote.remote-ssh
|
||||
])
|
||||
++ (with nix-vscode-extensions.vscode-marketplace;
|
||||
[
|
||||
twxs.cmake
|
||||
ms-vscode.cpptools-themes
|
||||
guyutongxue.cpp-reference
|
||||
]);
|
||||
} )
|
||||
qbittorrent # tunder
|
||||
gparted snapper-gui
|
||||
firefox google-chrome
|
||||
zotero texlive.combined.scheme-full libreoffice-qt
|
||||
element-desktop tdesktop discord
|
||||
# jail
|
||||
qq inputs.config.nur.repos.xddxdd.wechat-uos inputs.config.nur.repos.linyinfeng.wemeet
|
||||
remmina
|
||||
bitwarden
|
||||
spotify yesplaymusic
|
||||
crow-translate
|
||||
scrcpy
|
||||
]
|
||||
++ (with inputs.lib; filter isDerivation (attrValues pkgs.plasma5Packages.kdeGear));
|
||||
config.programs.wireshark.enable = true;
|
||||
config.nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1u" "electron-19.0.7" ];
|
||||
}
|
||||
9
modules/packages/hpc.nix
Normal file
9
modules/packages/hpc.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ pkgs, ... }@inputs:
|
||||
{
|
||||
config.environment.systemPackages = with inputs.pkgs;
|
||||
[
|
||||
ovito paraview # vsim vesta
|
||||
(python3.withPackages (ps: with ps; [ phonopy ]))
|
||||
mathematica octave root
|
||||
];
|
||||
}
|
||||
41
modules/packages/terminal.nix
Normal file
41
modules/packages/terminal.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ pkgs, ... }@inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
environment.systemPackages = with inputs.pkgs;
|
||||
[
|
||||
beep neofetch screen dos2unix tldr gnugrep
|
||||
pciutils usbutils lshw powertop
|
||||
ksh
|
||||
vim nano
|
||||
wget aria2 curl yt-dlp
|
||||
tree git autojump exa
|
||||
nix-output-monitor comma
|
||||
apacheHttpd certbot-full
|
||||
pigz rar unrar upx unzip zip
|
||||
util-linux snapper
|
||||
ocrmypdf pdfgrep
|
||||
openssl ssh-to-age gnupg age sops
|
||||
ipset iptables iproute2 dig nettools
|
||||
gcc clang-tools
|
||||
];
|
||||
programs =
|
||||
{
|
||||
nix-index-database.comma.enable = true;
|
||||
nix-index.enable = true;
|
||||
command-not-found.enable = false;
|
||||
zsh =
|
||||
{
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestions.enable = true;
|
||||
enableCompletion = true;
|
||||
ohMyZsh =
|
||||
{
|
||||
enable = true;
|
||||
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
config.services.printing.enable = true;
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
inputs:
|
||||
{
|
||||
config.sops =
|
||||
{
|
||||
defaultSopsFile = ../../secrets/chn-PC.yaml;
|
||||
defaultSopsFile = ../secrets/${inputs.config.networking.hostName}.yaml;
|
||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
};
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
config.services.openssh.enable = true;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{ pkgs, ... }@inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
users =
|
||||
{
|
||||
users.chn =
|
||||
{
|
||||
isNormalUser = true;
|
||||
extraGroups = inputs.lib.intersectLists
|
||||
[ "networkmanager" "wheel" "wireshark" "libvirtd" ]
|
||||
(builtins.attrNames inputs.config.users.groups);
|
||||
passwordFile = inputs.config.sops.secrets."password/chn".path;
|
||||
shell = inputs.pkgs.zsh;
|
||||
};
|
||||
mutableUsers = false;
|
||||
};
|
||||
sops.secrets."password/chn".neededForUsers = true;
|
||||
};
|
||||
}
|
||||
16
modules/users/chn.nix
Normal file
16
modules/users/chn.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ pkgs, ... }@inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
users.users.chn =
|
||||
{
|
||||
isNormalUser = true;
|
||||
extraGroups = inputs.lib.intersectLists
|
||||
[ "networkmanager" "wheel" "wireshark" "libvirtd" ]
|
||||
(builtins.attrNames inputs.config.users.groups);
|
||||
passwordFile = inputs.config.sops.secrets."password/chn".path;
|
||||
shell = inputs.pkgs.zsh;
|
||||
};
|
||||
sops.secrets."password/chn".neededForUsers = true;
|
||||
};
|
||||
}
|
||||
16
modules/users/root.nix
Normal file
16
modules/users/root.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ pkgs, ... }@inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
users =
|
||||
{
|
||||
users.root =
|
||||
{
|
||||
passwordFile = inputs.config.sops.secrets."password/root".path;
|
||||
shell = inputs.pkgs.zsh;
|
||||
};
|
||||
mutableUsers = false;
|
||||
};
|
||||
sops.secrets."password/root".neededForUsers = true;
|
||||
};
|
||||
}
|
||||
1
modules/virtualisation/kvm_guest.nix
Normal file
1
modules/virtualisation/kvm_guest.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ config.services = { qemuGuest.enable = true; spice-vdagentd.enable = true; xserver.videoDrivers = [ "qxl" ]; }; }
|
||||
2
modules/virtualisation/kvm_host.nix
Normal file
2
modules/virtualisation/kvm_host.nix
Normal file
@@ -0,0 +1,2 @@
|
||||
# TODO: disable auto usb redirection
|
||||
{ config.virtualisation = { libvirtd.enable = true; spiceUSBRedirection.enable = true; }; }
|
||||
1
modules/virtualisation/waydroid.nix
Normal file
1
modules/virtualisation/waydroid.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ config.virtualisation = { waydroid.enable = true; lxd.enable = true; }; }
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
config.virtualisation =
|
||||
{
|
||||
waydroid.enable = true;
|
||||
lxd.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
config.programs.zsh =
|
||||
{
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestions.enable = true;
|
||||
enableCompletion = true;
|
||||
ohMyZsh =
|
||||
{
|
||||
enable = true;
|
||||
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
password:
|
||||
root: ENC[AES256_GCM,data:WlD/i0GDlzeVsc4uJXVK+cRLvjATZGSbVCRedenTBayPeMebC6jrGPhsK4SSZIv3uw9RKztGGkziBTe61CCKwg/Rm0oFuF661A==,iv:YBPmukuz2tiVmIEBMClYjgzPf33NjmdqihcydD1gdhg=,tag:uURlnbNmEgo1qfoU0gPwEg==,type:str]
|
||||
chn: ENC[AES256_GCM,data:NMTdEfxBMqJP5bnLqinzQ1NP/4eCM3zzH5aR2HOoeu/p8BNp3JDspyuE+DkjVlb/uuVugnFPTOSASRZeEliG0B6NvpZ8gP1O/g==,iv:SNVxJ/xfdfAiVljlRMd5maIhxH0RBs90bqrypBubM6w=,tag:A7Wemy4eLcIUfV/sZ6//VA==,type:str]
|
||||
xray.json: ENC[AES256_GCM,data:eog9U3zt+Lx4QOlr0F4PGP73uUXrZcxa8NDVq13hmVpfu2T/CoF+Lwf8saJN9IdAOcECfgkrI2DiUZdAUO5LGQDDEyJywiJ/CnL6u+kwmkO9doidvG9ctB1VR2CG4M5wqXnybJp8b6osG6iL83q4prjo3YjFfGQFA/X05ssuzLneugK1pQrr9yaF7PvXvFBRwOKDbsmqDqSurTkU3QZMx3is2f0OeLYZEYk9XVNE7xeL1/33gObsP4KF5O2h466+7ezI7kP2vC2rl1VPQFtYAssoxK6qxWKErPhMCu+cDDYDMxqkeYmkgGBJEefpuk6IMNXctuwWwjojX5SEMN73kOHzJxykE/NhCbRDeNQjWz9qTpDaMZ36IFTc+U7nThYD85h9ppaedsXsQtLxhG29KM45h0CByBwJPY8Q1TNkV+jYsJWk6+DqSnWwMPsAKXnj/bhtpbslWlqk7uHn/6jzexu95y89ObjNtiR6YViufCAHlAGovijXv9lEjsZk+1xMNnD418a58jrUXoBGQjr+FT+i01zDnJga61KqAkhjgblG6j5pNVzsopITs1f90cxJjoNFvqh01EgPma3OlD6x5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 sops:
|
||||
OUlxNjdQaXdXMkZ6bnV1ek4yZ2dpbkEKpKGOAxo5Eef2jtGrg4iSzmGCeg+vTgvu
|
||||
+K8b+O19MIkGMDBm6UbYUPtc/7eqoEZRiTUzNMTmfkLVS4ul5zou9A==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2023-05-27T12:56:16Z"
|
||||
mac: ENC[AES256_GCM,data:MLRCHM7bPTOXzejkGAh2YcHxvxtAWfRop0sj7zHV5fIxBN7GP4H9JgKIFZAXRQJgP7UCRY7dGAVb9QM7kRUvOFxm4hSeFRRwfvt4er4a5x+SQocU+z6+50Q5qtOnkP7++SnJMfT0zfnmWe6MSCsebIOGAOVqMd06aVbSgO1mnD4=,iv:WZuETYLp4MISSsAGqjweK3+iWKHrf9CYJ5mkahM9LJw=,tag:6o9FB5zqD1ASMkQOVMkmkQ==,type:str]
|
||||
lastmodified: "2023-06-09T12:41:46Z"
|
||||
mac: ENC[AES256_GCM,data:EjQwSxxxCaFAngTnwDWM+VpR/nhNYrw1nQb6oEWckzic5ItTQ2+jFLwCjU6kGHCKH+jojxl6XhC6duLmYSn4fqPwxm/8ZjS9gMRuhG/P59exHlT8bUOq4Y3wqufm0DmNE5NEzgKD9f6A2oC7Ze20QHt+1z15dzBEaE9mt/kjytI=,iv:XbWY0/jFNy/VYYI/C2eYtTeWQmSDLw9dCYNqTN/GroI=,tag:NmQQzT/uezkb0cN/7upe6w==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.7.3
|
||||
|
||||
Reference in New Issue
Block a user