Skip to content

Commit

Permalink
treewide: refomat
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Meyer <[email protected]>
  • Loading branch information
katexochen committed Dec 16, 2024
1 parent 237194b commit ca9f408
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 102 deletions.
1 change: 0 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
workflow_dispatch:
pull_request:


jobs:
build:
name: build binary
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ jobs:
actionlint
vendorhash:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down
96 changes: 53 additions & 43 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,58 +14,68 @@
};
};

outputs = { self, nixpkgs, flake-utils, treefmt-nix }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
uplosi = pkgs.buildGoModule {
pname = "uplosi";
version = "devel";
src = ./.;
# this needs to be updated together with go.mod / go.sum
vendorHash = "sha256-2lJmPNLpI1ksFb0EtcjPjyTy7eX1DKeX0F80k9FtGno=";
outputs =
{
self,
nixpkgs,
flake-utils,
treefmt-nix,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};

CGO_ENABLED = 0;
uplosi = pkgs.buildGoModule {
pname = "uplosi";
version = "devel";
src = ./.;
# this needs to be updated together with go.mod / go.sum
vendorHash = "sha256-2lJmPNLpI1ksFb0EtcjPjyTy7eX1DKeX0F80k9FtGno=";

ldflags = [ "-s" ];
CGO_ENABLED = 0;

nativeBuildInputs = [ pkgs.installShellFiles ];
ldflags = [ "-s" ];

postInstall = ''
installShellCompletion --cmd uplosi \
--bash <($out/bin/uplosi completion bash) \
--fish <($out/bin/uplosi completion fish) \
--zsh <($out/bin/uplosi completion zsh)
'';
nativeBuildInputs = [ pkgs.installShellFiles ];

meta = with pkgs.lib; {
description = "Upload OS images to cloud provider";
homepage = "https://github.com/edgelesssys/uplosi";
maintainers = with maintainers; [ katexochen malt3 ];
license = licenses.asl20;
};
postInstall = ''
installShellCompletion --cmd uplosi \
--bash <($out/bin/uplosi completion bash) \
--fish <($out/bin/uplosi completion fish) \
--zsh <($out/bin/uplosi completion zsh)
'';

meta = with pkgs.lib; {
description = "Upload OS images to cloud provider";
homepage = "https://github.com/edgelesssys/uplosi";
maintainers = with maintainers; [
katexochen
malt3
];
license = licenses.asl20;
};
};

treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in
{
devShells.default = import ./shell.nix { inherit pkgs; };
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in
{
devShells.default = import ./shell.nix { inherit pkgs; };

packages = {
default = uplosi;
uplosi = uplosi;
};
packages = {
default = uplosi;
inherit uplosi;
};

legacyPackages = {
nixpkgs = nixpkgs.legacyPackages.${system};
};
legacyPackages = {
nixpkgs = nixpkgs.legacyPackages.${system};
};

formatter = treefmtEval.config.build.wrapper;
formatter = treefmtEval.config.build.wrapper;

checks = {
formatting = treefmtEval.config.build.check self;
};
}
);
checks = {
formatting = treefmtEval.config.build.check self;
};
}
);
}
2 changes: 1 addition & 1 deletion hack/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set -euo pipefail
target=$(mktemp)
truncate -s 21MiB "${target}"
parted -s -a optimal "${target}" -- \
mklabel msdos mkpart primary ext4 1MiB 100%
mklabel msdos mkpart primary ext4 1MiB 100%
echo "${target}"
90 changes: 38 additions & 52 deletions renovate.json5
Original file line number Diff line number Diff line change
@@ -1,80 +1,66 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
":preserveSemverRanges",
"helpers:pinGitHubActionDigests",
":separateMajorReleases",
":semanticCommitsDisabled",
":separateMajorReleases",
"config:recommended",
"helpers:pinGitHubActionDigests",
],
"commitMessagePrefix": "deps:",
"commitMessageAction": "update",
"addLabels": [
"dependencies"
],
"postUpdateOptions": [
commitMessagePrefix: "deps:",
commitMessageAction: "update",
addLabels: [ "dependencies" ],
postUpdateOptions: [
"gomodTidy",
"gomodUpdateImportPaths"
"gomodUpdateImportPaths",
],
"prConcurrentLimit": 1,
"nix": {
"enabled": true,
prConcurrentLimit: 1,
nix: { enabled: true },
lockFileMaintenance: {
enabled: true,
commitMessageAction: "flake.lock: Update",
commitMessagePrefix: null,
schedule: [ "before 4am" ],
},
"lockFileMaintenance": {
"enabled": true,
"commitMessageAction": "flake.lock: Update",
"commitMessagePrefix": null,
"schedule": ["before 4am"],
},
"packageRules": [
packageRules: [
{
"matchManagers": ["gomod"],
"matchDepTypes": ["indirect"],
"enabled": true,
matchManagers: [ "gomod" ],
matchDepTypes: [ "indirect" ],
enabled: true,
},
{
"groupName": "Go indirect dependencies",
"matchManagers": [
"gomod"
],
"matchDepTypes": [
"indirect"
],
"prPriority": -30,
groupName: "Go indirect dependencies",
matchManagers: [ "gomod" ],
matchDepTypes: [ "indirect" ],
prPriority: -30,
},
{
"groupName": "Go dependencies",
"matchManagers": [
"gomod"
],
"matchDepTypes": [
"require"
],
"matchUpdateTypes": [
groupName: "Go dependencies",
matchManagers: [ "gomod" ],
matchDepTypes: [ "require" ],
matchUpdateTypes: [
"bump",
"digest",
"lockFileMaintenance",
"minor",
"patch",
"pin",
"pinDigest",
"digest",
"lockFileMaintenance",
"rollback",
"bump",
],
},
{
"matchManagers": [
"github-actions"
],
"groupName": "GitHub action dependencies",
"matchUpdateTypes": [
matchManagers: [ "github-actions" ],
groupName: "GitHub action dependencies",
matchUpdateTypes: [
"bump",
"digest",
"lockFileMaintenance",
"minor",
"patch",
"pin",
"pinDigest",
"digest",
"lockFileMaintenance",
"rollback",
"bump",
],
},
],
Expand Down
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ pkgs, ... }:

pkgs.mkShell {
nativeBuildInputs = with pkgs; [
go
Expand Down

0 comments on commit ca9f408

Please sign in to comment.