mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Rename module namespaces
This commit is contained in:
parent
0dcf8cc292
commit
ca1357b2d4
35 changed files with 4 additions and 4 deletions
13
modules/system/auto-gc.nix
Normal file
13
modules/system/auto-gc.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.myConfig.auto-gc.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.auto-gc.enable {
|
||||
programs.nh.enable = true;
|
||||
programs.nh.clean = {
|
||||
enable = true;
|
||||
dates = "daily";
|
||||
extraArgs = "--keep 10 --keep-since 3d";
|
||||
};
|
||||
};
|
||||
}
|
||||
13
modules/system/bluetooth.nix
Normal file
13
modules/system/bluetooth.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
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;
|
||||
};
|
||||
}
|
||||
38
modules/system/boot.nix
Normal file
38
modules/system/boot.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
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 = 0;
|
||||
};
|
||||
systemd.watchdog.rebootTime = "10";
|
||||
})
|
||||
|
||||
(lib.mkIf config.myConfig.boot.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;
|
||||
plymouth.enable = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
20
modules/system/comma.nix
Normal file
20
modules/system/comma.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.myConfig.comma;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.nix-index-database.nixosModules.nix-index ];
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
||||
22
modules/system/de.nix
Normal file
22
modules/system/de.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.de.hyprland.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
};
|
||||
|
||||
services.gvfs.enable = true;
|
||||
};
|
||||
}
|
||||
36
modules/system/dm.nix
Normal file
36
modules/system/dm.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
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;
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/system/flatpak.nix
Normal file
6
modules/system/flatpak.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.myConfig.flatpak.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.flatpak.enable { services.flatpak.enable = true; };
|
||||
}
|
||||
27
modules/system/geoclue.nix
Normal file
27
modules/system/geoclue.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.myConfig.geoclue.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.geoclue.enable {
|
||||
sops = {
|
||||
secrets.geolocation-api-key = { };
|
||||
|
||||
templates."geoclue-location-service.conf" = {
|
||||
owner = "geoclue";
|
||||
path = "/etc/geoclue/conf.d/location-service.conf";
|
||||
content = ''
|
||||
[wifi]
|
||||
url=https://www.googleapis.com/geolocation/v1/geolocate?key=${config.sops.placeholder.geolocation-api-key}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
services.geoclue2 = {
|
||||
enable = true;
|
||||
appConfig.gammastep = {
|
||||
isAllowed = true;
|
||||
isSystem = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
9
modules/system/nix-helper.nix
Normal file
9
modules/system/nix-helper.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.myConfig.nix-helper.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.nix-helper.enable {
|
||||
environment.sessionVariables.FLAKE = "/home/seb/Projects/nixos/my-config";
|
||||
programs.nh.enable = true;
|
||||
};
|
||||
}
|
||||
13
modules/system/printing.nix
Normal file
13
modules/system/printing.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
19
modules/system/sops.nix
Normal file
19
modules/system/sops.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.sops-nix.nixosModules.sops ];
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
}
|
||||
16
modules/system/sound.nix
Normal file
16
modules/system/sound.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
76
modules/system/syncthing.nix
Normal file
76
modules/system/syncthing.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.myConfig.syncthing.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.syncthing.enable {
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
|
||||
user = "seb";
|
||||
group = "users";
|
||||
dataDir = "/home/seb";
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/system/tailscale.nix
Normal file
26
modules/system/tailscale.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.myConfig.tailscale;
|
||||
in
|
||||
{
|
||||
options.myConfig.tailscale = {
|
||||
enable = lib.mkEnableOption "";
|
||||
ssh.enable = lib.mkEnableOption "";
|
||||
exitNode.enable = lib.mkEnableOption "";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops.secrets.tailscale-auth-key.restartUnits = [ "tailscaled-autoconnect.service" ];
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
authKeyFile = config.sops.secrets.tailscale-auth-key.path;
|
||||
openFirewall = true;
|
||||
useRoutingFeatures = if cfg.exitNode.enable then "server" else "client";
|
||||
extraUpFlags = [
|
||||
(lib.mkIf cfg.ssh.enable "--ssh")
|
||||
(lib.mkIf cfg.exitNode.enable "--advertise-exit-node")
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
9
modules/system/virtualisation.nix
Normal file
9
modules/system/virtualisation.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.myConfig.virtualisation.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.virtualisation.enable {
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
};
|
||||
}
|
||||
51
modules/system/wlan.nix
Normal file
51
modules/system/wlan.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.wlan.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.wlan.enable {
|
||||
sops = {
|
||||
secrets = {
|
||||
"wlan/WLAN-233151/key" = { };
|
||||
"wlan/Fairphone4/key" = { };
|
||||
"wlan/DSL_EXT/key" = { };
|
||||
};
|
||||
|
||||
templates =
|
||||
let
|
||||
makePskFile = name: ''
|
||||
[Security]
|
||||
Passphrase=${config.sops.placeholder."wlan/${name}/key"}
|
||||
'';
|
||||
in
|
||||
{
|
||||
"iwd/WLAN-233151.psk".content = makePskFile "WLAN-233151";
|
||||
"iwd/Fairphone4.psk".content = makePskFile "Fairphone4";
|
||||
"iwd/DSL_EXT.psk".content = makePskFile "DSL_EXT";
|
||||
};
|
||||
};
|
||||
|
||||
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.templates."iwd/WLAN-233151.psk".path
|
||||
}"
|
||||
"C /var/lib/iwd/Fairphone4.psk 0600 root root - ${config.sops.templates."iwd/Fairphone4.psk".path}"
|
||||
"C /var/lib/iwd/DSL_EXT.psk 0600 root root - ${config.sops.templates."iwd/DSL_EXT.psk".path}"
|
||||
];
|
||||
|
||||
environment.systemPackages = [ pkgs.iwgtk ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue