diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-01-22 12:50:17 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-01-22 12:50:17 +0900 |
| commit | 9d03982f63be8baa73f1072c51fe8fa15fcf6c20 (patch) | |
| tree | d5c1385a3c0bd16f803d846457b4b1348e7dd813 | |
| parent | c225c06ab661f5c2fbc34b2eafc0b68001305846 (diff) | |
| download | dotfiles-9d03982f63be8baa73f1072c51fe8fa15fcf6c20.tar.gz dotfiles-9d03982f63be8baa73f1072c51fe8fa15fcf6c20.tar.zst dotfiles-9d03982f63be8baa73f1072c51fe8fa15fcf6c20.zip | |
nix: introduce `nixfmt`
| -rw-r--r-- | flake.nix | 76 | ||||
| -rw-r--r-- | home-manager/home.nix | 36 |
2 files changed, 62 insertions, 50 deletions
@@ -20,42 +20,48 @@ }; }; - outputs = { - nixpkgs, - flake-utils, - home-manager, - ... - }: - let - readJSON = p: builtins.fromJSON (builtins.readFile p); - machines = [ - (readJSON ./mitamae/node.akashi.json) - (readJSON ./mitamae/node.hotaru.json) - (readJSON ./mitamae/node.pc168.json) - ]; - mkHomeConfiguration = { - system, - env, + outputs = + { + nixpkgs, + flake-utils, + home-manager, ... - }: home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; - extraSpecialArgs = { inherit env; }; - modules = [ - ./home-manager/home.nix + }: + let + readJSON = p: builtins.fromJSON (builtins.readFile p); + machines = [ + (readJSON ./mitamae/node.akashi.json) + (readJSON ./mitamae/node.hotaru.json) + (readJSON ./mitamae/node.pc168.json) ]; + mkHomeConfiguration = + { + system, + env, + ... + }: + home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + extraSpecialArgs = { inherit env; }; + modules = [ + ./home-manager/home.nix + ]; + }; + in + flake-utils.lib.eachDefaultSystem (system: { + formatter = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style; + }) + // { + homeConfigurations = ( + builtins.listToAttrs ( + builtins.map (machine: { + name = machine.name; + value = mkHomeConfiguration machine.flake; + }) machines + ) + ); }; - in { - homeConfigurations = ( - builtins.listToAttrs ( - builtins.map (machine: { - name = machine.name; - value = mkHomeConfiguration machine.flake; - }) - machines - ) - ); - }; } diff --git a/home-manager/home.nix b/home-manager/home.nix index e0ecd43..a69cae3 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -49,9 +49,13 @@ in pkgs.zig_0_13 (pkgs.php84.buildEnv { - extensions = ({ enabled, all }: enabled ++ (with all; [ - ffi - ])); + extensions = ( + { enabled, all }: + enabled + ++ (with all; [ + ffi + ]) + ); extraConfig = '' ffi.enable=true ''; @@ -117,18 +121,20 @@ in extraConfig = let commonConfig = builtins.readFile ./config/tmux/tmux.conf; - clipboardConfig = if clipboardCopyCommand != null then - '' - bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "${clipboardCopyCommand}" - '' - else - ""; - terminalConfig = if terminalApp == "alacritty" then - '' - set-option -ga terminal-overrides ',alacritty:RGB' - '' - else - ""; + clipboardConfig = + if clipboardCopyCommand != null then + '' + bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "${clipboardCopyCommand}" + '' + else + ""; + terminalConfig = + if terminalApp == "alacritty" then + '' + set-option -ga terminal-overrides ',alacritty:RGB' + '' + else + ""; in commonConfig + clipboardConfig + terminalConfig; }; |
