Skip to content

Commit

Permalink
Use nixfmt-rfc-style instead of alejandra
Browse files Browse the repository at this point in the history
  • Loading branch information
joinemm committed Aug 25, 2024
1 parent 32e36c3 commit a7cb79d
Show file tree
Hide file tree
Showing 67 changed files with 893 additions and 800 deletions.
10 changes: 6 additions & 4 deletions deployments.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{self, ...}: let
{ self, ... }:
let
inherit (self.inputs) deploy-rs;

x86 = {
Expand Down Expand Up @@ -27,12 +28,13 @@
};
};
};
in {
in
{
flake = {
deploy.nodes = x86 // aarch64;
checks = {
x86_64-linux = deploy-rs.lib.x86_64-linux.deployChecks {nodes = x86;};
aarch64-linux = deploy-rs.lib.aarch64-linux.deployChecks {nodes = aarch64;};
x86_64-linux = deploy-rs.lib.x86_64-linux.deployChecks { nodes = x86; };
aarch64-linux = deploy-rs.lib.aarch64-linux.deployChecks { nodes = aarch64; };
};
};
}
22 changes: 12 additions & 10 deletions devshell.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
perSystem = {pkgs, ...}: {
devShells.default = pkgs.mkShell {
name = "snowflake";
packages = with pkgs; [
sops
ssh-to-age
gnupg
deploy-rs
];
perSystem =
{ pkgs, ... }:
{
devShells.default = pkgs.mkShell {
name = "snowflake";
packages = with pkgs; [
sops
ssh-to-age
gnupg
deploy-rs
];
};
};
};
}
5 changes: 1 addition & 4 deletions disko/hetzner-block-storage.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{ id, mountpoint, ... }:
{
id,
mountpoint,
...
}: {
disko.devices.disk = {
# hetzner block storage, must be attached from cloud gui
block = {
Expand Down
3 changes: 2 additions & 1 deletion disko/hetzner-osdisk.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{pci, ...}: {
{ pci, ... }:
{
disko.devices.disk = {
sda = {
device = "/dev/disk/by-path/pci-${pci}-scsi-0:0:0:0";
Expand Down
53 changes: 28 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@
};
};

outputs = inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
Expand All @@ -126,31 +127,33 @@
./deployments.nix
];

perSystem = {
pkgs,
config,
...
}: {
packages = {
rpi_export = pkgs.callPackage ./pkgs/rpi_export {};
headscale-alpha = pkgs.callPackage ./pkgs/headscale {};
actual-server = pkgs.callPackage ./pkgs/actual-server {};
};

treefmt.config = {
inherit (config.flake-root) projectRootFile;
programs = {
alejandra.enable = true;
deadnix.enable = true;
statix.enable = true;
shellcheck.enable = true;
ormolu.enable = true;
jsonfmt.enable = true;
perSystem =
{ pkgs, config, ... }:
{
packages = {
rpi_export = pkgs.callPackage ./pkgs/rpi_export { };
headscale-alpha = pkgs.callPackage ./pkgs/headscale { };
actual-server = pkgs.callPackage ./pkgs/actual-server { };
};
settings.formatter.ormolu = {
options = ["--ghc-opt" "-XImportQualifiedPost"];

treefmt.config = {
inherit (config.flake-root) projectRootFile;
programs = {
nixfmt.enable = true;
nixfmt.package = pkgs.nixfmt-rfc-style; # rfc-166 formatting conform version
deadnix.enable = true;
statix.enable = true;
shellcheck.enable = true;
ormolu.enable = true;
jsonfmt.enable = true;
};
settings.formatter.ormolu = {
options = [
"--ghc-opt"
"-XImportQualifiedPost"
];
};
};
};
};
};
}
3 changes: 2 additions & 1 deletion githubMatrix.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{self, ...}: {
{ self, ... }:
{
flake.githubActions.matrix = {
host = builtins.attrNames self.nixosConfigurations;
};
Expand Down
3 changes: 2 additions & 1 deletion home-modules/common.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
home.stateVersion = "23.11";
programs.home-manager.enable = true;
nixpkgs.config.allowUnfree = true;
Expand Down
3 changes: 2 additions & 1 deletion home-modules/discord.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
home.packages = with pkgs; [
(discord.override {
withOpenASAR = false;
Expand Down
7 changes: 3 additions & 4 deletions home-modules/easyeffects/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{pkgs, ...}: {
imports = [
./preset.nix
];
{ pkgs, ... }:
{
imports = [ ./preset.nix ];

services.easyeffects = {
enable = true;
Expand Down
80 changes: 39 additions & 41 deletions home-modules/easyeffects/preset.nix
Original file line number Diff line number Diff line change
@@ -1,57 +1,55 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.services.easyeffects;
in {
in
{
options = {
services.easyeffects.presets = mkOption {
type = types.listOf (types.submodule {
options = {
device = mkOption {
type = types.str;
};
type = mkOption {
type = types.enum ["input" "output"];
};
profile = mkOption {
type = types.str;
};
file = mkOption {
type = types.path;
};
description = mkOption {
type = types.str;
default = "Created by Home Manager";
type = types.listOf (
types.submodule {
options = {
device = mkOption { type = types.str; };
type = mkOption {
type = types.enum [
"input"
"output"
];
};
profile = mkOption { type = types.str; };
file = mkOption { type = types.path; };
description = mkOption {
type = types.str;
default = "Created by Home Manager";
};
};
};
});
}
);
};
};
config = {
xdg.configFile = lib.mergeAttrsList (
map ({
device,
type,
profile,
file,
description,
}: let
name = builtins.head (lib.splitString "." (builtins.baseNameOf file));
in {
"easyeffects/${type}/${name}.json".source = file;
"easyeffects/autoload/${type}/${device}.json".text =
builtins.toJSON
{
map (
{
device,
type,
profile,
file,
description,
}:
let
name = builtins.head (lib.splitString "." (builtins.baseNameOf file));
in
{
"easyeffects/${type}/${name}.json".source = file;
"easyeffects/autoload/${type}/${device}.json".text = builtins.toJSON {
inherit device;
device-description = description;
device-profile = profile;
preset-name = name;
};
})
cfg.presets
}
) cfg.presets
);
};
}
3 changes: 2 additions & 1 deletion home-modules/flameshot.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{user, ...}: {
{ user, ... }:
{
services = {
flameshot = {
enable = true;
Expand Down
3 changes: 2 additions & 1 deletion home-modules/gaming.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
home.packages = with pkgs; [
prismlauncher
mangohud
Expand Down
7 changes: 2 additions & 5 deletions home-modules/git.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{ pkgs, user, ... }:
{
pkgs,
user,
...
}: {
home.packages = [pkgs.git-absorb];
home.packages = [ pkgs.git-absorb ];

programs.git = {
enable = true;
Expand Down
3 changes: 2 additions & 1 deletion home-modules/gpg.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
programs.gpg = {
enable = true;

Expand Down
3 changes: 2 additions & 1 deletion home-modules/gtk.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
home = {
pointerCursor = {
package = pkgs.phinger-cursors;
Expand Down
7 changes: 3 additions & 4 deletions home-modules/mpv.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
programs.mpv = {
enable = true;
scripts = with pkgs.mpvScripts; [
thumbfast
];
scripts = with pkgs.mpvScripts; [ thumbfast ];
config = {
loop-file = "inf";
};
Expand Down
Loading

0 comments on commit a7cb79d

Please sign in to comment.