changed formater

This commit is contained in:
k 2024-12-23 22:08:45 -05:00
parent 52fbee6322
commit 3995c29b03
18 changed files with 278 additions and 244 deletions

View File

@ -12,14 +12,19 @@
};
};
outputs = { self, nixpkgs, nixos-hardware, ... }@inputs:
let
outputs = {
self,
nixpkgs,
nixos-hardware,
...
} @ inputs: let
system = "x86_64-linux";
pkg = nixpkgs.legacyPackages.${system};
in {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
specialArgs = {inherit inputs;};
modules = [
./hosts/laptop/configuration.nix
inputs.home-manager.nixosModules.default
@ -30,7 +35,7 @@
};
server = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
specialArgs = {inherit inputs;};
modules = [
./hosts/server/configuration.nix
inputs.home-manager.nixosModules.default
@ -40,14 +45,13 @@
};
tablet = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
specialArgs = {inherit inputs;};
modules = [
./hosts/tablet/configuration.nix
inputs.home-manager.nixosModules.default
nixos-hardware.nixosModules.microsoft-surface-pro-intel
];
};
};
};
}

View File

@ -1,6 +1,9 @@
{ config, pkgs, inputs, ... }:
{
config,
pkgs,
inputs,
...
}: {
# ...
dconf.settings = {
# ...
@ -22,4 +25,3 @@
gnomeExtensions.search-light
];
}

View File

@ -1,6 +1,9 @@
{ config, pkgs, inputs, ... }:
{
config,
pkgs,
inputs,
...
}: {
home = {
username = "k";
homeDirectory = "/home/k";
@ -13,7 +16,7 @@
userName = "k";
userEmail = "markers711@gmail.com";
};
tmux = { enable = true; };
tmux = {enable = true;};
starship.enable = true;
zsh = {
enable = true;
@ -21,7 +24,8 @@
enableCompletion = true;
syntaxHighlighting.enable = true;
autocd = true;
plugins = [{
plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
@ -30,7 +34,8 @@
rev = "v0.8.0";
sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7";
};
}];
}
];
};
};
}

View File

@ -1,15 +1,21 @@
{ config, pkgs, inputs, ... }:
{
imports = [ ./waybar.nix ./tile.nix ];
config,
pkgs,
inputs,
...
}: {
imports = [./waybar.nix ./tile.nix];
wayland.windowManager.hyprland = {
enable = true;
systemd.variables = [ "--all" ];
systemd.variables = ["--all"];
xwayland.enable = true;
settings = {
exec-once = [ "${pkgs.hyprpaper}/bin/hyprpaper" "${pkgs.iio-hyprland}/bin/iio-hyprland" ];
exec-once = [
"${pkgs.hyprpaper}/bin/hyprpaper"
"${pkgs.iio-hyprland}/bin/iio-hyprland"
];
monitor = "eDP-1,preferred,auto,1";
general = {
"$mainMod" = "SUPER";
@ -28,7 +34,7 @@
size = 2;
passes = 2;
brightness = 1;
noise = .3;
noise = 0.3;
new_optimizations = true;
};
drop_shadow = true;
@ -48,11 +54,7 @@
vrr = 1;
};
input = {
touchpad = {
natural_scroll = true;
};
};
input = {touchpad = {natural_scroll = true;};};
bind = [
# keybindings
@ -68,7 +70,6 @@
"$mainMod, up, movefocus, u"
"$mainMod, down, movefocus, d"
# switch workspace
"$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2"
@ -124,10 +125,9 @@
"$mainMod, mouse:273, resizewindow"
];
windowrule =
[ "float,mpv" "center,mpv" "pin,wofi" "idleinhibit focus,mpv" ];
windowrule = ["float,mpv" "center,mpv" "pin,wofi" "idleinhibit focus,mpv"];
windowrulev2 = [ ];
windowrulev2 = [];
};
};
@ -141,4 +141,3 @@
_JAVA_AWT_WM_NONREPARENTING = 1;
};
}

View File

@ -1,7 +1,10 @@
{ config, pkgs, inputs, ... }:
{
imports = [ ./waybar.nix ./tile.nix ];
config,
pkgs,
inputs,
...
}: {
imports = [./waybar.nix ./tile.nix];
wayland.windowManager.sway = {
enable = true;
@ -29,9 +32,5 @@
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
_JAVA_AWT_WM_NONREPARENTING = 1;
};
services = {
swayidle = { enable = true; };
};
services = {swayidle = {enable = true;};};
}

