feat: introduce treefmt and fmt all

This commit is contained in:
steveej 2024-11-15 10:17:56 +01:00
parent 80250b0179
commit 5d5282a914
213 changed files with 4967 additions and 4423 deletions

View file

@ -1,8 +1,5 @@
{ lib, pkgs, ... }:
{
lib,
pkgs,
...
}: {
boot.loader.grub.efiInstallAsRemovable = lib.mkForce true;
boot.loader.efi.canTouchEfiVariables = lib.mkForce false;
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest;

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
../../snippets/home-manager-with-zsh.nix
../../snippets/nix-settings-holo-chain.nix
@ -19,58 +20,61 @@
./boot.nix
# samba seerver
({lib, ...}: {
# networking.firewall.enable = lib.mkForce false;
services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
networking.firewall.allowedTCPPorts = [
5357 # wsdd
];
networking.firewall.allowedUDPPorts = [
3702 # wsdd
];
services.samba = {
enable = true;
(
{ lib, ... }:
{
# networking.firewall.enable = lib.mkForce false;
services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
networking.firewall.allowedTCPPorts = [
5357 # wsdd
];
networking.firewall.allowedUDPPorts = [
3702 # wsdd
];
services.samba = {
enable = true;
securityType = "user";
securityType = "user";
extraConfig = ''
workgroup = ARBEITSGRUPPE
server string = steveej-t14
netbios name = steveej-t14
security = user
extraConfig = ''
workgroup = ARBEITSGRUPPE
server string = steveej-t14
netbios name = steveej-t14
security = user
# use sendfile = yes
# use sendfile = yes
# for executables on windows
acl allow execute always = True
# for executables on windows
acl allow execute always = True
# legacy windows quirks
max protocol = NT1
min protocol = NT1
ntlm auth = yes
# legacy windows quirks
max protocol = NT1
min protocol = NT1
ntlm auth = yes
# client max protocol = SMB1
# client min protocol = NT1
# client max protocol = SMB1
# client min protocol = NT1
# note: localhost is the ipv6 localhost ::1
hosts allow = 192.168. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
'';
shares = {
voodoo = {
path = "/home/steveej/Desktop/voodoo";
browseable = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
# "force user" = "steveej";
# "force group" = "users";
# note: localhost is the ipv6 localhost ::1
hosts allow = 192.168. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
'';
shares = {
voodoo = {
path = "/home/steveej/Desktop/voodoo";
browseable = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
# "force user" = "steveej";
# "force group" = "users";
};
};
};
};
})
}
)
];
}

View file

@ -4,26 +4,24 @@
repoFlakeWithSystem,
nodeFlake,
...
}: let
}:
let
system = "x86_64-linux";
in {
in
{
meta.nodeSpecialArgs.${nodeName} = {
inherit repoFlake nodeName nodeFlake;
packages' = repoFlake.packages.${system};
repoFlakeInputs' = repoFlakeWithSystem system ({inputs', ...}: inputs');
repoFlakeInputs' = repoFlakeWithSystem system ({ inputs', ... }: inputs');
};
meta.nodeNixpkgs.${nodeName} = import nodeFlake.inputs.nixpkgs.outPath {
inherit system;
};
meta.nodeNixpkgs.${nodeName} = import nodeFlake.inputs.nixpkgs.outPath { inherit system; };
${nodeName} = {
deployment.targetHost = nodeName;
deployment.replaceUnknownProfiles = false;
deployment.allowLocalDeployment = true;
imports = [
(repoFlake + "/nix/os/devices/${nodeName}/configuration.nix")
];
imports = [ (repoFlake + "/nix/os/devices/${nodeName}/configuration.nix") ];
};
}

View file

@ -12,5 +12,5 @@
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = _: {};
outputs = _: { };
}

View file

