mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-24 17:23:09 +01:00
chore: Format with nixpkgs-fmt
Note that we will continue to use nixpkgs-fmt for the time being here since nixfmt-rfc-style breaks string syntax highlighting and comments like `/* this */` get turned into `# this`. The conversion from lisp-like formatting to something else in flake.nix is a bit unfortunate, but I'd rather have a singular style for the entire code base to make things easier.
This commit is contained in:
parent
01acf8197d
commit
22e31ff60b
16
flake.nix
16
flake.nix
@ -21,7 +21,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, stylix, ... } @ attrs: let
|
||||
outputs = { self, nixpkgs, home-manager, stylix, ... } @ attrs:
|
||||
let
|
||||
inherit (nixpkgs.lib) nixosSystem;
|
||||
inherit (nixpkgs.legacyPackages.x86_64-linux) nixpkgs-fmt callPackage;
|
||||
inherit (builtins) attrValues attrNames listToAttrs map replaceStrings readDir;
|
||||
@ -34,7 +35,8 @@
|
||||
flakeOutputs = [ "overlays" "nixosModules" "homeManagerModules" "packages" ];
|
||||
flakeDirectories = [ "overlays" "modules" "home" "packages" ];
|
||||
packageDirectory = "packages";
|
||||
in {
|
||||
in
|
||||
{
|
||||
formatter.x86_64-linux = nixpkgs-fmt;
|
||||
|
||||
nixosConfigurations = {
|
||||
@ -87,15 +89,19 @@
|
||||
(map
|
||||
(attributeName: {
|
||||
name = attributeName;
|
||||
value = let
|
||||
value =
|
||||
let
|
||||
directory = replaceStrings flakeOutputs flakeDirectories attributeName;
|
||||
attributeValue = (listToAttrs
|
||||
(map
|
||||
(file: {
|
||||
name = replaceStrings [ ".nix" ] [ "" ] file;
|
||||
value = if directory == packageDirectory then callPackage ./${directory}/${file} { } else import ./${directory}/${file}; })
|
||||
value = if directory == packageDirectory then callPackage ./${directory}/${file} { } else import ./${directory}/${file};
|
||||
})
|
||||
(attrNames (readDir ./${directory}))));
|
||||
attributeSet = if directory == packageDirectory then { x86_64-linux = attributeValue; } else attributeValue;
|
||||
in (attributeSet); })
|
||||
in
|
||||
(attributeSet);
|
||||
})
|
||||
(flakeOutputs)));
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{ config, lib, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
|
||||
@ -10,15 +10,15 @@
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-label/nixos";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."root".device = "/dev/disk/by-label/nixos-luks";
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-label/boot";
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
|
@ -45,7 +45,8 @@ in
|
||||
|
||||
config = {
|
||||
boot = {
|
||||
tmp = if iHaveLotsOfRam
|
||||
tmp =
|
||||
if iHaveLotsOfRam
|
||||
then { useTmpfs = true; }
|
||||
else { cleanOnBoot = true; };
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
hyprland,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
{ lib
|
||||
, stdenv
|
||||
, hyprland
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
|
@ -1,7 +1,8 @@
|
||||
# TODO: Write test to ensure that Hyprland starts with basic config
|
||||
let
|
||||
inherit (builtins) attrValues;
|
||||
in (import ./lib.nix) {
|
||||
in
|
||||
(import ./lib.nix) {
|
||||
name = "hyprland";
|
||||
|
||||
nodes.machine = { self, pkgs, ... }: {
|
||||
|
@ -1,7 +1,8 @@
|
||||
# TODO: Ensure that neovim config works without errors on startup
|
||||
let
|
||||
inherit (builtins) attrValues;
|
||||
in (import ./lib.nix) {
|
||||
in
|
||||
(import ./lib.nix) {
|
||||
name = "neovim";
|
||||
|
||||
nodes.machine = { self, pkgs, ... }: {
|
||||
|
Loading…
Reference in New Issue
Block a user