View File

@ -1,14 +1,15 @@
{ config, pkgs, inputs, ... }:
{
services = {
mako = { enable = true; };
};
config,
pkgs,
inputs,
...
}: {
services = {mako = {enable = true;};};
programs = {
alacritty = { enable = true; };
alacritty = {enable = true;};
swaylock = {enable = true;};
wofi = { enable = true; };
zathura = { enable = true; };
mpv = { enable = true; };
wofi = {enable = true;};
zathura = {enable = true;};
mpv = {enable = true;};
};
}

View File

@ -1,4 +1,8 @@
{ config, pkgs, ... }: {
{
config,
pkgs,
...
}: {
programs.waybar = {
enable = true;
systemd.enable = true;
@ -6,14 +10,14 @@
mainBar = {
layer = "bottom";
position = "bottom";
output = [ "eDP-1" ];
output = ["eDP-1"];
margin-left = 45;
margin-right = 45;
spacing = 15;
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-center = [ "clock" ];
modules-right = [ "pulseaudio" "network" "battery" ];
modules-left = ["sway/workspaces" "sway/mode"];
modules-center = ["clock"];
modules-right = ["pulseaudio" "network" "battery"];
cpu = {
interval = 15;
@ -38,7 +42,7 @@
phone = " ";
portable = " ";
car = " ";
default = [ " " " " ];
default = [" " " "];
};
scroll-step = 1;
on-click = "pavucontrol";
@ -66,7 +70,7 @@
battery = {
format = "{capacity}% {icon}";
"format-icons" = [ " " " " " " " " " " ];
"format-icons" = [" " " " " " " " " "];
};
clock = {

View File

@ -1,7 +1,10 @@
{ config, pkgs, inputs, ... }:
{
imports = [ ./hardware-configuration.nix ];
config,
pkgs,
inputs,
...
}: {
imports = [./hardware-configuration.nix];
nixpkgs.config.allowUnfree = true;
system.autoUpgrade.enable = true;
@ -15,18 +18,12 @@
nix = {
gc.automatic = true;
settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"http://nix.dhilton.xyz/"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nix.dhilton.xyz:MOW060dF1A0/UXmPZBue9KMxCO13PHYFwx1X9hcdYZ4="
];
experimental-features = ["nix-command" "flakes"];
substituters = ["http://nix.dhilton.xyz/" "https://cache.nixos.org/"];
trusted-public-keys = ["nix.dhilton.xyz:MOW060dF1A0/UXmPZBue9KMxCO13PHYFwx1X9hcdYZ4="];
};
};
networking = {
hostName = "laptop";
networkmanager.enable = true;
@ -115,7 +112,7 @@
programs = {
nix-ld.enable = true;
nix-ld.libraries = with pkgs; [ glibc glib ];
nix-ld.libraries = with pkgs; [glibc glib];
zsh.enable = true;
steam.enable = true;
steam.gamescopeSession.enable = true;
@ -126,19 +123,19 @@
users.users.k = {
isNormalUser = true;
description = "k";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [ zsh ];
extraGroups = ["networkmanager" "wheel"];
packages = with pkgs; [zsh];
shell = pkgs.zsh;
};
home-manager = {
backupFileExtension = "bk";
users = { "k" = import ./home.nix; };
users = {"k" = import ./home.nix;};
};
environment = {
sessionVariables = { MOZ_USE_XINPUT2 = "1"; };
gnome.excludePackages = (with pkgs; [
sessionVariables = {MOZ_USE_XINPUT2 = "1";};
gnome.excludePackages = with pkgs; [
gnome-photos
gnome-tour
xterm
@ -153,7 +150,7 @@
iagno # go game
hitori # sudoku game
atomix # puzzle game
]);
];
systemPackages = with pkgs; [
intel-vaapi-driver
intel-compute-runtime
@ -170,8 +167,7 @@
};
boot = {
plymouth = { enable = true; };
plymouth = {enable = true;};
consoleLogLevel = 0;
initrd.verbose = false;
@ -194,5 +190,4 @@
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -1,16 +1,19 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules =
[ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/a7301069-c11f-411e-9a23-446744c3ae76";
@ -22,8 +25,7 @@
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/d9df94a1-5088-468c-839d-f4cd10cb7e5f"; }];
swapDevices = [{device = "/dev/disk/by-uuid/d9df94a1-5088-468c-839d-f4cd10cb7e5f";}];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -1,7 +1,15 @@
{ config, pkgs, inputs, ... }:
{
imports = [ ../home/home_common.nix ../home/gnome.nix ../home/sway.nix ../home/hyprland.nix];
config,
pkgs,
inputs,
...
}: {
imports = [
../home/home_common.nix
../home/gnome.nix
../home/sway.nix
../home/hyprland.nix
];
nixpkgs.config.allowUnfree = true;
@ -52,5 +60,4 @@
enable = true;
autoEnable = true;
};
}

View File

@ -1,43 +1,41 @@
{ config, pkgs, inputs, ... }:
{
imports = [ ./hardware-configuration.nix ./service.nix ];
config,
pkgs,
inputs,
...
}: {
imports = [./hardware-configuration.nix ./service.nix];
powerManagement.enable = false;
system.autoUpgrade.enable = true;
networking.networkmanager.enable = true;
boot.kernelParams = [ "intel_pstate=active" ];
boot.kernelParams = ["intel_pstate=active"];
nix = {
gc.automatic = true;
settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"http://nix.dhilton.xyz/"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nix.dhilton.xyz:MOW060dF1A0/UXmPZBue9KMxCO13PHYFwx1X9hcdYZ4="
];
experimental-features = ["nix-command" "flakes"];
substituters = ["http://nix.dhilton.xyz/" "https://cache.nixos.org/"];
trusted-public-keys = ["nix.dhilton.xyz:MOW060dF1A0/UXmPZBue9KMxCO13PHYFwx1X9hcdYZ4="];
};
};
programs = {
nix-ld.enable = true;
nix-ld.libraries = with pkgs; [ glibc glib ];
nix-ld.libraries = with pkgs; [glibc glib];
zsh.enable = true;
};
users.users.k = {
isNormalUser = true;
description = "k";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [ zsh ];
extraGroups = ["networkmanager" "wheel"];
packages = with pkgs; [zsh];
shell = pkgs.zsh;
};
home-manager = { users = { "k" = import ./home.nix; }; };
home-manager = {users = {"k" = import ./home.nix;};};
environment.systemPackages = with pkgs; [ microcodeIntel ];
environment.systemPackages = with pkgs; [microcodeIntel];
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
@ -54,7 +52,7 @@
];
};
services.xserver.videoDrivers = [ "intel" ];
services.xserver.videoDrivers = ["intel"];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
@ -63,5 +61,4 @@
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -1,16 +1,19 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules =
[ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
@ -27,8 +30,7 @@
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/ecde85bd-abea-4926-80d5-810b01d0e364"; }];
swapDevices = [{device = "/dev/disk/by-uuid/ecde85bd-abea-4926-80d5-810b01d0e364";}];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -1,11 +1,9 @@
{ config, pkgs, inputs, ... }:
{
imports = [ ../home/home_common.nix ];
home = {
packages = with pkgs; [
docker
docker-compose
];
};
config,
pkgs,
inputs,
...
}: {
imports = [../home/home_common.nix];
home = {packages = with pkgs; [docker docker-compose];};
}

View File

@ -1,9 +1,12 @@
{ pkgs, lib, ... }: {
{
pkgs,
lib,
...
}: {
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 443 22 26615 ];
allowedUDPPorts = [ 26615 ];
allowedTCPPorts = [80 443 22 26615];
allowedUDPPorts = [26615];
};
security.acme = {
@ -11,18 +14,18 @@
defaults.email = "markers711@gmail.com";
};
virtualisation.docker = { enable = true; };
virtualisation.docker = {enable = true;};
services = {
openssh = { enable = true; };
openssh = {enable = true;};
jellyfin = { enable = true; };
jellyfin = {enable = true;};
fail2ban = { enable = true; };
fail2ban = {enable = true;};
postgresql = { enable = true; };
postgresql = {enable = true;};
i2p = { enable = true; };
i2p = {enable = true;};
nix-serve = {
enable = true;
@ -64,13 +67,13 @@
home-assistant = {
enable = true;
extraComponents = [ "wiz" "fail2ban" "ollama" "wyoming" ];
extraComponents = ["wiz" "fail2ban" "ollama" "wyoming"];
config = {
default_config = { };
default_config = {};
"automation ui" = "!include automations.yaml";
http = {
use_x_forwarded_for = "true";
trusted_proxies = [ "127.0.0.1" ];
trusted_proxies = ["127.0.0.1"];
server_port = 8003;
};
};
@ -109,7 +112,7 @@
email = "markers711@gmail.com";
registration_open = false;
};
"Pleroma.Web.Endpoint" = { url.host = "fed.dhilton.xyz"; };
"Pleroma.Web.Endpoint" = {url.host = "fed.dhilton.xyz";};
};
};
nginx = {
@ -124,7 +127,6 @@
recommendedTlsSettings = true;
virtualHosts = {
"dhilton.xyz" = {
enableACME = true;
forceSSL = true;

View File

@ -1,14 +1,18 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, inputs, nixos-hardware, ... }:
{
imports = [ # Include the results of the hardware scan.
config,
pkgs,
inputs,
nixos-hardware,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = ["nix-command" "flakes"];
nixpkgs.config.allowUnfree = true;
networking.networkmanager.enable = true;
@ -69,11 +73,11 @@
users.users.k = {
isNormalUser = true;
description = "k";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [ zsh ];
extraGroups = ["networkmanager" "wheel"];
packages = with pkgs; [zsh];
shell = pkgs.zsh;
};
home-manager = { users = { "k" = import ./home.nix; }; };
home-manager = {users = {"k" = import ./home.nix;};};
system.autoUpgrade.enable = true;
nix.gc.automatic = true;
@ -89,7 +93,7 @@
neovim
];
boot.kernelModules = [ "soc_button_array" ];
boot.kernelModules = ["soc_button_array"];
networking.firewall.enable = true;
@ -100,5 +104,4 @@
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -1,16 +1,19 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules =
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
hardware.opengl.driSupport32Bit = true;
networking.hostName = "surface";
@ -29,8 +32,7 @@
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/19941c01-ac8c-4609-a834-20259f3ee32e"; }];
swapDevices = [{device = "/dev/disk/by-uuid/19941c01-ac8c-4609-a834-20259f3ee32e";}];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -1,6 +1,9 @@
{ config, pkgs, inputs, ... }:
{
config,
pkgs,
inputs,
...
}: {
home.enableNixpkgsReleaseCheck = false;
nixpkgs.config.allowUnfree = true;
@ -25,7 +28,8 @@
enableCompletion = true;
syntaxHighlighting.enable = true;
autocd = true;
plugins = [{
plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
@ -34,6 +38,7 @@
rev = "v0.8.0";
sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7";
};
}];
}
];
};
}

View File

@ -1,16 +1,22 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}: {
nixpkgs.overlays = [
(final: prev: {
ollama-intel = prev.ollama.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs or [ ]
++ [ prev.intel-compute-runtime.drivers ];
propagatedBuildInputs = oldAttrs.propagetedBuildInputs or [ ]
++ [ prev.intel-compute-runtime.drivers ];
buildInputs =
oldAttrs.buildInputs
or []
++ [prev.intel-compute-runtime.drivers];
propagatedBuildInputs =
oldAttrs.propagetedBuildInputs
or []
++ [prev.intel-compute-runtime.drivers];
NIX_CFLAGS_COMPILE =
"${oldAttrs.NIX_CFLAGS_COMPILE or ""} -mavx2 -mfma -O3";
NIX_CFLAGS_COMPILE = "${oldAttrs.NIX_CFLAGS_COMPILE or ""} -mavx2 -mfma -O3";
cmakeFlags = [
"GGML_NATIVE=true"
"BUILD_SHARED_LIBS=true"
@ -21,7 +27,9 @@
"CMAKE_CXX_COMPILER=icpx"
];
postInstall = (oldAttrs.postInstall or "") + ''
postInstall =
(oldAttrs.postInstall or "")
+ ''
mkdir -p "$out/bin"
cat << EOF > "$out/bin/ollama-wrapped"
#!/bin/sh
@ -37,4 +45,3 @@
})
];
}