@ -1,5 +1,7 @@
{lib, ...}: let
in {
{ lib, ... }:
let
in
{
# TASK: new device
hardware.opinionatedDisk = {
enable = true;
@ -66,16 +68,56 @@ in {
enable = false;
levels = [
# ["level auto" 0 60]
[0 0 60]
[1 60 65]
[1 65 75]
[2 75 78]
[3 78 80]
[4 80 82]
[5 82 84]
[6 84 86]
[7 86 88]
["level full-speed" 88 999]
[
0
0
60
]
[
1
60
65
]
[
1
65
75
]
[
2
75
78
]
[
3
78
80
]
[
4
80
82
]
[
5
82
84
]
[
6
84
86
]
[
7
86
88
]
[
"level full-speed"
88
999
]
];
extraArgs = [

View file

@ -4,11 +4,10 @@
repoFlake,
nodeFlake,
...
}: {
}:
{
system.stateVersion = "23.05";
home-manager.users.root = _: {
home.stateVersion = "22.05";
};
home-manager.users.root = _: { home.stateVersion = "22.05"; };
home-manager.users.steveej = _: {
home.stateVersion = "22.05";
imports = [
@ -21,10 +20,9 @@
})
];
home.sessionVariables = {};
home.sessionVariables = { };
home.packages = with pkgs; [
];
home.packages = with pkgs; [ ];
};
# TODO: fix the following errors with regreet
@ -38,26 +36,28 @@
#
# (regreet:505614): Gtk-WARNING **: 10:31:42.532: Theme parser warning: <data>:6:17-18: Empty declaration
# Failed to create /var/empty/.cache for shader cache (Operation not permitted)---disabling.
services.greetd = let
# exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit"
swayConfig = pkgs.writeText "greetd-sway-config" ''
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
exec "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK; ${pkgs.greetd.regreet}/bin/regreet; swaymsg exit"
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
'';
in {
enable = false;
settings = {
vt = 1;
default_session = {
command = "${pkgs.sway}/bin/sway --config ${swayConfig}";
services.greetd =
let
# exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit"
swayConfig = pkgs.writeText "greetd-sway-config" ''
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
exec "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK; ${pkgs.greetd.regreet}/bin/regreet; swaymsg exit"
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
'';
in
{
enable = false;
settings = {
vt = 1;
default_session = {
command = "${pkgs.sway}/bin/sway --config ${swayConfig}";
};
};
};
};
environment.etc."greetd/environments".text = ''
sway

View file

@ -5,7 +5,8 @@
nodeName,
repoFlake,
...
}: let
}:
let
localTcpPorts = [
22
@ -21,12 +22,11 @@
22000
21027
];
in {
in
{
nix.settings = {
substituters = [
];
trusted-public-keys = [
];
substituters = [ ];
trusted-public-keys = [ ];
};
nix.distributedBuilds = true;
@ -39,7 +39,8 @@ in {
system = "x86_64-linux";
maxJobs = 32;
speedFactor = 100;
supportedFeatures = repoFlake.nixosConfigurations.steveej-t14.config.nix.settings.system-features ++ [];
supportedFeatures =
repoFlake.nixosConfigurations.steveej-t14.config.nix.settings.system-features ++ [ ];
}
{
@ -50,16 +51,16 @@ in {
system = "aarch64-linux";
maxJobs = 32;
speedFactor = 100;
supportedFeatures = repoFlake.nixosConfigurations.router0-dmz0.config.nix.settings.system-features ++ [];
supportedFeatures =
repoFlake.nixosConfigurations.router0-dmz0.config.nix.settings.system-features ++ [ ];
}
];
networking.networkmanager.enable = true;
networking.extraHosts = ''
'';
networking.extraHosts = '''';
networking.bridges."virbr1".interfaces = [];
networking.bridges."virbr1".interfaces = [ ];
networking.interfaces."virbr1".ipv4.addresses = [
{
address = "10.254.254.254";
@ -92,7 +93,9 @@ in {
# virtualization
virtualisation = {
libvirtd = {enable = true;};
libvirtd = {
enable = true;
};
virtualbox.host = {
enable = false;
@ -110,13 +113,11 @@ in {
# client min protocol = NT1
'';
security.pki.certificateFiles = ["${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"];
security.pki.certificateFiles = [ "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ];
services.xserver.videoDrivers = lib.mkForce ["amdgpu"];
services.xserver.videoDrivers = lib.mkForce [ "amdgpu" ];
hardware.ledger.enable = true;
boot.binfmt.emulatedSystems = [
"aarch64-linux"
];
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
}

View file

@ -3,17 +3,19 @@
pkgs,
lib,
...
}: let
}:
let
keys = import ../../../variables/keys.nix;
inherit (pkgs.callPackage ../../lib/default.nix {}) mkUser;
in {
inherit (pkgs.callPackage ../../lib/default.nix { }) mkUser;
in
{
users.users.steveej2 = mkUser {
uid = 1001;
openssh.authorizedKeys.keys = keys.users.steveej.openssh;
hashedPasswordFile = config.sops.secrets.sharedUsers-steveej.path;
};
nix.settings.trusted-users = ["steveej"];
nix.settings.trusted-users = [ "steveej" ];
security.pam.u2f.enable = true;
security.pam.services.steveej.u2fAuth = true;