mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Switch to nixfmt
This commit is contained in:
parent
1d70117186
commit
b38d2df431
55 changed files with 1559 additions and 1540 deletions
|
|
@ -1,16 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.bluetooth.enable = lib.mkEnableOption "";
|
||||
options.myConfig.bluetooth.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.bluetooth.enable {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
services.blueman.enable = true;
|
||||
hardware.logitech.wireless.enable = true;
|
||||
config = lib.mkIf config.myConfig.bluetooth.enable {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
services.blueman.enable = true;
|
||||
hardware.logitech.wireless.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,37 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.boot-loader = {
|
||||
systemd-boot.enable = lib.mkEnableOption "";
|
||||
silent = lib.mkEnableOption "";
|
||||
};
|
||||
options.myConfig.boot-loader = {
|
||||
systemd-boot.enable = lib.mkEnableOption "";
|
||||
silent = lib.mkEnableOption "";
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.myConfig.boot-loader.systemd-boot.enable {
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
boot.loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
configurationLimit = 20;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 3;
|
||||
};
|
||||
systemd.watchdog.rebootTime = "10";
|
||||
})
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.myConfig.boot-loader.systemd-boot.enable {
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
boot.loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
configurationLimit = 20;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 3;
|
||||
};
|
||||
systemd.watchdog.rebootTime = "10";
|
||||
})
|
||||
|
||||
(lib.mkIf config.myConfig.boot-loader.silent {
|
||||
boot = {
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
consoleLogLevel = 3;
|
||||
initrd.verbose = false;
|
||||
initrd.systemd.enable = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
(lib.mkIf config.myConfig.boot-loader.silent {
|
||||
boot = {
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
consoleLogLevel = 3;
|
||||
initrd.verbose = false;
|
||||
initrd.systemd.enable = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,20 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myConfig.comma;
|
||||
in {
|
||||
imports = [inputs.nix-index-database.nixosModules.nix-index];
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.myConfig.comma;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.nix-index-database.nixosModules.nix-index ];
|
||||
|
||||
options.myConfig.comma.enable = lib.mkEnableOption "";
|
||||
options.myConfig.comma.enable = lib.mkEnableOption "";
|
||||
|
||||
config = {
|
||||
programs.command-not-found.enable = !cfg.enable;
|
||||
programs.nix-index.enable = cfg.enable;
|
||||
programs.nix-index-database.comma.enable = cfg.enable;
|
||||
};
|
||||
config = {
|
||||
programs.command-not-found.enable = !cfg.enable;
|
||||
programs.nix-index.enable = cfg.enable;
|
||||
programs.nix-index-database.comma.enable = cfg.enable;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,25 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.de.hyprland.enable = lib.mkEnableOption "";
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.de.hyprland.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
||||
programs.hyprland.enable = true;
|
||||
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
environment.sessionVariables = {
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||
};
|
||||
|
||||
services.gvfs.enable = true;
|
||||
environment.sessionVariables = {
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
};
|
||||
|
||||
services.gvfs.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
{
|
||||
imports = [
|
||||
./flatpak.nix
|
||||
./vm.nix
|
||||
./wlan.nix
|
||||
./vpn.nix
|
||||
./comma.nix
|
||||
./sops.nix
|
||||
./bluetooth.nix
|
||||
./de.nix
|
||||
./dm.nix
|
||||
./sound.nix
|
||||
./boot-loader.nix
|
||||
./printing.nix
|
||||
./syncthing.nix
|
||||
./nix-helper.nix
|
||||
];
|
||||
imports = [
|
||||
./flatpak.nix
|
||||
./vm.nix
|
||||
./wlan.nix
|
||||
./vpn.nix
|
||||
./comma.nix
|
||||
./sops.nix
|
||||
./bluetooth.nix
|
||||
./de.nix
|
||||
./dm.nix
|
||||
./sound.nix
|
||||
./boot-loader.nix
|
||||
./printing.nix
|
||||
./syncthing.nix
|
||||
./nix-helper.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,36 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myConfig.dm;
|
||||
in {
|
||||
options.myConfig.dm = {
|
||||
gdm.enable = lib.mkEnableOption "";
|
||||
tuigreet.enable = lib.mkEnableOption "";
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.myConfig.dm;
|
||||
in
|
||||
{
|
||||
options.myConfig.dm = {
|
||||
gdm.enable = lib.mkEnableOption "";
|
||||
tuigreet.enable = lib.mkEnableOption "";
|
||||
};
|
||||
|
||||
config = {
|
||||
services.xserver = lib.mkIf cfg.gdm.enable {
|
||||
enable = true;
|
||||
displayManager.gdm.enable = true;
|
||||
};
|
||||
|
||||
config = {
|
||||
services.xserver = lib.mkIf cfg.gdm.enable {
|
||||
enable = true;
|
||||
displayManager.gdm.enable = true;
|
||||
};
|
||||
|
||||
services.greetd = lib.mkIf cfg.tuigreet.enable {
|
||||
enable = true;
|
||||
settings = {
|
||||
default_session = let
|
||||
base = config.services.xserver.displayManager.sessionData.desktops;
|
||||
in {
|
||||
command = "${lib.getExe pkgs.greetd.tuigreet} --time --asterisks --remember --remember-user-session --sessions ${base}/share/wayland-sessions:${base}/share/xsessions";
|
||||
user = "greeter";
|
||||
};
|
||||
};
|
||||
};
|
||||
services.greetd = lib.mkIf cfg.tuigreet.enable {
|
||||
enable = true;
|
||||
settings = {
|
||||
default_session =
|
||||
let
|
||||
base = config.services.xserver.displayManager.sessionData.desktops;
|
||||
in
|
||||
{
|
||||
command = "${lib.getExe pkgs.greetd.tuigreet} --time --asterisks --remember --remember-user-session --sessions ${base}/share/wayland-sessions:${base}/share/xsessions";
|
||||
user = "greeter";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,20 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.flatpak.enable = lib.mkEnableOption "";
|
||||
options.myConfig.flatpak.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.flatpak.enable {
|
||||
services.flatpak.enable = true;
|
||||
config = lib.mkIf config.myConfig.flatpak.enable {
|
||||
services.flatpak.enable = true;
|
||||
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
systemDirs.data = [
|
||||
"/var/lib/flatpak/exports/share"
|
||||
"/home/seb/.local/share/flatpak/exports/share"
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
systemDirs.data = [
|
||||
"/var/lib/flatpak/exports/share"
|
||||
"/home/seb/.local/share/flatpak/exports/share"
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,36 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.myConfig.nix-helper;
|
||||
in
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myConfig.nix-helper;
|
||||
in {
|
||||
options.myConfig.nix-helper = {
|
||||
enable = lib.mkEnableOption "";
|
||||
auto-gc.enable = lib.mkEnableOption "";
|
||||
options.myConfig.nix-helper = {
|
||||
enable = lib.mkEnableOption "";
|
||||
auto-gc.enable = lib.mkEnableOption "";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.nh.enable = true;
|
||||
|
||||
environment.shellAliases =
|
||||
let
|
||||
rebuild = "sudo -v && nh os";
|
||||
in
|
||||
{
|
||||
nrs = "${rebuild} switch";
|
||||
nrt = "${rebuild} test";
|
||||
nrb = "${rebuild} boot";
|
||||
nrrb = "nrb && reboot";
|
||||
};
|
||||
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
silent = true;
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.nh.enable = true;
|
||||
|
||||
environment.shellAliases = let
|
||||
rebuild = "sudo -v && nh os";
|
||||
in {
|
||||
nrs = "${rebuild} switch";
|
||||
nrt = "${rebuild} test";
|
||||
nrb = "${rebuild} boot";
|
||||
nrrb = "nrb && reboot";
|
||||
};
|
||||
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
silent = true;
|
||||
};
|
||||
|
||||
programs.nh.clean = lib.mkIf cfg.auto-gc.enable {
|
||||
enable = true;
|
||||
dates = "daily";
|
||||
extraArgs = "--keep 10 --keep-since 3d";
|
||||
};
|
||||
programs.nh.clean = lib.mkIf cfg.auto-gc.enable {
|
||||
enable = true;
|
||||
dates = "daily";
|
||||
extraArgs = "--keep 10 --keep-since 3d";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.printing.enable = lib.mkEnableOption "";
|
||||
options.myConfig.printing.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.printing.enable {
|
||||
services.printing.enable = true;
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
config = lib.mkIf config.myConfig.printing.enable {
|
||||
services.printing.enable = true;
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [inputs.sops-nix.nixosModules.sops];
|
||||
self,
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.sops-nix.nixosModules.sops ];
|
||||
|
||||
options.myConfig.sops.enable = lib.mkEnableOption "";
|
||||
options.myConfig.sops.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.sops.enable {
|
||||
sops = {
|
||||
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
||||
defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
|
||||
};
|
||||
config = lib.mkIf config.myConfig.sops.enable {
|
||||
sops = {
|
||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,16 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.sound.enable = lib.mkEnableOption "";
|
||||
options.myConfig.sound.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.sound.enable {
|
||||
security.rtkit.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
wireplumber.enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
config = lib.mkIf config.myConfig.sound.enable {
|
||||
security.rtkit.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
wireplumber.enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,77 +1,76 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.syncthing.enable = lib.mkEnableOption "";
|
||||
options.myConfig.syncthing.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.syncthing.enable {
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
config = lib.mkIf config.myConfig.syncthing.enable {
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
|
||||
user = "seb";
|
||||
group = "users";
|
||||
dataDir = "/home/seb";
|
||||
user = "seb";
|
||||
group = "users";
|
||||
dataDir = "/home/seb";
|
||||
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
|
||||
settings = {
|
||||
devices = {
|
||||
north.id = "ROS2S76-ULQWVFC-7KNQQ6Q-MNIWNKT-2QOPPHY-FFQZNVM-GUJRTHE-NZBM3QY";
|
||||
inspiron.id = "GUXHL6J-J2HWYNN-7JZJ5CN-6LPYGJD-H7GYRLQ-ORZ4PJJ-5K4WT7I-MELMIQO";
|
||||
};
|
||||
|
||||
folders = let
|
||||
allDevices = [
|
||||
"north"
|
||||
"inspiron"
|
||||
];
|
||||
staggeredVersioning = {
|
||||
type = "staggered";
|
||||
params = {
|
||||
cleanInterval = "3600"; # 1 hour in seconds
|
||||
maxAge = "15552000"; # 180 days in seconds
|
||||
};
|
||||
};
|
||||
in {
|
||||
Documents = {
|
||||
path = "/home/seb/Documents";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Downloads = {
|
||||
path = "/home/seb/Downloads";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Pictures = {
|
||||
path = "/home/seb/Pictures";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Music = {
|
||||
path = "/home/seb/Music";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Videos = {
|
||||
path = "/home/seb/Videos";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Projects = {
|
||||
path = "/home/seb/Projects";
|
||||
devices = allDevices;
|
||||
ignorePerms = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
settings = {
|
||||
devices = {
|
||||
north.id = "ROS2S76-ULQWVFC-7KNQQ6Q-MNIWNKT-2QOPPHY-FFQZNVM-GUJRTHE-NZBM3QY";
|
||||
inspiron.id = "GUXHL6J-J2HWYNN-7JZJ5CN-6LPYGJD-H7GYRLQ-ORZ4PJJ-5K4WT7I-MELMIQO";
|
||||
};
|
||||
|
||||
folders =
|
||||
let
|
||||
allDevices = [
|
||||
"north"
|
||||
"inspiron"
|
||||
];
|
||||
staggeredVersioning = {
|
||||
type = "staggered";
|
||||
params = {
|
||||
cleanInterval = "3600"; # 1 hour in seconds
|
||||
maxAge = "15552000"; # 180 days in seconds
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
Documents = {
|
||||
path = "/home/seb/Documents";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Downloads = {
|
||||
path = "/home/seb/Downloads";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Pictures = {
|
||||
path = "/home/seb/Pictures";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Music = {
|
||||
path = "/home/seb/Music";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Videos = {
|
||||
path = "/home/seb/Videos";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Projects = {
|
||||
path = "/home/seb/Projects";
|
||||
devices = allDevices;
|
||||
ignorePerms = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,29 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.vm.qemu.enable = lib.mkEnableOption "";
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.vm.qemu.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.vm.qemu.enable {
|
||||
virtualisation.libvirtd.enable = true;
|
||||
config = lib.mkIf config.myConfig.vm.qemu.enable {
|
||||
virtualisation.libvirtd.enable = true;
|
||||
|
||||
programs.virt-manager.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.quickemu
|
||||
pkgs.quickgui
|
||||
];
|
||||
environment.systemPackages = [
|
||||
pkgs.quickemu
|
||||
pkgs.quickgui
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
dconf.settings."org/virt-manager/virt-manager/connections" = {
|
||||
autoconnect = ["qemu:///system"];
|
||||
uris = ["qemu:///system"];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
dconf.settings."org/virt-manager/virt-manager/connections" = {
|
||||
autoconnect = [ "qemu:///system" ];
|
||||
uris = [ "qemu:///system" ];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,34 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.vpn.lgs.enable = lib.mkEnableOption "";
|
||||
options.myConfig.vpn.lgs.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.vpn.lgs.enable {
|
||||
sops.secrets = {
|
||||
"vpn/lgs/crt" = {};
|
||||
"vpn/lgs/key" = {};
|
||||
};
|
||||
|
||||
services.openvpn.servers.lgs = {
|
||||
autoStart = false;
|
||||
|
||||
config = ''
|
||||
dev tap
|
||||
persist-tun
|
||||
persist-key
|
||||
data-ciphers AES-128-GCM:AES-256-CBC
|
||||
data-ciphers-fallback AES-256-CBC
|
||||
auth SHA1
|
||||
tls-client
|
||||
client
|
||||
resolv-retry infinite
|
||||
remote 194.9.190.11 1194 udp4
|
||||
nobind
|
||||
auth-user-pass
|
||||
ca ${config.sops.secrets."vpn/lgs/crt".path}
|
||||
tls-auth ${config.sops.secrets."vpn/lgs/key".path} 1
|
||||
remote-cert-tls server
|
||||
explicit-exit-notify
|
||||
'';
|
||||
};
|
||||
config = lib.mkIf config.myConfig.vpn.lgs.enable {
|
||||
sops.secrets = {
|
||||
"vpn/lgs/crt" = { };
|
||||
"vpn/lgs/key" = { };
|
||||
};
|
||||
|
||||
services.openvpn.servers.lgs = {
|
||||
autoStart = false;
|
||||
|
||||
config = ''
|
||||
dev tap
|
||||
persist-tun
|
||||
persist-key
|
||||
data-ciphers AES-128-GCM:AES-256-CBC
|
||||
data-ciphers-fallback AES-256-CBC
|
||||
auth SHA1
|
||||
tls-client
|
||||
client
|
||||
resolv-retry infinite
|
||||
remote 194.9.190.11 1194 udp4
|
||||
nobind
|
||||
auth-user-pass
|
||||
ca ${config.sops.secrets."vpn/lgs/crt".path}
|
||||
tls-auth ${config.sops.secrets."vpn/lgs/key".path} 1
|
||||
remote-cert-tls server
|
||||
explicit-exit-notify
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,35 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.wlan.enable = lib.mkEnableOption "";
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.wlan.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.wlan.enable {
|
||||
sops.secrets = {
|
||||
"iwd/WLAN-233151" = {};
|
||||
"iwd/Fairphone4" = {};
|
||||
"iwd/LGS" = {};
|
||||
};
|
||||
|
||||
networking.wireless.iwd = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
General.EnableNetworkConfiguration = true;
|
||||
Settings.AutoConnect = true;
|
||||
Network.NameResolvingService = "resolvconf";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"C /var/lib/iwd/WLAN-233151.psk 0600 root root - ${config.sops.secrets."iwd/WLAN-233151".path}"
|
||||
"C /var/lib/iwd/Fairphone4.psk 0600 root root - ${config.sops.secrets."iwd/Fairphone4".path}"
|
||||
"C /var/lib/iwd/LGS.8021x 0600 root root - ${config.sops.secrets."iwd/LGS".path}"
|
||||
];
|
||||
|
||||
environment.systemPackages = [pkgs.iwgtk];
|
||||
config = lib.mkIf config.myConfig.wlan.enable {
|
||||
sops.secrets = {
|
||||
"iwd/WLAN-233151" = { };
|
||||
"iwd/Fairphone4" = { };
|
||||
"iwd/LGS" = { };
|
||||
};
|
||||
|
||||
networking.wireless.iwd = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
General.EnableNetworkConfiguration = true;
|
||||
Settings.AutoConnect = true;
|
||||
Network.NameResolvingService = "resolvconf";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"C /var/lib/iwd/WLAN-233151.psk 0600 root root - ${config.sops.secrets."iwd/WLAN-233151".path}"
|
||||
"C /var/lib/iwd/Fairphone4.psk 0600 root root - ${config.sops.secrets."iwd/Fairphone4".path}"
|
||||
"C /var/lib/iwd/LGS.8021x 0600 root root - ${config.sops.secrets."iwd/LGS".path}"
|
||||
];
|
||||
|
||||
environment.systemPackages = [ pkgs.iwgtk ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue