diff --git a/cmd/fpkg/build.nix b/cmd/fpkg/build.nix index 0024453..17dfa93 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 e1dccec..b32b5a7 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 e41648a..aa2f178 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 056a9c5..3088ec3 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;