Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 37 additions & 19 deletions .github/workflows/update-flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,40 @@ jobs:
email "$id+$name@users.noreply.github.com" \
>>"$GITHUB_OUTPUT"

- uses: DeterminateSystems/update-flake-lock@v26
with:
token: ${{ steps.generate-token.outputs.token }}
git-committer-name: ${{ steps.user-info.outputs.name }}
git-committer-email: ${{ steps.user-info.outputs.email }}
git-author-name: ${{ steps.user-info.outputs.name }}
git-author-email: ${{ steps.user-info.outputs.email }}
branch: update_flake_lock_action_${{ matrix.branch }}
commit-msg: "flake: update all inputs"
pr-title: "${{ startsWith(matrix.branch, 'release') && format('[{0}] ', matrix.branch) || '' }}stylix: update all flake inputs" # yamllint disable-line rule:line-length
pr-labels: "topic: dependencies"
pr-body: >
Automated changes by the
[update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock)
GitHub Action.

```
{{ env.GIT_COMMIT_MESSAGE }}
```
- name: setup git
env:
name: ${{ steps.user-info.outputs.name }}
email: ${{ steps.user-info.outputs.email }}
run: |
git config --global user.name "$name"
git config --global user.email "$email"

- name: update lock files
run: |
nix flake update \
--commit-lock-file \
--option commit-lock-file-summary "flake: update root inputs"

nix flake update \
--commit-lock-file \
--flake ./flake/dev \
--option commit-lock-file-summary "flake: update dev inputs"

- name: create pull request
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
base_branch: ${{ matrix.branch }}
pr_branch: update_flake_lock_action_${{ matrix.branch }}
title: "${{ startsWith(matrix.branch, 'release') && format('[{0}] ', matrix.branch) || '' }}flake: update public and dev inputs" # yamllint disable-line rule:line-length
run: |
git switch --create "$pr_branch"

git push origin "$pr_branch" \
Comment thread
0xda157 marked this conversation as resolved.
--force \
Comment thread
0xda157 marked this conversation as resolved.
--set-upstream

gh pr create \
Comment thread
0xda157 marked this conversation as resolved.
--base "$base_branch" \
--title "$title" \
--label "topic: dependencies" ||
echo "Failed to create PR"
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(import (
let
inherit (lock.nodes.flake-compat.locked) narHash rev;
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
lock = builtins.fromJSON (builtins.readFile ./flake/dev/flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${rev}.tar.gz";
Expand Down
83 changes: 0 additions & 83 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@
flake = false;
};

flake-compat.url = "github:edolstra/flake-compat";

git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs = {
flake-compat.follows = "flake-compat";
nixpkgs.follows = "nixpkgs";
};
};

gnome-shell = {
# TODO: Unlocking the input and pointing to official repository requires
# updating the patch:
Expand All @@ -59,12 +49,6 @@
flake = false;
};

# The 'home-manager' input is used to generate the documentation.
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
Comment thread
0xda157 marked this conversation as resolved.

nur = {
url = "github:nix-community/NUR";
inputs = {
Expand Down
89 changes: 12 additions & 77 deletions flake/default.nix
Original file line number Diff line number Diff line change
@@ -1,86 +1,21 @@
{ inputs, lib, ... }:
{
imports = [
inputs.flake-parts.flakeModules.partitions
./deprecation
./dev-shell.nix
./modules.nix
./packages.nix
./pre-commit.nix
./propagated-packages.nix
];

perSystem =
{ pkgs, ... }:
{
# TODO: consider using https://flake.parts/options/treefmt-nix.html once
# dev flake is partitioned
formatter = pkgs.treefmt.withConfig {
runtimeInputs = with pkgs; [
# keep-sorted start
biome
keep-sorted
nixfmt-rfc-style
ruff
stylish-haskell
# keep-sorted end
];
partitions.dev = {
module = ./dev;
extraInputsFlake = ./dev;
};

settings = {
on-unmatched = "info";
tree-root-file = "flake.nix";

formatter = {
# keep-sorted start block=yes
biome = {
command = "biome";
options = [
"format"
"--write"
"--no-errors-on-unmatched"
"--config-path"
(pkgs.writers.writeJSON "biome.json" {
formatter = {
indentStyle = "space";
indentWidth = 2;
lineWidth = 80;
};
})
];
includes = [
"*.css"
"*.js"
"*.json"
];
excludes = [
# Contains custom syntax that biome can't handle
"modules/swaync/base.css"
];
};
keep-sorted = {
command = "keep-sorted";
includes = [ "*" ];
};
nixfmt = {
command = "nixfmt";
options = [ "--width=80" ];
includes = [ "*.nix" ];
};
ruff = {
command = "ruff";
options = [
"--config"
(pkgs.writers.writeTOML "ruff.toml" {
line-length = 80;
})
"format"
];
includes = [ "*.py" ];
};
stylish-haskell = {
command = "stylish-haskell";
includes = [ "*.hx" ];
};
# keep-sorted end
};
};
};
};
partitionedAttrs = lib.genAttrs [
"checks"
"devShells"
"formatter"
] (_: "dev");
}
84 changes: 84 additions & 0 deletions flake/dev/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
imports = [
./dev-shell.nix
Comment thread
0xda157 marked this conversation as resolved.
./nixpkgs-and-dev-nixpkgs-version-consistency.nix
Comment thread
0xda157 marked this conversation as resolved.
./packages.nix
./pre-commit.nix
];

perSystem =
{ pkgs, ... }:
{
# TODO: consider using https://flake.parts/options/treefmt-nix.html
formatter = pkgs.treefmt.withConfig {
Comment thread
0xda157 marked this conversation as resolved.
runtimeInputs = with pkgs; [
# keep-sorted start
biome
keep-sorted
nixfmt-rfc-style
ruff
stylish-haskell
# keep-sorted end
];

settings = {
on-unmatched = "info";
tree-root-file = "flake.nix";

formatter = {
# keep-sorted start block=yes
biome = {
command = "biome";
options = [
"format"
"--write"
"--no-errors-on-unmatched"
"--config-path"
(pkgs.writers.writeJSON "biome.json" {
formatter = {
indentStyle = "space";
indentWidth = 2;
lineWidth = 80;
};
})
];
includes = [
"*.css"
"*.js"
"*.json"
];
excludes = [
# Contains custom syntax that biome can't handle
"modules/swaync/base.css"
];
};
keep-sorted = {
command = "keep-sorted";
includes = [ "*" ];
};
nixfmt = {
command = "nixfmt";
options = [ "--width=80" ];
includes = [ "*.nix" ];
};
ruff = {
command = "ruff";
options = [
"--config"
(pkgs.writers.writeTOML "ruff.toml" {
line-length = 80;
})
"format"
];
includes = [ "*.py" ];
};
stylish-haskell = {
command = "stylish-haskell";
includes = [ "*.hx" ];
};
# keep-sorted end
};
};
};
};
}
File renamed without changes.
Loading