Skip to content

Commit 6b28ae4

Browse files
committed
refactor: move to nixfmt, drop obsolete reference to rfc-style one, reformat
1 parent 43508c1 commit 6b28ae4

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

flake.nix

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -73,53 +73,52 @@
7373
value = pkgs.rustPlatform.rustLibSrc;
7474
}
7575
];
76-
commands =
77-
[
78-
{
79-
help = "Build xremap (no features)";
80-
name = "build-xremap-no-features";
81-
command = "nix build .#";
82-
}
83-
{
84-
help = "Build xremap with features one by one";
85-
name = "test-build-all-features";
86-
command = ''
87-
set -euo pipefail
76+
commands = [
77+
{
78+
help = "Build xremap (no features)";
79+
name = "build-xremap-no-features";
80+
command = "nix build .#";
81+
}
82+
{
83+
help = "Build xremap with features one by one";
84+
name = "test-build-all-features";
85+
command = ''
86+
set -euo pipefail
8887
89-
features=( "gnome" "hypr" "sway" "x11" "wlroots" "kde" )
88+
features=( "gnome" "hypr" "sway" "x11" "wlroots" "kde" )
9089
91-
for feature in "''${features[@]}"; do
92-
echo "Building feature $feature"
93-
nix build .#xremap-''${feature}
94-
echo "Build successful"
95-
done
96-
'';
97-
}
98-
{
99-
help = "SSH into the dev VM. Disregards the known hosts file";
100-
name = "vm-ssh";
101-
command = ''ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -p 64022 alice@localhost'';
102-
}
103-
]
104-
++ (
105-
# Construct runners for all development VMs
106-
let
107-
definedVMs = self.nixosConfigurations;
108-
namesOfVMs = builtins.attrNames definedVMs;
109-
getVMcomment =
110-
vmName:
111-
if builtins.hasAttr "_comment" definedVMs.${vmName} then definedVMs.${vmName}._comment else "";
112-
in
113-
map (nixosSystem: {
114-
help = "Run VM for testing ${nixosSystem}";
115-
name = "vm-run-${nixosSystem}";
116-
command = ''
117-
echo "Launching VM"
118-
echo "${getVMcomment nixosSystem}"
119-
nix run .#nixosConfigurations.${nixosSystem}.config.system.build.vm
120-
'';
121-
}) namesOfVMs
122-
);
90+
for feature in "''${features[@]}"; do
91+
echo "Building feature $feature"
92+
nix build .#xremap-''${feature}
93+
echo "Build successful"
94+
done
95+
'';
96+
}
97+
{
98+
help = "SSH into the dev VM. Disregards the known hosts file";
99+
name = "vm-ssh";
100+
command = ''ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -p 64022 alice@localhost'';
101+
}
102+
]
103+
++ (
104+
# Construct runners for all development VMs
105+
let
106+
definedVMs = self.nixosConfigurations;
107+
namesOfVMs = builtins.attrNames definedVMs;
108+
getVMcomment =
109+
vmName:
110+
if builtins.hasAttr "_comment" definedVMs.${vmName} then definedVMs.${vmName}._comment else "";
111+
in
112+
map (nixosSystem: {
113+
help = "Run VM for testing ${nixosSystem}";
114+
name = "vm-run-${nixosSystem}";
115+
command = ''
116+
echo "Launching VM"
117+
echo "${getVMcomment nixosSystem}"
118+
nix run .#nixosConfigurations.${nixosSystem}.config.system.build.vm
119+
'';
120+
}) namesOfVMs
121+
);
123122
packages = builtins.attrValues {
124123
inherit (pkgs) cargo rustc rustfmt;
125124
inherit (pkgs.rustPackages) clippy;
@@ -128,7 +127,7 @@
128127
treefmt = {
129128
projectRootFile = "flake.nix";
130129
programs = {
131-
nixfmt-rfc-style.enable = true;
130+
nixfmt.enable = true;
132131
statix.enable = true;
133132
deadnix.enable = true;
134133
};

modules/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@ with lib;
4848
description = "Name of user logging into graphical session";
4949
};
5050
watch = mkEnableOption "running xremap watching new devices";
51-
} // localLib.commonOptions;
51+
}
52+
// localLib.commonOptions;
5253
}

0 commit comments

Comments
 (0)