|
73 | 73 | value = pkgs.rustPlatform.rustLibSrc;
|
74 | 74 | }
|
75 | 75 | ];
|
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 |
88 | 87 |
|
89 |
| - features=( "gnome" "hypr" "sway" "x11" "wlroots" "kde" ) |
| 88 | + features=( "gnome" "hypr" "sway" "x11" "wlroots" "kde" ) |
90 | 89 |
|
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 | + ); |
123 | 122 | packages = builtins.attrValues {
|
124 | 123 | inherit (pkgs) cargo rustc rustfmt;
|
125 | 124 | inherit (pkgs.rustPackages) clippy;
|
|
128 | 127 | treefmt = {
|
129 | 128 | projectRootFile = "flake.nix";
|
130 | 129 | programs = {
|
131 |
| - nixfmt-rfc-style.enable = true; |
| 130 | + nixfmt.enable = true; |
132 | 131 | statix.enable = true;
|
133 | 132 | deadnix.enable = true;
|
134 | 133 | };
|
|
0 commit comments