refactor(treewide): statix
This commit is contained in:
parent
366fa0ce80
commit
7f2cd7a343
71 changed files with 84 additions and 84 deletions
|
|
@ -6,7 +6,7 @@
|
|||
}: let
|
||||
inherit (lib) mkIf;
|
||||
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
config = mkIf (host.type != "phone") {
|
||||
services.greetd = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
imports = [
|
||||
./firewall.nix
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
config = mkIf (host.type != "phone") {
|
||||
networking.firewall = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
config = mkIf (host.type != "phone") {
|
||||
services.resolved = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkDefault;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
config = mkIf (host.type != "phone") {
|
||||
services.openssh = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
# nyx module
|
||||
config = mkIf (host.type != "phone") {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mapAttrs mapAttrsToList;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
imports = [
|
||||
./nh.nix
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
admin = host.admin;
|
||||
inherit (config.ooknet) host;
|
||||
inherit (host) admin;
|
||||
in {
|
||||
config = mkIf (host.type != "phone") {
|
||||
environment.variables.FLAKE = mkIf admin.homeManager "/home/${admin.name}/.config/ooknet/";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
config = mkIf (host.type != "phone") {
|
||||
nixpkgs = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
config = mkIf (host.type != "phone") {
|
||||
nix.settings = {
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
host = config.ooknet.host;
|
||||
admin = host.admin;
|
||||
tailscale = host.networking.tailscale;
|
||||
inherit (config.ooknet) host;
|
||||
inherit (host) admin;
|
||||
inherit (host.networking) tailscale;
|
||||
in {
|
||||
age.identityPaths = [
|
||||
"/home/${admin.name}/.ssh/id_ed25519"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
}: let
|
||||
inherit (lib) optionals mkForce concatLists;
|
||||
inherit (builtins) elem;
|
||||
features = config.ooknet.host.hardware.features;
|
||||
inherit (config.ooknet.host.hardware) features;
|
||||
in {
|
||||
security = {
|
||||
# Protects the kernel from being tampered with at runtime. prevents the ability to hibernate.
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ in {
|
|||
isNormalUser = true;
|
||||
shell = pkgs.${cfg.shell};
|
||||
initialPassword = "password";
|
||||
openssh.authorizedKeys.keys = [(keys.users."${cfg.name}")];
|
||||
openssh.authorizedKeys.keys = [keys.users."${cfg.name}"];
|
||||
extraGroups =
|
||||
[
|
||||
"wheel"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
config = mkIf (host.type != "phone") {
|
||||
hardware = {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
}: let
|
||||
inherit (lib) mkMerge mkIf versionAtLeast versionOlder;
|
||||
inherit (builtins) elem;
|
||||
cpu = config.ooknet.host.hardware.cpu;
|
||||
inherit (config.ooknet.host.hardware) cpu;
|
||||
cfg = cpu.amd;
|
||||
kernelVersion = config.boot.kernelPackages.kernel.version;
|
||||
kernelVersionAtLeast = versionAtLeast kernelVersion;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
cpu = config.ooknet.host.hardware.cpu;
|
||||
inherit (config.ooknet.host.hardware) cpu;
|
||||
in {
|
||||
# TODO: put kvm/gvt behind virtualization module flag
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
features = config.ooknet.host.hardware.features;
|
||||
inherit (config.ooknet.host.hardware) features;
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
in {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
features = config.ooknet.host.hardware.features;
|
||||
inherit (config.ooknet.host.hardware) features;
|
||||
cfg = config.ooknet.host.hardware.battery;
|
||||
inherit (lib) mkIf mkDefault;
|
||||
inherit (builtins) elem;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
self,
|
||||
...
|
||||
}: let
|
||||
features = config.ooknet.host.hardware.features;
|
||||
inherit (config.ooknet.host.hardware) features;
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
in {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
features = config.ooknet.host.hardware.features;
|
||||
inherit (config.ooknet.host.hardware) features;
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
in {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
isx86Linux = pkgs: with pkgs.stdenv; hostPlatform.isLinux && hostPlatform.isx86;
|
||||
features = config.ooknet.host.hardware.features;
|
||||
inherit (config.ooknet.host.hardware) features;
|
||||
in {
|
||||
config = mkIf (elem "video" features) {
|
||||
hardware = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
gpu = config.ooknet.host.hardware.gpu;
|
||||
inherit (config.ooknet.host.hardware) gpu;
|
||||
inherit (lib) mkIf mkDefault;
|
||||
inherit (builtins) elem;
|
||||
in {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
gpu = config.ooknet.host.hardware.gpu;
|
||||
inherit (config.ooknet.host.hardware) gpu;
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
# vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
gpu = config.ooknet.host.hardware.gpu;
|
||||
inherit (config.ooknet.host.hardware) gpu;
|
||||
inherit (lib) mkIf mkDefault;
|
||||
inherit (builtins) elem;
|
||||
# production = config.boot.kernelPackages.nvidiaPackages.production;
|
||||
beta = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
inherit (config.boot.kernelPackages.nvidiaPackages) beta;
|
||||
in {
|
||||
# TODO: make option to choose nvidia package
|
||||
config = mkIf (gpu.type == "nvidia") {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
admin = config.ooknet.host.admin;
|
||||
inherit (config.ooknet.host) admin;
|
||||
cfg = config.ooknet.programs._1password;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
inherit (lib.types) bool enum listOf int submodule nullOr str;
|
||||
inherit (lib.lists) optionals concatLists;
|
||||
|
||||
admin = config.ooknet.host.admin;
|
||||
hardware = config.ooknet.host.hardware;
|
||||
tailscale = config.ooknet.host.networking.tailscale;
|
||||
inherit (config.ooknet.host) admin;
|
||||
inherit (config.ooknet.host) hardware;
|
||||
inherit (config.ooknet.host.networking) tailscale;
|
||||
in {
|
||||
options.ooknet.host = {
|
||||
name = mkOption {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
profiles = config.ooknet.host.profiles;
|
||||
inherit (config.ooknet.host) profiles;
|
||||
in {
|
||||
config = mkIf (elem "gaming" profiles) {
|
||||
ooknet.gaming = {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) elem;
|
||||
profiles = config.ooknet.host.profiles;
|
||||
inherit (config.ooknet.host) profiles;
|
||||
in {
|
||||
config = mkIf (elem "media-server" profiles) {
|
||||
ooknet.services.nixarr.enable = true;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
config = mkIf (host.type == "desktop" && host.role == "workstation") {
|
||||
ooknet = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
host = config.ooknet.host;
|
||||
inherit (config.ooknet) host;
|
||||
in {
|
||||
config = mkIf (host.type == "laptop" && host.role == "workstation") {
|
||||
ooknet = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue