chore: format nix files treewide

This commit is contained in:
Mohammad Rafiq 2025-05-20 12:53:13 +08:00
parent e1652efa53
commit 90d10606bc
No known key found for this signature in database
30 changed files with 387 additions and 319 deletions

View file

@ -16,7 +16,8 @@
nvf.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs:
outputs =
inputs:
inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
@ -27,9 +28,12 @@
sops-nix.nixosModules.sops
];
homes.modules = with inputs; [
impermanence.homeManagerModules.impermanence
nix-index-database.hmModules.nix-index
nvf.homeManagerModules.default
impermanence.homeManagerModules.impermanence
nix-index-database.hmModules.nix-index
nvf.homeManagerModules.default
];
outputs-builder = channels: {
formatter = channels.nixpkgs.nixfmt-rfc-style;
};
};
}

View file

@ -1,4 +1,9 @@
{ config, pkgs, osConfig, ... }:
{
config,
pkgs,
osConfig,
...
}:
{
cli.shell = "zsh";
cli.editor = "nvf";

View file

@ -1,4 +1,9 @@
{config, lib, osConfig, ... }:
{
config,
lib,
osConfig,
...
}:
{
options.cli = {
shell = lib.pantheon.mkStrOption;
@ -14,7 +19,9 @@
config = lib.mkMerge [
{
programs.zoxide.enable = true;
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [ "./local/share/zoxide" ];
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [
"./local/share/zoxide"
];
}
{
programs.nix-index.enable = true;

View file

@ -6,4 +6,4 @@
action = ":cd %:p:h<CR>:e <cfile><CR>";
silent = true;
}
]
]

View file

@ -1,8 +1,6 @@
{ config, lib, ... }:
{
config =
lib.mkIf (config.cli.file-browser == "yazi")
{
config = lib.mkIf (config.cli.file-browser == "yazi") {
home.sessionVariables.FILE_BROWSER = "yazi";
programs.yazi = {
enable = true;

View file

@ -1,4 +1,4 @@
{lib,config,...}:
{ lib, config, ... }:
{
config = {
home.sessionVariables.GIT_CONFIG_GLOBAL = "$HOME/.config/git/config";

View file

@ -1,4 +1,9 @@
{ config, lib, osConfig, ... }:
{
config,
lib,
osConfig,
...
}:
{
options.desktop = {
windowManager = lib.pantheon.mkStrOption;
@ -6,10 +11,8 @@
terminal = lib.pantheon.mkStrOption;
};
config = {
assertions =
[
assertions = [
{
assertion = (osConfig.desktop.windowManager == config.desktop.windowManager);
message = "You have set your home window manager to one that is not installed on this system.";

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkMerge [
(lib.mkIf (config.desktop.terminal == "kitty") {

View file

@ -1,4 +1,9 @@
{ config, lib, osConfig, ... }:
{
config,
lib,
osConfig,
...
}:
let
mainMonitor = osConfig.desktop.mainMonitor;
in
@ -7,7 +12,8 @@ in
];
config = lib.mkIf (config.desktop.windowManager == "hyprland") (lib.mkMerge [
config = lib.mkIf (config.desktop.windowManager == "hyprland") (
lib.mkMerge [
{
xdg.configFile."uwsm/env".text = # sh
''
@ -50,5 +56,6 @@ in
};
};
}
]);
]
);
}

View file

@ -1,14 +1,19 @@
{config, lib, pkgs, ...}:
{
imports = [];
options.cli = {};
config = lib.mkMerge [
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.cli = { };
config = lib.mkMerge [
{
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
environment.pathsToLink = [ "/share/zsh" ]; # enables completion
}
];
}
];
}

View file

@ -1,9 +1,10 @@
{lib, config, ...}:
{ lib, config, ... }:
let
cfg = config.hardware.drives.btrfs;
in
{
config = lib.mkIf (cfg.enable) (lib.mkMerge [
config = lib.mkIf (cfg.enable) (
lib.mkMerge [
{
boot.initrd.kernelModules = [ "dm-snapshot" ];
disko.devices.disk.main = {
@ -40,13 +41,19 @@ in
type = "lvm_vg";
lvs.root.size = "100%FREE";
lvs.root.content.type = "btrfs";
lvs.root.content.extraArgs = ["-f"];
lvs.root.content.extraArgs = [ "-f" ];
lvs.root.content.subvolumes = {
"/root".mountpoint = "/";
"/persist".mountpoint = "/persist";
"/persist".mountOptions = ["subvol=persist" "noatime"];
"/persist".mountOptions = [
"subvol=persist"
"noatime"
];
"/nix".mountpoint = "/nix";
"/nix".mountOptions = ["subvol=nix" "noatime"];
"/nix".mountOptions = [
"subvol=nix"
"noatime"
];
};
};
}
@ -77,5 +84,6 @@ in
'';
programs.fuse.userAllowOther = true;
})
]);
]
);
}

View file

@ -1,7 +1,7 @@
{ config, lib, ... }:
{
config = lib.mkMerge [
(lib.mkIf (config.hardware.platform == "amd"){
(lib.mkIf (config.hardware.platform == "amd") {
hardware.cpu.amd.updateMicrocode = true;
boot.kernelModules = [ "kvm-amd" ];
})

View file

@ -1,4 +1,4 @@
{lib,...}:
{ lib, ... }:
{
imports = [
./btrfs.nix

View file

@ -7,15 +7,17 @@
networking.networkmanager.enable = true;
services.openssh = {
enable = true;
settings = {
PrintMotd = true;};
enable = true;
settings = {
PrintMotd = true;
};
};
services.tailscale = {
enable = true;
authKeyFile = config.sops.secrets."keys/tailscale".path;};
environment.persistence."/persist".files = [ "/var/lib/tailscale/tailscaled.state"];
authKeyFile = config.sops.secrets."keys/tailscale".path;
};
environment.persistence."/persist".files = [ "/var/lib/tailscale/tailscaled.state" ];
}
];

View file

@ -1,6 +1,12 @@
{ lib, config, pkgs, ... }:
{
config = lib.mkIf (config.hardware.gpu == "nvidia") (lib.mkMerge [
lib,
config,
pkgs,
...
}:
{
config = lib.mkIf (config.hardware.gpu == "nvidia") (
lib.mkMerge [
{
#TODO: Setup CUDA
hardware.graphics.enable = true;
@ -17,5 +23,6 @@
NVD_BACKEND = "direct";
};
}
]);
]
);
}

View file

@ -2,10 +2,17 @@
{
config = lib.mkMerge [
{
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.loader.efi.canTouchEfiVariables = true;
}
(lib.mkIf (config.system.bootloader == "systemd-boot"){
(lib.mkIf (config.system.bootloader == "systemd-boot") {
boot.loader.systemd-boot.enable = true;
})
];

View file

@ -1,4 +1,4 @@
{ config, lib, ...}:
{ config, lib, ... }:
{
imports = [
./boot.nix

View file

@ -2,9 +2,9 @@
{
sops = {
defaultSopsFile = lib.snowfall.fs.get-file "secrets/secrets.yaml";
age.sshKeyPaths = ["/persist/home/rafiq/.ssh/id_ed25519"];
age.sshKeyPaths = [ "/persist/home/rafiq/.ssh/id_ed25519" ];
secrets = {
"keys/tailscale" = {};
"keys/tailscale" = { };
"rafiq/hashedPassword".neededForUsers = true;
};
};

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkMerge [
{

View file

@ -1,16 +1,16 @@
{ lib, pkgs, ... }:
pkgs.writeShellScriptBin "rebuild" # sh
''
if [ ! -f "flake.nix" ]; then
echo "flake.nix not found in current directory. exiting..."
exit 1
fi
''
if [ ! -f "flake.nix" ]; then
echo "flake.nix not found in current directory. exiting..."
exit 1
fi
git add . && \
nixos-rebuild switch --flake . --use-remote-sudo && \
echo "=== opening test shell. ===" && \
echo "=== exit = commit ===" && \
echo "=== exit 1 = abort ===" && \
$SHELL && \
git commit -a
''
git add . && \
nixos-rebuild switch --flake . --use-remote-sudo && \
echo "=== opening test shell. ===" && \
echo "=== exit = commit ===" && \
echo "=== exit 1 = abort ===" && \
$SHELL && \
git commit -a
''

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
system.hostname = "nemesis";
system.mainUser.name = "rafiq";
@ -14,10 +19,10 @@
desktop.windowManager = "hyprland";
desktop.mainMonitor = {
id = "desc:OOO AN-270W04K";
scale = "1";
resolution = "2560x1440";
refresh-rate = "144";
id = "desc:OOO AN-270W04K";
scale = "1";
resolution = "2560x1440";
refresh-rate = "144";
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";