Skip to content

Commit 5b072fd

Browse files
authored
Update flake to nixos-24.11 and install selfup in devshell (#251)
1 parent 7b2445f commit 5b072fd

File tree

6 files changed

+79
-62
lines changed

6 files changed

+79
-62
lines changed

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ jobs:
2222
- uses: actions/checkout@v4
2323
- uses: dprint/check@v2.2
2424
with:
25-
dprint-version: '0.45.1' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","dprint --version | cut -d ' ' -f 2"]}
25+
dprint-version: '0.47.2' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","dprint --version | cut -d ' ' -f 2"]}
2626

2727
typos:
2828
timeout-minutes: 15
2929
runs-on: ubuntu-24.04
3030
steps:
3131
- uses: actions/checkout@v4
32-
- uses: crate-ci/typos@v1.21.0 # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["bash","-c","typos --version | cut -d ' ' -f 2"]}
32+
- uses: crate-ci/typos@v1.27.3 # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["bash","-c","typos --version | cut -d ' ' -f 2"]}
3333
with:
3434
files: |
3535
.

.github/workflows/update-nixpkgs-and-versions-in-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
update-nixpkgs:
14-
uses: kachick/selfup/.github/workflows/reusable-bump-flake-lock-and-selfup.yml@v1.1.7
14+
uses: kachick/selfup/.github/workflows/reusable-bump-flake-lock-and-selfup.yml@v1.1.8
1515
with:
1616
app_id: ${{ vars.APP_ID }}
1717
dry-run: ${{ github.event_name == 'pull_request' }}

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
},
77
"[nix]": {
88
"editor.defaultFormatter": "jnoortheen.nix-ide"
9-
}
9+
},
10+
"nix.formatterPath": "nixfmt"
1011
}

Rakefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,10 @@ desc 'Tests except ruby'
5858
task :linters do
5959
sh('typos . .github .vscode')
6060
sh('dprint check')
61-
sh('nixpkgs-fmt --check ./*.nix')
61+
sh('nixfmt --check ./*.nix')
62+
end
63+
64+
desc 'https://github.com/kachick/selfup'
65+
task :selfup do
66+
sh('git ls-files | xargs selfup run')
6267
end

flake.lock

+20-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+48-25
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,57 @@
55
# - https://discourse.nixos.org/t/differences-between-nix-channels/13998
66
# How to update the revision
77
# - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html
8-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
9-
flake-utils.url = "github:numtide/flake-utils";
8+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
9+
selfup = {
10+
url = "github:kachick/selfup/v1.1.8";
11+
inputs.nixpkgs.follows = "nixpkgs";
12+
};
1013
};
1114

12-
outputs = { self, nixpkgs, flake-utils }:
13-
flake-utils.lib.eachDefaultSystem (system:
14-
let
15-
pkgs = nixpkgs.legacyPackages.${system};
16-
in
17-
{
18-
devShells.default = with pkgs;
19-
mkShell {
20-
buildInputs = [
21-
# https://github.com/NixOS/nix/issues/730#issuecomment-162323824
22-
bashInteractive
15+
outputs =
16+
{
17+
self,
18+
nixpkgs,
19+
selfup,
20+
}:
21+
let
22+
inherit (nixpkgs) lib;
23+
# List: https://github.com/NixOS/nixpkgs/blob/nixos-24.05/lib/systems/flake-systems.nix
24+
#
25+
# https://github.com/NixOS/nixpkgs/blob/475556854559746466df20d74eef189373816b67/flake.nix?plain=1#L11
26+
# https://github.com/NixOS/nixpkgs/blob/475556854559746466df20d74eef189373816b67/lib/systems/default.nix?plain=1#L48-L56
27+
forAllSystems = lib.genAttrs lib.systems.flakeExposed;
28+
in
29+
{
30+
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
31+
devShells = forAllSystems (
32+
system:
33+
let
34+
pkgs = nixpkgs.legacyPackages.${system};
35+
in
36+
{
37+
default = pkgs.mkShellNoCC {
38+
buildInputs =
39+
(with pkgs; [
40+
# https://github.com/NixOS/nix/issues/730#issuecomment-162323824
41+
# https://github.com/kachick/dotfiles/pull/228
42+
bashInteractive
43+
findutils # xargs
44+
nixfmt-rfc-style
45+
nil
2346

24-
ruby_3_3
25-
# Required to build psych via irb dependency
26-
# https://github.com/kachick/rspec-matchers-power_assert_matchers/issues/122
27-
# https://github.com/ruby/irb/pull/648
28-
libyaml
47+
ruby_3_3
48+
# Required to build psych via irb dependency
49+
# https://github.com/kachick/rspec-matchers-power_assert_matchers/issues/122
50+
# https://github.com/ruby/irb/pull/648
51+
libyaml
2952

30-
dprint
31-
tree
32-
nil
33-
nixpkgs-fmt
34-
typos
35-
];
53+
dprint
54+
typos
55+
])
56+
++ [ selfup.packages.${system}.default ];
3657
};
37-
});
58+
}
59+
);
60+
};
3861
}

0 commit comments

Comments
 (0)