fixed formatting

This commit is contained in:
Fishandchips321 2026-02-28 20:03:22 +00:00
parent 7ec36e8a2b
commit d8dd32193d
15 changed files with 167 additions and 76 deletions

View file

@ -1,5 +1,5 @@
{lib, ...}: { lib, ... }:
{ {
imports = lib.fileset.toList (lib.fileset.fileFilter (f: f.hasExt "nix") ./modules); imports = lib.fileset.toList (lib.fileset.fileFilter (f: f.hasExt "nix") ./modules);
} }

View file

@ -3,14 +3,12 @@
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
}; };
outputs = { self, nixpkgs }: { outputs =
# hydraJobs = nixpkgs.lib.mapAttrs (_: value: value.config.system.build.toplevel) self.nixosConfigurations; { self, nixpkgs }:
nixosConfigurations = { {
vm = nixpkgs.lib.nixosSystem { # hydraJobs = nixpkgs.lib.mapAttrs (_: value: value.config.system.build.toplevel) self.nixosConfigurations;
modules = [ nixosConfigurations = {
./systems/vm/configuration.nix vm = nixpkgs.lib.nixosSystem { modules = [ ./systems/vm/configuration.nix ]; };
];
}; };
}; };
};
} }

View file

@ -1,4 +1,4 @@
{config, pkgs, ...}: { config, pkgs, ... }:
{ {
boot.loader.grub.enable = true; boot.loader.grub.enable = true;

View file

@ -1,4 +1,4 @@
{config, pkgs, ...}: { config, pkgs, ... }:
{ {
programs = { programs = {

View file

@ -1,28 +1,35 @@
{config, pkgs, lib, ...}: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.modules.graphical; cfg = config.modules.graphical;
in in
{ {
options = { options = {
modules.graphical = { modules.graphical = {
enable = lib.mkEnableOption "Enable the GUI"; enable = lib.mkEnableOption "Enable the GUI";
waybar = lib.mkEnableOption "Enable waybar"; waybar = lib.mkEnableOption "Enable waybar";
quickshell = lib.mkEnableOption "Enable quickshell"; quickshell = lib.mkEnableOption "Enable quickshell";
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.niri.enable = true; programs.niri.enable = true;
services.displayManager.ly.enable = true; services.displayManager.ly.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages =
alacritty with pkgs;
wl-clipboard [
] alacritty
++ lib.optional cfg.quickshell quickshell; wl-clipboard
]
++ lib.optional cfg.quickshell quickshell;
programs.waybar.enable = lib.mkIf cfg.waybar true; programs.waybar.enable = lib.mkIf cfg.waybar true;
}; };
} }

View file

@ -1,4 +1,9 @@
{config, pkgs, lib, ...}: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.modules.k3s; cfg = config.modules.k3s;
@ -7,7 +12,5 @@ in
{ {
options.modules.k3s.enable = lib.mkEnableOption "Enable the k3s service"; options.modules.k3s.enable = lib.mkEnableOption "Enable the k3s service";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable { services.k3s.enable = true; };
services.k3s.enable = true;
};
} }

View file

@ -1,11 +1,16 @@
{config, pkgs, lib, ...}: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.modules.kubernetes; cfg = config.modules.kubernetes;
in in
{ {
options.modules.kubernetes.enable = lib.mkEnableOption "Enable MiniKube and Kubectl"; options.modules.kubernetes.enable = lib.mkEnableOption "Enable MiniKube and Kubectl";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View file

@ -1,5 +1,4 @@
_: _: {
{
services.automatic-timezoned.enable = true; services.automatic-timezoned.enable = true;
i18n.defaultLocale = "en_GB.UTF-8"; i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
@ -13,5 +12,5 @@ _:
LC_TELEPHONE = "en_GB.UTF-8"; LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8"; LC_TIME = "en_GB.UTF-8";
}; };
console.keyMap = "uk"; console.keyMap = "uk";
} }

View file

@ -1,4 +1,4 @@
{config, pkgs, ...}: { config, pkgs, ... }:
{ {
networking.networkmanager.enable = true; networking.networkmanager.enable = true;

View file

@ -1,4 +1,9 @@
{config, pkgs, lib, ...}: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.modules.prismLauncher; cfg = config.modules.prismLauncher;
@ -6,9 +11,5 @@ in
{ {
options.modules.prismLauncher.enable = lib.mkEnableOption "Enables the prism minecraft launcher"; options.modules.prismLauncher.enable = lib.mkEnableOption "Enables the prism minecraft launcher";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs; [ prismlauncher ]; };
environment.systemPackages = with pkgs; [
prismlauncher
];
};
} }

View file

@ -1,4 +1,9 @@
{config, pkgs, lib, ...}: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.modules.yazi; cfg = config.modules.yazi;

View file

@ -1,4 +1,6 @@
{pkgs ? import <nixpkgs> {}}: {
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell { pkgs.mkShell {
nativeBuildInputs = with pkgs.buildPackages; [ nativeBuildInputs = with pkgs.buildPackages; [
deadnix deadnix

View file

@ -1,19 +1,19 @@
{ config, pkgs, ...}: { config, pkgs, ... }:
{ {
imports = [ imports = [
../../all-modules.nix ../../all-modules.nix
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
users.users.riley = { users.users.riley = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel"]; extraGroups = [ "wheel" ];
}; };
networking.hostName = "vm"; networking.hostName = "vm";
modules.graphical = { modules.graphical = {
enable = true; enable = true;
waybar = true; waybar = true;
quickshell = true; quickshell = true;
@ -21,5 +21,5 @@
modules.yazi.enable = true; modules.yazi.enable = true;
system.stateVersion = "25.11"; system.stateVersion = "25.11";
} }

View file

@ -1,19 +1,29 @@
{ config, lib, pkgs, modulesPath, ...}:
{ {
imports = [ config,
(modulesPath + "/profiles/qemu-guest.nix") lib,
]; pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; boot.initrd.availableKernelModules = [
boot.initrd.kernelModules = []; "ahci"
boot.extraModulePackages = []; "xhci_pci"
"virtio_pci"
"sr_mod"
"virtio_blk"
];
boot.initrd.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/ed56e12e-55cc-42e0-b94f-9a6d6bb2bdad"; device = "/dev/disk/by-uuid/ed56e12e-55cc-42e0-b94f-9a6d6bb2bdad";
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = []; swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
} }

61
treefmt.toml Normal file
View file

@ -0,0 +1,61 @@
# One CLI to format the code tree - https://github.com/numtide/treefmt
# Do not exit with error if a configured formatter is missing
# Env $TREEFMT_ALLOW_MISSING_FORMATTER
# allow-missing-formatter = true
# The file into which a cpu profile will be written
# Env $TREEFMT_CPU_PROFILE
# cpu-profile = ./cpu.pprof
# Exclude files or directories matching the specified globs
# Env $TREEFMT_EXCLUDES
# excludes = ["*.md", "*.gif"]
# Exit with error if any changes were made during execution
# Useful for CI
# Env $TREEFMT_FAIL_ON_CHANGE
# fail-on-change = true
# A list of formatters to apply
# Defaults to all configured formatters
# Env $TREEFMT_FORMATTERS
# formatters = ["gofmt", "prettier"]
# Log paths that did not match any formatters at the specified log level
# Possible values are <debug|info|warn|error|fatal>
# Env $TREEFMT_ON_UNMATCHED
# on-unmatched = "info"
# The root directory from which treefmt will start walking the filesystem
# Defaults to the directory containing the config file
# Env $TREEFMT_TREE_ROOT
# tree-root = "/tmp/foo"
# File to search for to find the tree root (if tree-root is not set)
# Env $TREEFMT_TREE_ROOT_FILE
# tree-root-file = ".git/config"
# Set the verbosity of logs
# 0 = warn, 1 = info, 2 = debug
# Env $TREEFMT_VERBOSE
# verbose = 2
# The method used to traverse the files within the tree root
# Currently, we support 'auto', 'git' or 'filesystem'
# Env $TREEFMT_WALK
# walk = "filesystem"
[formatter.mylanguage]
# Command to execute
command = "nixfmt"
# Command-line arguments for the command
options = ["-s", "-v", "-w150"]
# Glob pattern of files to include
includes = ["*.nix"]
# Glob patterns of files to exclude
excludes = []
# Controls the order of application when multiple formatters match the same file
# Lower the number, the higher the precedence
# Default is 0
priority = 0