aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-02-28 14:39:47 +0900
committerOphestra <cat@gensokyo.uk>2025-02-28 14:43:46 +0900
commit2d4cabe7860cb7ef7aa5bb6a3c21153e624d61b6 (patch)
treecd93b9d2a423bd8112a88327f7b3564fed214547
parent80f9b62d254d4ad8ea05784a509a81d9851f30aa (diff)
nix: increase nixfmt max width
Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--cmd/fpkg/build.nix6
-rw-r--r--flake.nix26
-rw-r--r--nixos.nix17
-rw-r--r--package.nix5
4 files changed, 17 insertions, 37 deletions
diff --git a/cmd/fpkg/build.nix b/cmd/fpkg/build.nix
index 00244538..17dfa93e 100644
--- a/cmd/fpkg/build.nix
+++ b/cmd/fpkg/build.nix
@@ -171,11 +171,7 @@ let
broadcast = { };
});
- enablements =
- (if allow_wayland then 1 else 0)
- + (if allow_x11 then 2 else 0)
- + (if allow_dbus then 4 else 0)
- + (if allow_pulse then 8 else 0);
+ enablements = (if allow_wayland then 1 else 0) + (if allow_x11 then 2 else 0) + (if allow_dbus then 4 else 0) + (if allow_pulse then 8 else 0);
mesa = if gpu then mesaWrappers else null;
nix_gl = if gpu then nixGL else null;
diff --git a/flake.nix b/flake.nix
index e1dccece..b32b5a73 100644
--- a/flake.nix
+++ b/flake.nix
@@ -68,7 +68,7 @@
cd ${./.}
echo "running nixfmt..."
- nixfmt --check .
+ nixfmt --width=256 --check .
touch $out
'';
@@ -115,21 +115,19 @@
};
fsu = pkgs.callPackage ./cmd/fsu/package.nix { inherit (self.packages.${system}) fortify; };
- dist =
- pkgs.runCommand "${fortify.name}-dist" { inherit (self.devShells.${system}.default) buildInputs; }
- ''
- # go requires XDG_CACHE_HOME for the build cache
- export XDG_CACHE_HOME="$(mktemp -d)"
+ dist = pkgs.runCommand "${fortify.name}-dist" { inherit (self.devShells.${system}.default) buildInputs; } ''
+ # go requires XDG_CACHE_HOME for the build cache
+ export XDG_CACHE_HOME="$(mktemp -d)"
- # get a different workdir as go does not like /build
- cd $(mktemp -d) \
- && cp -r ${fortify.src}/. . \
- && chmod +w cmd && cp -r ${fsu.src}/. cmd/fsu/ \
- && chmod -R +w .
+ # get a different workdir as go does not like /build
+ cd $(mktemp -d) \
+ && cp -r ${fortify.src}/. . \
+ && chmod +w cmd && cp -r ${fsu.src}/. cmd/fsu/ \
+ && chmod -R +w .
- export FORTIFY_VERSION="v${fortify.version}"
- ./dist/release.sh && mkdir $out && cp -v "dist/fortify-$FORTIFY_VERSION.tar.gz"* $out
- '';
+ export FORTIFY_VERSION="v${fortify.version}"
+ ./dist/release.sh && mkdir $out && cp -v "dist/fortify-$FORTIFY_VERSION.tar.gz"* $out
+ '';
fhs = pkgs.buildFHSEnv {
pname = "fortify-fhs";
diff --git a/nixos.nix b/nixos.nix
index e41648a9..aa2f1788 100644
--- a/nixos.nix
+++ b/nixos.nix
@@ -77,21 +77,12 @@ in
};
in
{
- session_bus =
- if app.dbus.session != null then
- (app.dbus.session (extendDBusDefault app.id))
- else
- (extendDBusDefault app.id default);
+ session_bus = if app.dbus.session != null then (app.dbus.session (extendDBusDefault app.id)) else (extendDBusDefault app.id default);
system_bus = app.dbus.system;
};
command = if app.command == null then app.name else app.command;
script = if app.script == null then ("exec " + command + " $@") else app.script;
- enablements =
- with app.capability;
- (if wayland then 1 else 0)
- + (if x11 then 2 else 0)
- + (if dbus then 4 else 0)
- + (if pulse then 8 else 0);
+ enablements = with app.capability; (if wayland then 1 else 0) + (if x11 then 2 else 0) + (if dbus then 4 else 0) + (if pulse then 8 else 0);
conf = {
inherit (app) id;
command = [
@@ -165,9 +156,7 @@ in
};
in
pkgs.writeShellScriptBin app.name ''
- exec fortify${
- if app.verbose then " -v" else ""
- } app ${pkgs.writeText "fortify-${app.name}.json" (builtins.toJSON conf)} $@
+ exec fortify${if app.verbose then " -v" else ""} app ${pkgs.writeText "fortify-${app.name}.json" (builtins.toJSON conf)} $@
''
) cfg.apps;
in
diff --git a/package.nix b/package.nix
index 056a9c53..3088ec3e 100644
--- a/package.nix
+++ b/package.nix
@@ -30,10 +30,7 @@ buildGoModule rec {
src = builtins.path {
name = "${pname}-src";
path = lib.cleanSource ./.;
- filter =
- path: type:
- !(type == "regular" && (lib.hasSuffix ".nix" path || lib.hasSuffix ".py" path))
- && !(type == "directory" && lib.hasSuffix "/cmd/fsu" path);
+ filter = path: type: !(type == "regular" && (lib.hasSuffix ".nix" path || lib.hasSuffix ".py" path)) && !(type == "directory" && lib.hasSuffix "/cmd/fsu" path);
};
vendorHash = null;